@solid-design-system/components 6.4.0 → 6.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cdn/chunks/chunk.I6EGY7RT.js +2 -0
- package/cdn/components/datepicker/datepicker.d.ts +3 -0
- package/cdn/components/datepicker/datepicker.js +1 -1
- package/cdn/custom-elements.json +8 -1
- package/cdn/solid-components.bundle.js +76 -76
- package/cdn/solid-components.iife.js +76 -76
- package/cdn/solid-components.js +1 -1
- package/cdn/web-types.json +2 -1
- package/cdn-versioned/chunks/chunk.2DPSCPM4.js +2 -2
- package/cdn-versioned/chunks/chunk.2HJLVWCE.js +2 -2
- package/cdn-versioned/chunks/chunk.2KV3QDYA.js +2 -2
- package/cdn-versioned/chunks/chunk.3ETEQAPR.js +2 -2
- package/cdn-versioned/chunks/chunk.47H4SDKN.js +2 -2
- package/cdn-versioned/chunks/chunk.4LGCXG7D.js +2 -2
- package/cdn-versioned/chunks/chunk.4P5PT6MV.js +2 -2
- package/cdn-versioned/chunks/chunk.5M2K2EXR.js +2 -2
- package/cdn-versioned/chunks/chunk.5OE2GCRH.js +2 -2
- package/cdn-versioned/chunks/chunk.6GU6NFBF.js +1 -1
- package/cdn-versioned/chunks/chunk.745GDIND.js +2 -2
- package/cdn-versioned/chunks/chunk.ALCKOGA7.js +1 -1
- package/cdn-versioned/chunks/chunk.BZ3VHECJ.js +3 -3
- package/cdn-versioned/chunks/chunk.C44GZOLG.js +9 -9
- package/cdn-versioned/chunks/chunk.C4QT4K6T.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.CMY3VPYA.js +2 -2
- package/cdn-versioned/chunks/chunk.D5FVDNYV.js +2 -2
- package/cdn-versioned/chunks/chunk.DEEJ4ON7.js +2 -2
- package/cdn-versioned/chunks/chunk.DXGVZ3KG.js +1 -1
- package/cdn-versioned/chunks/chunk.E64WXH47.js +1 -1
- package/cdn-versioned/chunks/chunk.EASLRW3B.js +2 -2
- package/cdn-versioned/chunks/chunk.G42N3VHE.js +2 -2
- package/cdn-versioned/chunks/chunk.GP2QVZP5.js +1 -1
- package/cdn-versioned/chunks/chunk.H77CNSMK.js +2 -2
- package/cdn-versioned/chunks/chunk.HHASCDC2.js +5 -5
- package/cdn-versioned/chunks/chunk.I234MSSB.js +2 -2
- package/cdn-versioned/chunks/chunk.I3TTTGLW.js +1 -1
- package/cdn-versioned/chunks/chunk.I6EGY7RT.js +2 -0
- package/cdn-versioned/chunks/chunk.IAEOXYGB.js +1 -1
- package/cdn-versioned/chunks/chunk.JRSX44R6.js +2 -2
- package/cdn-versioned/chunks/chunk.KKKGNXIR.js +2 -2
- package/cdn-versioned/chunks/chunk.KM5W4EDY.js +2 -2
- package/cdn-versioned/chunks/chunk.L6PAHLSN.js +2 -2
- package/cdn-versioned/chunks/chunk.MWO5B7BA.js +2 -2
- package/cdn-versioned/chunks/chunk.OAVVKKBJ.js +2 -2
- package/cdn-versioned/chunks/chunk.OG2BQH6T.js +2 -2
- package/cdn-versioned/chunks/chunk.PDHMAKVQ.js +2 -2
- package/cdn-versioned/chunks/chunk.PPIS2HQ5.js +1 -1
- package/cdn-versioned/chunks/chunk.PRGLNPUF.js +1 -1
- package/cdn-versioned/chunks/chunk.PT6G5HKE.js +1 -1
- package/cdn-versioned/chunks/chunk.Q6GEIXGA.js +2 -2
- package/cdn-versioned/chunks/chunk.QMKNC76J.js +2 -2
- package/cdn-versioned/chunks/chunk.QUGI3FMS.js +2 -2
- package/cdn-versioned/chunks/chunk.RBVWPWFK.js +2 -2
- package/cdn-versioned/chunks/chunk.S4II2NTI.js +2 -2
- package/cdn-versioned/chunks/chunk.S7VIPIYX.js +2 -2
- package/cdn-versioned/chunks/chunk.TWNEU4H4.js +3 -3
- package/cdn-versioned/chunks/chunk.TWTQHJPN.js +2 -2
- package/cdn-versioned/chunks/chunk.U44PXBV2.js +2 -2
- package/cdn-versioned/chunks/chunk.U5N7L5RI.js +2 -2
- package/cdn-versioned/chunks/chunk.UVRZTPOZ.js +2 -2
- package/cdn-versioned/chunks/chunk.VAUP57XZ.js +2 -2
- package/cdn-versioned/chunks/chunk.VMUNNUNV.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.WOZKICWV.js +5 -5
- package/cdn-versioned/chunks/chunk.XAPH6XNH.js +2 -2
- package/cdn-versioned/chunks/chunk.XQWDDXL2.js +2 -2
- package/cdn-versioned/chunks/chunk.XTRMRKZ6.js +2 -2
- package/cdn-versioned/chunks/chunk.Z6TAAGCD.js +2 -2
- package/cdn-versioned/chunks/chunk.ZTELVJ34.js +1 -1
- package/cdn-versioned/chunks/chunk.ZVHLKL7F.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 +4 -1
- package/cdn-versioned/components/datepicker/datepicker.js +1 -1
- package/cdn-versioned/components/dialog/dialog.d.ts +1 -1
- package/cdn-versioned/components/divider/divider.d.ts +1 -1
- package/cdn-versioned/components/drawer/drawer.d.ts +1 -1
- package/cdn-versioned/components/dropdown/dropdown.d.ts +1 -1
- package/cdn-versioned/components/expandable/expandable.d.ts +1 -1
- package/cdn-versioned/components/flipcard/flipcard.d.ts +1 -1
- package/cdn-versioned/components/header/header.d.ts +1 -1
- package/cdn-versioned/components/icon/icon.d.ts +1 -1
- package/cdn-versioned/components/include/include.d.ts +1 -1
- package/cdn-versioned/components/input/input.d.ts +1 -1
- package/cdn-versioned/components/link/link.d.ts +1 -1
- package/cdn-versioned/components/loader/loader.d.ts +1 -1
- package/cdn-versioned/components/map-marker/map-marker.d.ts +1 -1
- package/cdn-versioned/components/menu/menu.d.ts +1 -1
- package/cdn-versioned/components/menu-item/menu-item.d.ts +1 -1
- package/cdn-versioned/components/navigation-item/navigation-item.d.ts +1 -1
- package/cdn-versioned/components/notification/notification.d.ts +1 -1
- package/cdn-versioned/components/optgroup/optgroup.d.ts +1 -1
- package/cdn-versioned/components/option/option.d.ts +1 -1
- package/cdn-versioned/components/popup/popup.d.ts +1 -1
- package/cdn-versioned/components/quickfact/quickfact.d.ts +1 -1
- package/cdn-versioned/components/radio/radio.d.ts +1 -1
- package/cdn-versioned/components/radio-button/radio-button.d.ts +1 -1
- package/cdn-versioned/components/radio-group/radio-group.d.ts +1 -1
- package/cdn-versioned/components/range/range.d.ts +1 -1
- package/cdn-versioned/components/range-tick/range-tick.d.ts +1 -1
- package/cdn-versioned/components/scrollable/scrollable.d.ts +1 -1
- package/cdn-versioned/components/select/select.d.ts +1 -1
- package/cdn-versioned/components/skeleton/skeleton.d.ts +1 -1
- package/cdn-versioned/components/spinner/spinner.d.ts +1 -1
- package/cdn-versioned/components/step/step.d.ts +1 -1
- package/cdn-versioned/components/step-group/step-group.d.ts +1 -1
- package/cdn-versioned/components/switch/switch.d.ts +1 -1
- package/cdn-versioned/components/tab/tab.d.ts +1 -1
- package/cdn-versioned/components/tab-group/tab-group.d.ts +1 -1
- package/cdn-versioned/components/tab-panel/tab-panel.d.ts +1 -1
- package/cdn-versioned/components/tag/tag.d.ts +1 -1
- package/cdn-versioned/components/textarea/textarea.d.ts +1 -1
- package/cdn-versioned/components/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 +251 -244
- package/cdn-versioned/internal/form.js +3 -3
- package/cdn-versioned/solid-components.bundle.js +86 -86
- package/cdn-versioned/solid-components.css +2 -2
- package/cdn-versioned/solid-components.iife.js +86 -86
- package/cdn-versioned/solid-components.js +1 -1
- package/cdn-versioned/vscode.html-custom-data.json +94 -94
- package/cdn-versioned/web-types.json +158 -157
- package/dist/chunks/{chunk.QM4E25CD.js → chunk.CMGWC5BG.js} +46 -15
- package/dist/components/datepicker/datepicker.d.ts +3 -0
- package/dist/components/datepicker/datepicker.js +1 -1
- package/dist/custom-elements.json +8 -1
- package/dist/solid-components.js +1 -1
- package/dist/web-types.json +2 -1
- package/dist-versioned/chunks/chunk.22PWID5B.js +2 -2
- package/dist-versioned/chunks/chunk.2EWH2DC2.js +1 -1
- package/dist-versioned/chunks/chunk.2HTII44Q.js +4 -4
- package/dist-versioned/chunks/chunk.2VPWVTT6.js +4 -4
- package/dist-versioned/chunks/chunk.3EJL5IKL.js +1 -1
- package/dist-versioned/chunks/chunk.3PTRIEGP.js +2 -2
- package/dist-versioned/chunks/chunk.4UT3FCHQ.js +2 -2
- package/dist-versioned/chunks/chunk.5XWO3USG.js +3 -3
- package/dist-versioned/chunks/chunk.75WDCMIC.js +24 -24
- package/dist-versioned/chunks/chunk.ASEJW6QN.js +5 -5
- package/dist-versioned/chunks/chunk.AUSBWPVD.js +7 -7
- package/dist-versioned/chunks/chunk.AZPOFDJP.js +4 -4
- package/dist-versioned/chunks/chunk.BBLAIT57.js +2 -2
- package/dist-versioned/chunks/chunk.BSP6J6R2.js +2 -2
- package/dist-versioned/chunks/chunk.BTNS6ZNO.js +4 -4
- package/dist-versioned/chunks/chunk.C3WIBDGG.js +3 -3
- package/dist-versioned/chunks/{chunk.QM4E25CD.js → chunk.CMGWC5BG.js} +48 -17
- package/dist-versioned/chunks/chunk.D4UC3BVQ.js +12 -12
- package/dist-versioned/chunks/chunk.D7CJJHHA.js +1 -1
- package/dist-versioned/chunks/chunk.DCHRUIDY.js +1 -1
- package/dist-versioned/chunks/chunk.DCOB6WLB.js +3 -3
- package/dist-versioned/chunks/chunk.DFHY67LW.js +5 -5
- package/dist-versioned/chunks/chunk.DTTVI7KT.js +11 -11
- package/dist-versioned/chunks/chunk.DXDDB6AB.js +1 -1
- package/dist-versioned/chunks/chunk.FKFGVTXH.js +3 -3
- package/dist-versioned/chunks/chunk.FSUOT4WC.js +12 -12
- package/dist-versioned/chunks/chunk.IJIPMNT2.js +3 -3
- package/dist-versioned/chunks/chunk.IYXPHPNO.js +1 -1
- package/dist-versioned/chunks/chunk.JGRI4R23.js +1 -1
- package/dist-versioned/chunks/chunk.K66JHYHC.js +2 -2
- package/dist-versioned/chunks/chunk.KEJFWGZI.js +4 -4
- package/dist-versioned/chunks/chunk.L2RS3IA6.js +8 -8
- package/dist-versioned/chunks/chunk.L3OEOSPQ.js +1 -1
- package/dist-versioned/chunks/chunk.L6ZE3RXX.js +14 -14
- package/dist-versioned/chunks/chunk.LBDV5GNR.js +4 -4
- package/dist-versioned/chunks/chunk.LZVVDTSP.js +26 -26
- package/dist-versioned/chunks/chunk.M2D3WWF3.js +8 -8
- package/dist-versioned/chunks/chunk.MH7JHBWP.js +2 -2
- package/dist-versioned/chunks/chunk.MLRNCOWA.js +3 -3
- package/dist-versioned/chunks/chunk.NEUULRS7.js +5 -5
- package/dist-versioned/chunks/chunk.OJXVBFUH.js +5 -5
- package/dist-versioned/chunks/chunk.P5FGSFP3.js +1 -1
- package/dist-versioned/chunks/chunk.PBXAIJQ4.js +5 -5
- package/dist-versioned/chunks/chunk.Q7ZMX7IB.js +3 -3
- package/dist-versioned/chunks/chunk.R56JDQAF.js +2 -2
- package/dist-versioned/chunks/chunk.RFDAZXJG.js +3 -3
- package/dist-versioned/chunks/chunk.SCWR4Q4K.js +10 -10
- package/dist-versioned/chunks/chunk.SQYISG5I.js +4 -4
- package/dist-versioned/chunks/chunk.SVYFJMYF.js +3 -3
- package/dist-versioned/chunks/chunk.T46LX45D.js +6 -6
- package/dist-versioned/chunks/chunk.TNJNUASM.js +1 -1
- package/dist-versioned/chunks/chunk.TUMONDN4.js +4 -4
- package/dist-versioned/chunks/chunk.TVWV4PUH.js +2 -2
- package/dist-versioned/chunks/chunk.U2BN2DBY.js +4 -4
- package/dist-versioned/chunks/chunk.UDPSGKZL.js +4 -4
- package/dist-versioned/chunks/chunk.UIQBHPD3.js +2 -2
- package/dist-versioned/chunks/chunk.UPCVQSXM.js +3 -3
- package/dist-versioned/chunks/chunk.UWQPJU3Q.js +3 -3
- package/dist-versioned/chunks/chunk.XALPLS2Y.js +6 -6
- package/dist-versioned/chunks/chunk.XV2UO6TF.js +2 -2
- package/dist-versioned/chunks/chunk.YATRFNET.js +28 -28
- package/dist-versioned/chunks/chunk.YFRD2UEO.js +8 -8
- package/dist-versioned/chunks/chunk.YNBR5ZDU.js +4 -4
- package/dist-versioned/chunks/chunk.ZMEUQIVY.js +9 -9
- 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 +4 -1
- package/dist-versioned/components/datepicker/datepicker.js +1 -1
- package/dist-versioned/components/dialog/dialog.d.ts +1 -1
- package/dist-versioned/components/divider/divider.d.ts +1 -1
- package/dist-versioned/components/drawer/drawer.d.ts +1 -1
- package/dist-versioned/components/dropdown/dropdown.d.ts +1 -1
- package/dist-versioned/components/expandable/expandable.d.ts +1 -1
- package/dist-versioned/components/flipcard/flipcard.d.ts +1 -1
- package/dist-versioned/components/header/header.d.ts +1 -1
- package/dist-versioned/components/icon/icon.d.ts +1 -1
- package/dist-versioned/components/include/include.d.ts +1 -1
- package/dist-versioned/components/input/input.d.ts +1 -1
- package/dist-versioned/components/link/link.d.ts +1 -1
- package/dist-versioned/components/loader/loader.d.ts +1 -1
- package/dist-versioned/components/map-marker/map-marker.d.ts +1 -1
- package/dist-versioned/components/menu/menu.d.ts +1 -1
- package/dist-versioned/components/menu-item/menu-item.d.ts +1 -1
- package/dist-versioned/components/navigation-item/navigation-item.d.ts +1 -1
- package/dist-versioned/components/notification/notification.d.ts +1 -1
- package/dist-versioned/components/optgroup/optgroup.d.ts +1 -1
- package/dist-versioned/components/option/option.d.ts +1 -1
- package/dist-versioned/components/popup/popup.d.ts +1 -1
- package/dist-versioned/components/quickfact/quickfact.d.ts +1 -1
- package/dist-versioned/components/radio/radio.d.ts +1 -1
- package/dist-versioned/components/radio-button/radio-button.d.ts +1 -1
- package/dist-versioned/components/radio-group/radio-group.d.ts +1 -1
- package/dist-versioned/components/range/range.d.ts +1 -1
- package/dist-versioned/components/range-tick/range-tick.d.ts +1 -1
- package/dist-versioned/components/scrollable/scrollable.d.ts +1 -1
- package/dist-versioned/components/select/select.d.ts +1 -1
- package/dist-versioned/components/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 +251 -244
- package/dist-versioned/internal/form.js +3 -3
- package/dist-versioned/solid-components.css +2 -2
- package/dist-versioned/solid-components.js +1 -1
- package/dist-versioned/vscode.html-custom-data.json +94 -94
- package/dist-versioned/web-types.json +158 -157
- package/package.json +3 -3
- package/cdn/chunks/chunk.DC6UQXYF.js +0 -2
- package/cdn-versioned/chunks/chunk.DC6UQXYF.js +0 -2
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import{a as B}from"./chunk.N3WG3NAL.js";import{a as K}from"./chunk.X2GM34WQ.js";import{a as k,d as _,e as U,f as $}from"./chunk.W7A3TU2Z.js";import{c as R}from"./chunk.3L472FD4.js";import{b as A}from"./chunk.CJ34NUTS.js";import{a as H}from"./chunk.PV6UYBMY.js";import{a as P}from"./chunk.CGQ2BPPZ.js";import{a as C,c as D}from"./chunk.B2NUKX6G.js";import{a as w}from"./chunk.KLRPP4NQ.js";import{a as I}from"./chunk.MP6XEXRW.js";import{a as M}from"./chunk.IQPMMUES.js";import{a as d}from"./chunk.YFQFOIEM.js";import{a as g}from"./chunk.NYKJXI3Q.js";import{a as F,b as r,c as u,d as m,h as E}from"./chunk.ALCKOGA7.js";import{b as V,e as p}from"./chunk.763RLJEK.js";import{b as S,e as T}from"./chunk.W4QBFD6E.js";import{e as l}from"./chunk.6EV4YU6C.js";var s=class extends E{constructor(){super(...arguments);this.formControlController=new A(this,{assumeInteractionOn:["sd-blur","sd-6-4-
|
|
1
|
+
import{a as B}from"./chunk.N3WG3NAL.js";import{a as K}from"./chunk.X2GM34WQ.js";import{a as k,d as _,e as U,f as $}from"./chunk.W7A3TU2Z.js";import{c as R}from"./chunk.3L472FD4.js";import{b as A}from"./chunk.CJ34NUTS.js";import{a as H}from"./chunk.PV6UYBMY.js";import{a as P}from"./chunk.CGQ2BPPZ.js";import{a as C,c as D}from"./chunk.B2NUKX6G.js";import{a as w}from"./chunk.KLRPP4NQ.js";import{a as I}from"./chunk.MP6XEXRW.js";import{a as M}from"./chunk.IQPMMUES.js";import{a as d}from"./chunk.YFQFOIEM.js";import{a as g}from"./chunk.NYKJXI3Q.js";import{a as F,b as r,c as u,d as m,h as E}from"./chunk.ALCKOGA7.js";import{b as V,e as p}from"./chunk.763RLJEK.js";import{b as S,e as T}from"./chunk.W4QBFD6E.js";import{e as l}from"./chunk.6EV4YU6C.js";var s=class extends E{constructor(){super(...arguments);this.formControlController=new A(this,{assumeInteractionOn:["sd-blur","sd-6-4-2-input"]});this.hasSlotController=new P(this,"help-text","label");this.localize=new M(this);this.hasFocus=!1;this.displayInputValue="";this.selectedTextLabel="";this.selectedOptions=[];this.filteredOptions=[];this.allOptions=[];this.showValidStyle=!1;this.showInvalidStyle=!1;this.deletedTagLabel="";this.name="";this.value="";this.defaultValue="";this.size="lg";this.placeholder="";this.maxOptionsTagLabel="";this.disabled=!1;this.visuallyDisabled=!1;this.clearable=!1;this.open=!1;this.hoist=!1;this.label="";this.placement="bottom";this.helpText="";this.form="";this.required=!1;this.floatingLabel=!1;this.type="text";this.currentPlacement=this.placement;this.getOption=K;this.multiple=!1;this.useTags=!0;this.maxOptionsVisible=3;this.styleOnValid=!1;this.filter=(t,e)=>{let i=$(t.value),a=$(t.getTextLabel()),n=$(e);return i.includes(n)||a.includes(n)};this.getTag=t=>p`<sd-6-4-2-tag ?disabled="${this.disabled}" part="tag" exportparts="
|
|
2
2
|
base:tag__base,
|
|
3
3
|
content:tag__content,
|
|
4
4
|
removable-indicator:tag__removable-indicator,
|
|
5
|
-
" size="${this.size==="sm"?"sm":"lg"}" removable @keydown="${e=>this.handleTagKeyDown(e,t)}" @sd-remove="${e=>this.handleTagRemove(e,t)}">${t.getTextLabel()}</sd-6-4-
|
|
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-4-2-tag>`;this.handleDocumentFocusIn=t=>{let e=t.composedPath();this&&!e.includes(this)&&this.hide()};this.handleDocumentKeyDown=t=>{let i=t.composedPath().some(o=>o instanceof HTMLButtonElement&&o.classList.contains("combobox-button"));if(this.visuallyDisabled){t.preventDefault(),t.stopPropagation();return}if(!(i||t.target.closest(".combobox__clear")!==null)){if(t.key==="Escape"&&(this.open?(t.preventDefault(),t.stopPropagation(),this.hide(),this.displayInput.focus({preventScroll:!0})):this.displayInputValue=""),t.key==="Backspace"&&this.multiple&&this.displayInput.value===""){this.handleTagRemove(new CustomEvent("sd-remove"),this.selectedOptions[this.selectedOptions.length-1]),this.updateComplete.then(()=>this.displayInput.focus({preventScroll:!0}));return}if(t.key==="Enter"){let o=this.getCurrentOption(),f=t.metaKey||t.ctrlKey||t.shiftKey||t.altKey;if(!this.open&&!f){setTimeout(()=>{t.defaultPrevented||this.formControlController.submit()});return}if(!this.open||o!=null&&o.disabled)return;if(o&&!o.disabled){let c=this.value;this.multiple?(this.toggleOptionSelection(o),this.lastOption=o,this.setOrderedSelectedOptions(o),this.updateComplete.then(()=>{this.selectionChanged()})):(this.setOrderedSelectedOptions(o),this.setSelectedOptions(o)),this.updateComplete.then(()=>{this.displayInput.focus({preventScroll:!0}),this.value!==c&&(this.emit("sd-input"),this.emit("sd-change"))})}this.displayInput.focus({preventScroll:!0}),this.multiple||(this.hide(),this.displayInput.focus({preventScroll:!0}));return}["ArrowUp","ArrowDown"].includes(t.key)&&(t.preventDefault(),t.stopPropagation(),this.open||this.show(),this.selectNextOption(t.key==="ArrowDown")),["Home","End"].includes(t.key)&&(t.preventDefault(),t.stopPropagation(),t.key==="Home"?this.displayInput.setSelectionRange(0,0):t.key==="End"&&this.displayInput.setSelectionRange(this.displayInput.value.length,this.displayInput.value.length))}};this.handleDocumentMouseDown=t=>{let e=t.composedPath();this&&!e.includes(this)&&this.hide()}}connectedCallback(){super.connectedCallback(),this.open=!1}firstUpdated(){if(!this.multiple){let t=this.findOptionByValue(this.getSlottedOptions(),this.value);this.selectedTextLabel=(t==null?void 0:t.getTextLabel())||""}this.formControlController.updateValidity()}get validity(){return this.valueInput.validity}get validationMessage(){return this.valueInput.validationMessage}get options(){let t=e=>{let i=this.displayInput.value,a=this.getOption(e,i);return e.tabIndex=0,p`${typeof a=="string"?I(a):a}`};return this.filteredOptions.map(e=>e.tagName.toLowerCase()==="sd-6-4-2-optgroup"?(Array.from(e.children).forEach(i=>{i.tagName.toLowerCase()==="sd-6-4-2-option"&&t(i)}),e):t(e))}get tags(){return this.selectedOptions.length<=this.maxOptionsVisible?this.selectedOptions.map((t,e)=>{if(e<this.maxOptionsVisible||this.maxOptionsVisible<=0){let i=this.getTag(t,e);return p`<div @sd-remove="${a=>this.handleTagRemove(a,t)}">${typeof i=="string"?I(i):i}</div>`}return[p``]}):[p`<sd-6-4-2-tag ?disabled="${this.disabled}" part="tag" exportparts="
|
|
6
6
|
base:tag__base,
|
|
7
7
|
content:tag__content,
|
|
8
8
|
removable-indicator:tag__removable-indicator,
|
|
9
|
-
" size="${this.size==="sm"?"sm":"lg"}" removable @keydown="${t=>this.handleTagMaxOptionsKeyDown(t)}" @sd-remove="${t=>this.handleTagRemove(t)}">${this.selectedOptions.length} ${this.localize.term("tagsSelected")}</sd-6-4-0-tag>`]}addOpenListeners(){document.addEventListener("focusin",this.handleDocumentFocusIn),document.addEventListener("mousedown",this.handleDocumentMouseDown),this.getRootNode()!==document&&this.getRootNode().addEventListener("focusin",this.handleDocumentFocusIn)}removeOpenListeners(){document.removeEventListener("focusin",this.handleDocumentFocusIn),document.removeEventListener("mousedown",this.handleDocumentMouseDown),this.getRootNode()!==document&&this.getRootNode().removeEventListener("focusin",this.handleDocumentFocusIn)}handleFocus(){this.hasFocus=!0,this.emit("sd-focus")}handleBlur(){this.hasFocus=!1,this.emit("sd-blur")}handleTagKeyDown(t,e){(t.key==="Backspace"||t.key==="Enter"||t.key===" ")&&this.multiple&&(t.preventDefault(),t.stopPropagation(),this.handleTagRemove(new CustomEvent("sd-remove"),e),this.updateComplete.then(()=>this.displayInput.focus({preventScroll:!0})))}handleTagMaxOptionsKeyDown(t){(t.key==="Backspace"||t.key==="Enter"||t.key===" ")&&this.multiple&&(t.preventDefault(),t.stopPropagation(),this.handleTagRemove(new CustomEvent("sd-remove"),this.selectedOptions[this.selectedOptions.length-1]),this.updateComplete.then(()=>this.displayInput.focus({preventScroll:!0})))}handleLabelClick(){this.visuallyDisabled||this.displayInput.focus()}handleTagRemove(t,e){t.stopPropagation(),e||this.clearCombobox(),e&&!this.disabled&&(this.toggleOptionSelection(e,!1),this.setOrderedSelectedOptions(e),this.deletedTagLabel="",this.deletedTagLabel=this.localize.term("removed",e.textContent),this.updateComplete.then(()=>{this.selectionChanged(),this.emit("sd-input"),this.emit("sd-change")}))}handleComboboxMouseDown(t){if(this.visuallyDisabled){t.preventDefault(),t.stopPropagation();return}let i=t.composedPath().some(n=>n instanceof HTMLSlotElement&&n.name==="removable-indicator");if(this.disabled||i)return;(this.open?this.hide():this.show()).then(()=>{setTimeout(()=>this.displayInput.focus({preventScroll:!0}))})}handleComboboxKeyDown(t){t.key!=="Tab"&&this.handleDocumentKeyDown(t)}handleClearClick(t){t.stopPropagation(),this.clearCombobox()}handleNoResultsClick(t){t.preventDefault(),this.hide()}clearCombobox(){this.value!==""&&(this.value="",this.displayInputValue="",this.selectedTextLabel="",this.lastOption=void 0,this.selectedOptions=[],this.getSlottedOptions().forEach(t=>{t.selected=!1}),this.displayInput.focus({preventScroll:!0}),this.updateComplete.then(()=>{this.emit("sd-clear"),this.emit("sd-input"),this.emit("sd-change")}))}preventLoosingFocus(t){t.stopPropagation(),t.preventDefault()}handleOptionClick(t){let i=t.target.closest("sd-6-4-0-option"),a=this.value;i&&!i.disabled&&(this.multiple?(this.toggleOptionSelection(i),this.lastOption=i,this.setOrderedSelectedOptions(i),this.updateComplete.then(()=>{this.selectionChanged()})):(this.setOrderedSelectedOptions(i),this.setSelectedOptions(i)),this.updateComplete.then(()=>{this.displayInput.focus({preventScroll:!0}),this.value!==a&&(this.emit("sd-input"),this.emit("sd-change"))}),this.multiple||(this.hide(),this.displayInput.focus({preventScroll:!0})))}selectNextOption(t){let e=this.getAllFilteredOptions();if(e.length===0)return;let i=this.getCurrentOption(),a=e.indexOf(i),n=Math.max(0,a);if(t){let o=a+1;n=o>e.length-1?0:o}else{let o=a-1;n=o<0?e.length-1:o}this.setCurrentOption(e[n],new KeyboardEvent("keydown")),R(this.getCurrentOption(),this.listbox,"vertical","auto")}getAllFilteredOptions(){return[...this.filteredWrapper.querySelectorAll("sd-6-4-0-option")]}getCurrentOption(){return this.getAllFilteredOptions().find(t=>t.current)}setCurrentOption(t,e){let i=this.getAllFilteredOptions();this.displayInput.removeAttribute("aria-activedescendant"),i.forEach(a=>{a.current=!1,a.setAttribute("aria-selected","false"),a.isKeyboardFocus=!1}),t&&(t.current=!0,t.setAttribute("aria-selected","true"),this.displayInput.setAttribute("aria-activedescendant",t.id)),t&&(e==null?void 0:e.type)==="keydown"&&(t.isKeyboardFocus=!0)}toggleOptionSelection(t,e){let a=this.getSlottedOptions().find(n=>n.value&&t.value?n.value===t.value:n.getTextLabel()===t.getTextLabel());a&&(a.selected=e!=null?e:!a.selected)}findOptionByValue(t,e){if(e)return Array.isArray(e)?t.find(i=>e.includes(i.value)):t.find(i=>i.value===e)}selectedOptionsAndValueSynced(){var t;return!this.value&&this.selectedOptions.length===0?!0:Array.isArray(this.value)?this.value.length===this.selectedOptions.length:this.value===((t=this.selectedOptions[0])==null?void 0:t.value)}isOptionSelected(t){return t.value?this.value.includes(t.value):this.value.includes(t.getTextLabel())}syncSelectedOptionsAndValue(){return this.selectedOptionsAndValueSynced()?void 0:(this.getSlottedOptions().forEach(e=>{e.selected=!1}),this.selectedOptions=this.getSlottedOptions().filter(e=>this.isOptionSelected(e)),this.selectedOptions.forEach(e=>{e&&(e.selected=!0)}),Promise.resolve())}compareOptions(t,e){return t.value&&e.value?t.value===e.value:t.getTextLabel()===e.getTextLabel()}setSelectedOptions(t){this.getSlottedOptions().forEach(i=>{i.selected=this.compareOptions(i,t)}),this.selectionChanged()}setOrderedSelectedOptions(t){let e=this.getSlottedOptions().find(i=>this.compareOptions(i,t));this.multiple?this.selectedOptions.length>0&&e&&this.selectedOptions.find(i=>this.compareOptions(i,e))?this.selectedOptions=this.selectedOptions.filter(i=>!this.compareOptions(i,e)):this.selectedOptions=[...this.selectedOptions,e]:this.selectedOptions=[e]}selectionChanged(){var e,i,a;let t=this.selectedOptions.some(n=>n?this.isOptionSelected(n):!1);this.multiple?(!t&&this.selectedOptions.length>0?this.value=[...this.value,...this.selectedOptions.map(n=>n.value||n.getTextLabel())]:this.value=this.selectedOptions.map(n=>(n==null?void 0:n.value)||(n==null?void 0:n.getTextLabel())||""),this.displayInputValue=""):(this.value=((e=this.selectedOptions[0])==null?void 0:e.value)||((i=this.selectedOptions[0])==null?void 0:i.getTextLabel())||"",this.selectedTextLabel=((a=this.selectedOptions[0])==null?void 0:a.getTextLabel())||"",this.displayInputValue=""),this.updateComplete.then(()=>{this.formControlController.updateValidity()})}createComboboxOptionsFromQuery(t){let e=[];this.filteredOptions=this.getSlottedOptions().filter(i=>this.filter(i,t)||t==="").map(i=>{var O,v,x;let a=i.cloneNode(!0);if(a.current=a.value===((O=this.lastOption)==null?void 0:O.value),a.selected=i.selected,a.checkbox=i.checkbox,a.size=i.size,!(((v=i.parentElement)==null?void 0:v.tagName.toLowerCase())==="sd-6-4-0-optgroup"))return a;let o=i.parentElement,f=(x=o.querySelector('[slot="label"]'))==null?void 0:x.cloneNode(!0),c=e.find(b=>b.id===o.id);if(c){c==null||c.appendChild(a),f&&(c==null||c.appendChild(f));return}let h=o.cloneNode();return h.appendChild(a),f&&h.appendChild(f),e.push(h),h}).filter(Boolean)}handleInvalid(t){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(t),this.invalidMessage.textContent=t.target.validationMessage}handleCurrentPlacement(t){let e=t.detail;e&&(this.currentPlacement=e)}handleFilterChange(){this.createComboboxOptionsFromQuery(this.displayInputValue)}handleUseTagsChange(){let t=this.getAllFilteredOptions();customElements.get("sd-6-4-0-option")&&t.forEach(e=>{e.checkbox=this.multiple})}applySizeToOptions(){this.getSlottedOptions().forEach(t=>{t.size=this.size})}handleDisabledChange(){this.formControlController.setValidity(this.disabled),(this.disabled||this.visuallyDisabled)&&(this.open=!1,this.handleOpenChange())}handleValueChange(){this.syncSelectedOptionsAndValue(),this.multiple?this.createComboboxOptionsFromQuery(this.displayInput.value):this.createComboboxOptionsFromQuery("")}handleDisplayInputValueChange(){this.createComboboxOptionsFromQuery(this.displayInputValue)}async handleOpenChange(){if(this.open&&(!this.disabled||!this.visuallyDisabled)){this.emit("sd-show"),this.addOpenListeners(),await T(this),this.listbox.hidden=!1,this.popup.active=!0;let{keyframes:i,options:a}=D(this,"combobox.show",{dir:this.localize.dir()});await S(this.popup.popup,i,a),this.emit("sd-after-show"),this.filteredOptions.length===0&&this.emit("sd-error");return}this.setCurrentOption(null),this.displayInput.removeAttribute("aria-activedescendant"),this.emit("sd-hide"),this.removeOpenListeners(),await T(this);let{keyframes:t,options:e}=D(this,"combobox.hide",{dir:this.localize.dir()});await S(this.popup.popup,t,e),this.listbox.hidden=!0,this.popup.active=!1,this.emit("sd-after-hide")}async show(){if(this.open||this.disabled||this.visuallyDisabled){this.open=!1;return}return this.open=!0,Promise.race([w(this,"sd-after-show"),w(this,"sd-error")])}async hide(){if(!this.open||this.disabled){this.open=!1;return}return this.displayInputValue="",this.open=!1,w(this,"sd-after-hide")}checkValidity(){return this.valueInput.checkValidity()}getForm(){return this.formControlController.getForm()}reportValidity(){return this.formControlController.fakeUserInteraction(),this.valueInput.reportValidity()}setCustomValidity(t){this.valueInput.setCustomValidity(t),this.formControlController.updateValidity()}focus(t){this.displayInput.focus(t)}blur(){this.displayInput.blur()}async handleInput(){let t=this.displayInput.value;this.displayInputValue=t,await this.updateComplete,this.open=this.filteredWrapper.children.length>0,this.formControlController.updateValidity(),this.emit("sd-input")}handleChange(){(!this.selectedOptions||!this.multiple)&&(this.selectedTextLabel=this.displayInput.value,this.updateComplete.then(()=>{this.formControlController.updateValidity()}),this.emit("sd-change"))}getSlottedOptions(){return _(k(this.defaultSlot)).flat()}getSlottedOptGroups(){return U(k(this.defaultSlot))}async handleDefaultSlotChange(){if(!customElements.get("sd-6-4-0-option")){customElements.whenDefined("sd-6-4-0-option").then(()=>this.handleDefaultSlotChange());return}let t=this.getSlottedOptions(),e=this.getSlottedOptGroups();this.applySizeToOptions();let i=this.findOptionByValue(t,this.value);this.selectedTextLabel=(i==null?void 0:i.getTextLabel())||"",t.forEach((a,n)=>{this.multiple&&(a.checkbox=!0),a.id=a.id||`sd-6-4-0-combobox-option-${n}`}),e.forEach((a,n)=>{a.id=a.id||`sd-6-4-0-combobox-optgroup-${n}`}),await this.syncSelectedOptionsAndValue(),this.multiple?this.createComboboxOptionsFromQuery(this.displayInputValue):this.createComboboxOptionsFromQuery("")}render(){let t={left:this.hasSlotController.test("left"),right:this.hasSlotController.test("right")},e=this.hasSlotController.test("label"),i=this.hasSlotController.test("help-text"),a=this.label?!0:!!e,n=this.helpText?!0:!!i,o=this.clearable&&!this.disabled&&!this.visuallyDisabled,f=t.left,c=this.value!==null&&String(this.value).length>0,h=this.floatingLabel&&a&&(this.hasFocus||c),O=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",v=this.disabled||this.visuallyDisabled?"cursor-not-allowed":"cursor-pointer",x=this.disabled||this.visuallyDisabled?"text-neutral-500":"text-primary",b={sm:"ml-1",md:"ml-2",lg:"ml-2"}[this.size],z={sm:"mr-1",md:"mr-2",lg:"mr-2"}[this.size],y={sm:"text-base",md:"text-lg",lg:"text-xl"}[this.size],N=this.size==="lg"?this.floatingLabel?h?"py-3":"py-4":"py-2":this.floatingLabel?h?"py-2":"py-3":"py-1",q={sm:"left-[36px]",md:"left-[44px]",lg:"left-12"}[this.size];return p`<div part="form-control" class="${d("relative text-left",v,this.size==="sm"?"text-sm":"text-base",this.open&&"z-50")}">${a&&!this.floatingLabel?p`<div class="flex items-center gap-1 mb-2"><label id="label" part="form-control-label" class="${a&&"inline-block form-control-color-text"}" aria-hidden="${a?"false":"true"}" @click="${this.handleLabelClick}"><slot name="label">${this.label}</slot></label></div>`:null} <span aria-live="polite" class="sr-only">${this.deletedTagLabel}</span><div part="form-control-input" class="relative w-full bg-white text-black">${a&&this.floatingLabel?p`<label id="label" part="form-control-floating-label" class="${d("absolute left-4 z-20 pointer-events-none transition-all duration-200",f?q:"left-4",h?this.size==="lg"?"top-2 text-xs":"top-1 text-xs":"top-1/2 -translate-y-1/2 text-base",h&&"mt-1")}" for="input"><span class="${d("leading-none",(this.visuallyDisabled||this.disabled)&&"text-neutral-500",h&&!this.visuallyDisabled&&!this.disabled&&"form-control--filled__floating-label-color-text")}">${this.label}</span></label>`:null}<div part="border" class="${d("absolute top-0 w-full h-full pointer-events-none border rounded-default z-10 transition-[border] duration-medium ease-in-out",{disabled:"border-neutral-500",visuallyDisabled:"border-neutral-500",readonly:"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"}[O],this.open&&(this.currentPlacement==="bottom"?"rounded-bl-none rounded-br-none":"rounded-tl-none rounded-tr-none"))}"></div><sd-6-4-0-popup @sd-current-placement="${this.handleCurrentPlacement}" class="${d("inline-flex relative w-full",this.currentPlacement==="bottom"?"origin-top":"origin-bottom")}" placement="${this.placement}" strategy="${this.hoist?"fixed":"absolute"}" flip shift sync="width" auto-size="vertical" auto-size-padding="10" exportparts="
|
|
9
|
+
" size="${this.size==="sm"?"sm":"lg"}" removable @keydown="${t=>this.handleTagMaxOptionsKeyDown(t)}" @sd-remove="${t=>this.handleTagRemove(t)}">${this.selectedOptions.length} ${this.localize.term("tagsSelected")}</sd-6-4-2-tag>`]}addOpenListeners(){document.addEventListener("focusin",this.handleDocumentFocusIn),document.addEventListener("mousedown",this.handleDocumentMouseDown),this.getRootNode()!==document&&this.getRootNode().addEventListener("focusin",this.handleDocumentFocusIn)}removeOpenListeners(){document.removeEventListener("focusin",this.handleDocumentFocusIn),document.removeEventListener("mousedown",this.handleDocumentMouseDown),this.getRootNode()!==document&&this.getRootNode().removeEventListener("focusin",this.handleDocumentFocusIn)}handleFocus(){this.hasFocus=!0,this.emit("sd-focus")}handleBlur(){this.hasFocus=!1,this.emit("sd-blur")}handleTagKeyDown(t,e){(t.key==="Backspace"||t.key==="Enter"||t.key===" ")&&this.multiple&&(t.preventDefault(),t.stopPropagation(),this.handleTagRemove(new CustomEvent("sd-remove"),e),this.updateComplete.then(()=>this.displayInput.focus({preventScroll:!0})))}handleTagMaxOptionsKeyDown(t){(t.key==="Backspace"||t.key==="Enter"||t.key===" ")&&this.multiple&&(t.preventDefault(),t.stopPropagation(),this.handleTagRemove(new CustomEvent("sd-remove"),this.selectedOptions[this.selectedOptions.length-1]),this.updateComplete.then(()=>this.displayInput.focus({preventScroll:!0})))}handleLabelClick(){this.visuallyDisabled||this.displayInput.focus()}handleTagRemove(t,e){t.stopPropagation(),e||this.clearCombobox(),e&&!this.disabled&&(this.toggleOptionSelection(e,!1),this.setOrderedSelectedOptions(e),this.deletedTagLabel="",this.deletedTagLabel=this.localize.term("removed",e.textContent),this.updateComplete.then(()=>{this.selectionChanged(),this.emit("sd-input"),this.emit("sd-change")}))}handleComboboxMouseDown(t){if(this.visuallyDisabled){t.preventDefault(),t.stopPropagation();return}let i=t.composedPath().some(n=>n instanceof HTMLSlotElement&&n.name==="removable-indicator");if(this.disabled||i)return;(this.open?this.hide():this.show()).then(()=>{setTimeout(()=>this.displayInput.focus({preventScroll:!0}))})}handleComboboxKeyDown(t){t.key!=="Tab"&&this.handleDocumentKeyDown(t)}handleClearClick(t){t.stopPropagation(),this.clearCombobox()}handleNoResultsClick(t){t.preventDefault(),this.hide()}clearCombobox(){this.value!==""&&(this.value="",this.displayInputValue="",this.selectedTextLabel="",this.lastOption=void 0,this.selectedOptions=[],this.getSlottedOptions().forEach(t=>{t.selected=!1}),this.displayInput.focus({preventScroll:!0}),this.updateComplete.then(()=>{this.emit("sd-clear"),this.emit("sd-input"),this.emit("sd-change")}))}preventLoosingFocus(t){t.stopPropagation(),t.preventDefault()}handleOptionClick(t){let i=t.target.closest("sd-6-4-2-option"),a=this.value;i&&!i.disabled&&(this.multiple?(this.toggleOptionSelection(i),this.lastOption=i,this.setOrderedSelectedOptions(i),this.updateComplete.then(()=>{this.selectionChanged()})):(this.setOrderedSelectedOptions(i),this.setSelectedOptions(i)),this.updateComplete.then(()=>{this.displayInput.focus({preventScroll:!0}),this.value!==a&&(this.emit("sd-input"),this.emit("sd-change"))}),this.multiple||(this.hide(),this.displayInput.focus({preventScroll:!0})))}selectNextOption(t){let e=this.getAllFilteredOptions();if(e.length===0)return;let i=this.getCurrentOption(),a=e.indexOf(i),n=Math.max(0,a);if(t){let o=a+1;n=o>e.length-1?0:o}else{let o=a-1;n=o<0?e.length-1:o}this.setCurrentOption(e[n],new KeyboardEvent("keydown")),R(this.getCurrentOption(),this.listbox,"vertical","auto")}getAllFilteredOptions(){return[...this.filteredWrapper.querySelectorAll("sd-6-4-2-option")]}getCurrentOption(){return this.getAllFilteredOptions().find(t=>t.current)}setCurrentOption(t,e){let i=this.getAllFilteredOptions();this.displayInput.removeAttribute("aria-activedescendant"),i.forEach(a=>{a.current=!1,a.setAttribute("aria-selected","false"),a.isKeyboardFocus=!1}),t&&(t.current=!0,t.setAttribute("aria-selected","true"),this.displayInput.setAttribute("aria-activedescendant",t.id)),t&&(e==null?void 0:e.type)==="keydown"&&(t.isKeyboardFocus=!0)}toggleOptionSelection(t,e){let a=this.getSlottedOptions().find(n=>n.value&&t.value?n.value===t.value:n.getTextLabel()===t.getTextLabel());a&&(a.selected=e!=null?e:!a.selected)}findOptionByValue(t,e){if(e)return Array.isArray(e)?t.find(i=>e.includes(i.value)):t.find(i=>i.value===e)}selectedOptionsAndValueSynced(){var t;return!this.value&&this.selectedOptions.length===0?!0:Array.isArray(this.value)?this.value.length===this.selectedOptions.length:this.value===((t=this.selectedOptions[0])==null?void 0:t.value)}isOptionSelected(t){return t.value?this.value.includes(t.value):this.value.includes(t.getTextLabel())}syncSelectedOptionsAndValue(){return this.selectedOptionsAndValueSynced()?void 0:(this.getSlottedOptions().forEach(e=>{e.selected=!1}),this.selectedOptions=this.getSlottedOptions().filter(e=>this.isOptionSelected(e)),this.selectedOptions.forEach(e=>{e&&(e.selected=!0)}),Promise.resolve())}compareOptions(t,e){return t.value&&e.value?t.value===e.value:t.getTextLabel()===e.getTextLabel()}setSelectedOptions(t){this.getSlottedOptions().forEach(i=>{i.selected=this.compareOptions(i,t)}),this.selectionChanged()}setOrderedSelectedOptions(t){let e=this.getSlottedOptions().find(i=>this.compareOptions(i,t));this.multiple?this.selectedOptions.length>0&&e&&this.selectedOptions.find(i=>this.compareOptions(i,e))?this.selectedOptions=this.selectedOptions.filter(i=>!this.compareOptions(i,e)):this.selectedOptions=[...this.selectedOptions,e]:this.selectedOptions=[e]}selectionChanged(){var e,i,a;let t=this.selectedOptions.some(n=>n?this.isOptionSelected(n):!1);this.multiple?(!t&&this.selectedOptions.length>0?this.value=[...this.value,...this.selectedOptions.map(n=>n.value||n.getTextLabel())]:this.value=this.selectedOptions.map(n=>(n==null?void 0:n.value)||(n==null?void 0:n.getTextLabel())||""),this.displayInputValue=""):(this.value=((e=this.selectedOptions[0])==null?void 0:e.value)||((i=this.selectedOptions[0])==null?void 0:i.getTextLabel())||"",this.selectedTextLabel=((a=this.selectedOptions[0])==null?void 0:a.getTextLabel())||"",this.displayInputValue=""),this.updateComplete.then(()=>{this.formControlController.updateValidity()})}createComboboxOptionsFromQuery(t){let e=[];this.filteredOptions=this.getSlottedOptions().filter(i=>this.filter(i,t)||t==="").map(i=>{var O,v,x;let a=i.cloneNode(!0);if(a.current=a.value===((O=this.lastOption)==null?void 0:O.value),a.selected=i.selected,a.checkbox=i.checkbox,a.size=i.size,!(((v=i.parentElement)==null?void 0:v.tagName.toLowerCase())==="sd-6-4-2-optgroup"))return a;let o=i.parentElement,f=(x=o.querySelector('[slot="label"]'))==null?void 0:x.cloneNode(!0),c=e.find(b=>b.id===o.id);if(c){c==null||c.appendChild(a),f&&(c==null||c.appendChild(f));return}let h=o.cloneNode();return h.appendChild(a),f&&h.appendChild(f),e.push(h),h}).filter(Boolean)}handleInvalid(t){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(t),this.invalidMessage.textContent=t.target.validationMessage}handleCurrentPlacement(t){let e=t.detail;e&&(this.currentPlacement=e)}handleFilterChange(){this.createComboboxOptionsFromQuery(this.displayInputValue)}handleUseTagsChange(){let t=this.getAllFilteredOptions();customElements.get("sd-6-4-2-option")&&t.forEach(e=>{e.checkbox=this.multiple})}applySizeToOptions(){this.getSlottedOptions().forEach(t=>{t.size=this.size})}handleDisabledChange(){this.formControlController.setValidity(this.disabled),(this.disabled||this.visuallyDisabled)&&(this.open=!1,this.handleOpenChange())}handleValueChange(){this.syncSelectedOptionsAndValue(),this.multiple?this.createComboboxOptionsFromQuery(this.displayInput.value):this.createComboboxOptionsFromQuery("")}handleDisplayInputValueChange(){this.createComboboxOptionsFromQuery(this.displayInputValue)}async handleOpenChange(){if(this.open&&(!this.disabled||!this.visuallyDisabled)){this.emit("sd-show"),this.addOpenListeners(),await T(this),this.listbox.hidden=!1,this.popup.active=!0;let{keyframes:i,options:a}=D(this,"combobox.show",{dir:this.localize.dir()});await S(this.popup.popup,i,a),this.emit("sd-after-show"),this.filteredOptions.length===0&&this.emit("sd-error");return}this.setCurrentOption(null),this.displayInput.removeAttribute("aria-activedescendant"),this.emit("sd-hide"),this.removeOpenListeners(),await T(this);let{keyframes:t,options:e}=D(this,"combobox.hide",{dir:this.localize.dir()});await S(this.popup.popup,t,e),this.listbox.hidden=!0,this.popup.active=!1,this.emit("sd-after-hide")}async show(){if(this.open||this.disabled||this.visuallyDisabled){this.open=!1;return}return this.open=!0,Promise.race([w(this,"sd-after-show"),w(this,"sd-error")])}async hide(){if(!this.open||this.disabled){this.open=!1;return}return this.displayInputValue="",this.open=!1,w(this,"sd-after-hide")}checkValidity(){return this.valueInput.checkValidity()}getForm(){return this.formControlController.getForm()}reportValidity(){return this.formControlController.fakeUserInteraction(),this.valueInput.reportValidity()}setCustomValidity(t){this.valueInput.setCustomValidity(t),this.formControlController.updateValidity()}focus(t){this.displayInput.focus(t)}blur(){this.displayInput.blur()}async handleInput(){let t=this.displayInput.value;this.displayInputValue=t,await this.updateComplete,this.open=this.filteredWrapper.children.length>0,this.formControlController.updateValidity(),this.emit("sd-input")}handleChange(){(!this.selectedOptions||!this.multiple)&&(this.selectedTextLabel=this.displayInput.value,this.updateComplete.then(()=>{this.formControlController.updateValidity()}),this.emit("sd-change"))}getSlottedOptions(){return _(k(this.defaultSlot)).flat()}getSlottedOptGroups(){return U(k(this.defaultSlot))}async handleDefaultSlotChange(){if(!customElements.get("sd-6-4-2-option")){customElements.whenDefined("sd-6-4-2-option").then(()=>this.handleDefaultSlotChange());return}let t=this.getSlottedOptions(),e=this.getSlottedOptGroups();this.applySizeToOptions();let i=this.findOptionByValue(t,this.value);this.selectedTextLabel=(i==null?void 0:i.getTextLabel())||"",t.forEach((a,n)=>{this.multiple&&(a.checkbox=!0),a.id=a.id||`sd-6-4-2-combobox-option-${n}`}),e.forEach((a,n)=>{a.id=a.id||`sd-6-4-2-combobox-optgroup-${n}`}),await this.syncSelectedOptionsAndValue(),this.multiple?this.createComboboxOptionsFromQuery(this.displayInputValue):this.createComboboxOptionsFromQuery("")}render(){let t={left:this.hasSlotController.test("left"),right:this.hasSlotController.test("right")},e=this.hasSlotController.test("label"),i=this.hasSlotController.test("help-text"),a=this.label?!0:!!e,n=this.helpText?!0:!!i,o=this.clearable&&!this.disabled&&!this.visuallyDisabled,f=t.left,c=this.value!==null&&String(this.value).length>0,h=this.floatingLabel&&a&&(this.hasFocus||c),O=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",v=this.disabled||this.visuallyDisabled?"cursor-not-allowed":"cursor-pointer",x=this.disabled||this.visuallyDisabled?"text-neutral-500":"text-primary",b={sm:"ml-1",md:"ml-2",lg:"ml-2"}[this.size],z={sm:"mr-1",md:"mr-2",lg:"mr-2"}[this.size],y={sm:"text-base",md:"text-lg",lg:"text-xl"}[this.size],N=this.size==="lg"?this.floatingLabel?h?"py-3":"py-4":"py-2":this.floatingLabel?h?"py-2":"py-3":"py-1",q={sm:"left-[36px]",md:"left-[44px]",lg:"left-12"}[this.size];return p`<div part="form-control" class="${d("relative text-left",v,this.size==="sm"?"text-sm":"text-base",this.open&&"z-50")}">${a&&!this.floatingLabel?p`<div class="flex items-center gap-1 mb-2"><label id="label" part="form-control-label" class="${a&&"inline-block form-control-color-text"}" aria-hidden="${a?"false":"true"}" @click="${this.handleLabelClick}"><slot name="label">${this.label}</slot></label></div>`:null} <span aria-live="polite" class="sr-only">${this.deletedTagLabel}</span><div part="form-control-input" class="relative w-full bg-white text-black">${a&&this.floatingLabel?p`<label id="label" part="form-control-floating-label" class="${d("absolute left-4 z-20 pointer-events-none transition-all duration-200",f?q:"left-4",h?this.size==="lg"?"top-2 text-xs":"top-1 text-xs":"top-1/2 -translate-y-1/2 text-base",h&&"mt-1")}" for="input"><span class="${d("leading-none",(this.visuallyDisabled||this.disabled)&&"text-neutral-500",h&&!this.visuallyDisabled&&!this.disabled&&"form-control--filled__floating-label-color-text")}">${this.label}</span></label>`:null}<div part="border" class="${d("absolute top-0 w-full h-full pointer-events-none border rounded-default z-10 transition-[border] duration-medium ease-in-out",{disabled:"border-neutral-500",visuallyDisabled:"border-neutral-500",readonly:"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"}[O],this.open&&(this.currentPlacement==="bottom"?"rounded-bl-none rounded-br-none":"rounded-tl-none rounded-tr-none"))}"></div><sd-6-4-2-popup @sd-current-placement="${this.handleCurrentPlacement}" class="${d("inline-flex relative w-full",this.currentPlacement==="bottom"?"origin-top":"origin-bottom")}" placement="${this.placement}" strategy="${this.hoist?"fixed":"absolute"}" flip shift sync="width" auto-size="vertical" auto-size-padding="10" exportparts="
|
|
10
10
|
popup:popup__content,
|
|
11
|
-
"><div part="combobox" class="${d("relative w-full px-4 flex flex-row items-center rounded-default transition-colors hover:duration-fast ease-in-out",this.visuallyDisabled||this.disabled?"hover:bg-transparent":"hover:bg-neutral-200",this.open&&"shadow transition-shadow duration-medium ease-in-out",["invalid","activeInvalid"].includes(O)&&"form-control--invalid-color-background",{sm:"py-1 min-h-[32px]",md:"py-1 min-h-[40px]",lg:"py-2 min-h-[48px]"}[this.size],N)}" slot="anchor" @keydown="${this.handleComboboxKeyDown}" @mousedown="${this.handleComboboxMouseDown}">${t.left?p`<slot part="left" name="left" class="${d("inline-flex",z,x,y)}"></slot>`:""} ${this.multiple&&this.useTags&&this.tags.length>0?p`<div part="tags" class="${d("flex items-center gap-1",z,this.floatingLabel&&"mt-4")}">${this.tags}</div>`:null} <input id="display-input" name="${this.name}" form="${this.form}" part="display-input" class="${d("appearance-none outline-none bg-transparent flex-auto min-w-0",v,this.selectedTextLabel&&!this.multiple?"placeholder:form-control-color-text":"placeholder:text-neutral-700",this.size==="sm"?h?"h-4":"h-6":h?"h-6":"h-8",h&&"leading-none mt-4")}" type="text" placeholder="${!this.floatingLabel||h?this.selectedTextLabel&&!this.multiple?this.selectedTextLabel:this.placeholder||this.localize.term("comboboxDefaultPlaceholder"):""}" .disabled="${this.disabled}" .value="${this.displayInputValue}" autocomplete="off" spellcheck="false" autocapitalize="off" aria-controls="listbox" aria-expanded="${this.open}" aria-haspopup="listbox" aria-labelledby="label" aria-disabled="${this.disabled||this.visuallyDisabled}" aria-describedby="help-text invalid-message" aria-invalid="${this.showInvalidStyle}" role="combobox" tabindex="0" @focus="${this.handleFocus}" @blur="${this.handleBlur}" aria-autocomplete="list" aria-owns="listbox" @input="${this.handleInput}" @change="${this.handleChange}"><div aria-live="polite" id="control-value" class="absolute top-0 left-0 opacity-0 -z-10">${this.selectedOptions.map(L=>L==null?void 0:L.getTextLabel()).join(", ")}</div><input class="${d("value-input absolute top-0 left-0 w-full h-full opacity-0 -z-10",v)}" type="text" ?disabled="${this.disabled}" ?required="${this.required}" .value="${Array.isArray(this.value)?this.value.join(", "):this.value}" tabindex="-1" aria-controls="control-value" aria-hidden="true" @focus="${()=>this.focus()}" @invalid="${this.handleInvalid}"> ${o?p`<button part="clear-button" class="${d("flex justify-center",b,this.value.length>0?"visible":"invisible")}" type="button" aria-label="${this.localize.term("clearEntry")}" @mousedown="${this.preventLoosingFocus}" @click="${this.handleClearClick}" tabindex="-1"><slot name="clear-icon"><sd-6-4-
|
|
12
|
-
:host{position:relative;display:block;width:100%}: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))}:host([visually-disabled]) input{caret-color:transparent}:host([size=sm]) .combobox-button{right:var(--sd-spacing-4);height:var(--sd-spacing-4);width:var(--sd-spacing-4)}:host([size=md]) .combobox-button{right:.85rem;height:var(--sd-spacing-6);width:var(--sd-spacing-6)}:host([size=lg]) .combobox-button{right:var(--sd-spacing-3);height:var(--sd-spacing-8);width:var(--sd-spacing-8)}[part=listbox]{max-height:var(--auto-size-available-height,auto)}sd-6-4-
|
|
11
|
+
"><div part="combobox" class="${d("relative w-full px-4 flex flex-row items-center rounded-default transition-colors hover:duration-fast ease-in-out",this.visuallyDisabled||this.disabled?"hover:bg-transparent":"hover:bg-neutral-200",this.open&&"shadow transition-shadow duration-medium ease-in-out",["invalid","activeInvalid"].includes(O)&&"form-control--invalid-color-background",{sm:"py-1 min-h-[32px]",md:"py-1 min-h-[40px]",lg:"py-2 min-h-[48px]"}[this.size],N)}" slot="anchor" @keydown="${this.handleComboboxKeyDown}" @mousedown="${this.handleComboboxMouseDown}">${t.left?p`<slot part="left" name="left" class="${d("inline-flex",z,x,y)}"></slot>`:""} ${this.multiple&&this.useTags&&this.tags.length>0?p`<div part="tags" class="${d("flex items-center gap-1",z,this.floatingLabel&&"mt-4")}">${this.tags}</div>`:null} <input id="display-input" name="${this.name}" form="${this.form}" part="display-input" class="${d("appearance-none outline-none bg-transparent flex-auto min-w-0",v,this.selectedTextLabel&&!this.multiple?"placeholder:form-control-color-text":"placeholder:text-neutral-700",this.size==="sm"?h?"h-4":"h-6":h?"h-6":"h-8",h&&"leading-none mt-4")}" type="text" placeholder="${!this.floatingLabel||h?this.selectedTextLabel&&!this.multiple?this.selectedTextLabel:this.placeholder||this.localize.term("comboboxDefaultPlaceholder"):""}" .disabled="${this.disabled}" .value="${this.displayInputValue}" autocomplete="off" spellcheck="false" autocapitalize="off" aria-controls="listbox" aria-expanded="${this.open}" aria-haspopup="listbox" aria-labelledby="label" aria-disabled="${this.disabled||this.visuallyDisabled}" aria-describedby="help-text invalid-message" aria-invalid="${this.showInvalidStyle}" role="combobox" tabindex="0" @focus="${this.handleFocus}" @blur="${this.handleBlur}" aria-autocomplete="list" aria-owns="listbox" @input="${this.handleInput}" @change="${this.handleChange}"><div aria-live="polite" id="control-value" class="absolute top-0 left-0 opacity-0 -z-10">${this.selectedOptions.map(L=>L==null?void 0:L.getTextLabel()).join(", ")}</div><input class="${d("value-input absolute top-0 left-0 w-full h-full opacity-0 -z-10",v)}" type="text" ?disabled="${this.disabled}" ?required="${this.required}" .value="${Array.isArray(this.value)?this.value.join(", "):this.value}" tabindex="-1" aria-controls="control-value" aria-hidden="true" @focus="${()=>this.focus()}" @invalid="${this.handleInvalid}"> ${o?p`<button part="clear-button" class="${d("flex justify-center",b,this.value.length>0?"visible":"invisible")}" type="button" aria-label="${this.localize.term("clearEntry")}" @mousedown="${this.preventLoosingFocus}" @click="${this.handleClearClick}" tabindex="-1"><slot name="clear-icon"><sd-6-4-2-icon class="${d("text-neutral-700",y)}" name="closing-round" library="_internal"></sd-6-4-2-icon></slot></button>`:""} ${this.showInvalidStyle?p`<sd-6-4-2-icon part="invalid-icon" class="${d(b,y,"text-error")}" library="_internal" name="risk"></sd-6-4-2-icon>`:""} ${this.styleOnValid&&this.showValidStyle?p`<sd-6-4-2-icon part="valid-icon" class="${d("flex-shrink-0 text-success",b,y)}" library="_internal" name="confirm-circle"></sd-6-4-2-icon>`:""}<slot name="right" part="right" class="${d("inline-flex ml-2 leading-[0]",this.disabled||this.visuallyDisabled?"text-neutral-500":"text-primary",y)}">${this.type!=="search"?p`<sd-6-4-2-icon class="${d("transition-transform duration-medium ease-in-out",this.open?"rotate-180":"rotate-0")}" name="chevron-down" part="chevron" library="_internal" color="currentColor" label="${this.localize.term("open")}"></sd-6-4-2-icon>`:""}</slot>${this.type==="search"?p`<button class="${d("flex items-center sd-interactive",b)}" type="button"><sd-6-4-2-icon class="${d(x,y)}" library="_internal" name="magnifying-glass" label="${this.localize.term("search")}"></sd-6-4-2-icon></button>`:p`<button class="sd-interactive combobox-button absolute top-2" @keydown="${this.handleComboboxMouseDown}" type="button"><span class="sr-only">${this.localize.term("open")}</span></button>`}</div><div id="listbox" role="${H(this.multiple?void 0:"listbox")}" aria-expanded="${this.open}" aria-multiselectable="${this.multiple}" aria-labelledby="label" part="listbox" class="${d("bg-white px-2 py-3 relative border-primary overflow-y-auto",this.open&&"shadow transition-shadow duration-medium ease-in-out",this.currentPlacement==="bottom"?"border-r-2 border-b-2 border-l-2 rounded-br-default rounded-bl-default":"border-r-2 border-t-2 border-l-2 rounded-tr-default rounded-tl-default")}" tabindex="-1" @mousedown="${this.preventLoosingFocus}" @mouseup="${this.handleOptionClick}"><div part="filtered-listbox">${this.filteredOptions.length===0?p`<span id="noResults" class="px-4 flex items-center w-full transition-all text-left text-base relative text-black py-3" aria-hidden="true" @click="${this.handleNoResultsClick}">${this.localize.term("noResults")}</span>`:this.options}</div><slot id="defaultOptionsSlot" class="hidden" @slotchange="${this.handleDefaultSlotChange}"></slot></div></sd-6-4-2-popup></div><slot name="help-text" part="form-control-help-text" id="help-text" class="${d("text-sm text-neutral-700 mt-1",n?"block":"hidden")}" aria-hidden="${!n}">${this.helpText}</slot></div>${this.formControlController.renderInvalidMessage(this.size)}`}};s.styles=[...E.styles,V`/*! tailwindcss v4.1.17 | MIT License | https://tailwindcss.com */@layer properties;@layer theme,base,components,utilities;
|
|
12
|
+
:host{position:relative;display:block;width:100%}: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))}:host([visually-disabled]) input{caret-color:transparent}:host([size=sm]) .combobox-button{right:var(--sd-spacing-4);height:var(--sd-spacing-4);width:var(--sd-spacing-4)}:host([size=md]) .combobox-button{right:.85rem;height:var(--sd-spacing-6);width:var(--sd-spacing-6)}:host([size=lg]) .combobox-button{right:var(--sd-spacing-3);height:var(--sd-spacing-8);width:var(--sd-spacing-8)}[part=listbox]{max-height:var(--auto-size-available-height,auto)}sd-6-4-2-popup::part(popup){z-index:var(--sd-z-index-dropdown,900)}sd-6-4-2-tag::part(base){border-radius:var(--sd-radius);padding-inline:var(--sd-spacing-1)}sd-6-4-2-tag::part(content){display:inline-block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:var(--tag-max-width,15ch)}sd-6-4-2-tag[size=lg]::part(base){padding-inline:var(--sd-spacing-2)}sd-6-4-2-tag[disabled=false]::part(base):hover{background-color:rgba(var(--sd-color-background-primary-100))}[part=filtered-listbox] sd-6-4-2-optgroup:first-of-type{--display-divider:none}mark{background-color:transparent;--tw-font-weight:var(--sd-font-weight-bold);font-weight:var(--sd-font-weight-bold);color:inherit}@property --tw-font-weight{syntax:"*";inherits:false}`],l([m("sd-6-4-2-popup")],s.prototype,"popup",2),l([m('[part="combobox"]')],s.prototype,"combobox",2),l([m('[part="display-input"]')],s.prototype,"displayInput",2),l([m(".value-input")],s.prototype,"valueInput",2),l([m('[part="listbox"]')],s.prototype,"listbox",2),l([m('[part="tags"]')],s.prototype,"tagWrapper",2),l([m('[part="filtered-listbox"]')],s.prototype,"filteredWrapper",2),l([m("slot:not([name])")],s.prototype,"defaultSlot",2),l([m("#invalid-message")],s.prototype,"invalidMessage",2),l([u()],s.prototype,"hasFocus",2),l([u()],s.prototype,"displayInputValue",2),l([u()],s.prototype,"selectedTextLabel",2),l([u()],s.prototype,"selectedOptions",2),l([u()],s.prototype,"filteredOptions",2),l([u()],s.prototype,"allOptions",2),l([u()],s.prototype,"lastOption",2),l([u()],s.prototype,"showValidStyle",2),l([u()],s.prototype,"showInvalidStyle",2),l([u()],s.prototype,"deletedTagLabel",2),l([r({reflect:!0})],s.prototype,"name",2),l([r({converter:{fromAttribute:t=>t.split(" "),toAttribute:t=>t.join(" ")}})],s.prototype,"value",2),l([B()],s.prototype,"defaultValue",2),l([r({type:String,reflect:!0})],s.prototype,"size",2),l([r({type:String,reflect:!0})],s.prototype,"placeholder",2),l([r({type:String,attribute:"max-options-tag-label",reflect:!0})],s.prototype,"maxOptionsTagLabel",2),l([r({type:Boolean,reflect:!0})],s.prototype,"disabled",2),l([r({type:Boolean,reflect:!0,attribute:"visually-disabled"})],s.prototype,"visuallyDisabled",2),l([r({type:Boolean,reflect:!0})],s.prototype,"clearable",2),l([r({type:Boolean,reflect:!0})],s.prototype,"open",2),l([r({type:Boolean,reflect:!0})],s.prototype,"hoist",2),l([r({type:String,reflect:!0})],s.prototype,"label",2),l([r({type:String,reflect:!0})],s.prototype,"placement",2),l([r({type:String,attribute:"help-text",reflect:!0})],s.prototype,"helpText",2),l([r({type:String,reflect:!0})],s.prototype,"form",2),l([r({type:Boolean,reflect:!0})],s.prototype,"required",2),l([r({attribute:"floating-label",type:Boolean,reflect:!0})],s.prototype,"floatingLabel",2),l([r({type:String,reflect:!0})],s.prototype,"type",2),l([u()],s.prototype,"currentPlacement",2),l([r()],s.prototype,"getOption",2),l([r({type:Boolean,reflect:!0})],s.prototype,"multiple",2),l([r({type:Boolean,reflect:!0})],s.prototype,"useTags",2),l([r({type:Number,reflect:!0,attribute:"max-options-visible"})],s.prototype,"maxOptionsVisible",2),l([r({type:Boolean,reflect:!0,attribute:"style-on-valid"})],s.prototype,"styleOnValid",2),l([r()],s.prototype,"filter",2),l([r()],s.prototype,"getTag",2),l([g("filter",{waitUntilFirstUpdate:!0})],s.prototype,"handleFilterChange",1),l([g("useTags",{waitUntilFirstUpdate:!0})],s.prototype,"handleUseTagsChange",1),l([g("size",{waitUntilFirstUpdate:!0})],s.prototype,"applySizeToOptions",1),l([g(["disabled","visually-disabled"],{waitUntilFirstUpdate:!0})],s.prototype,"handleDisabledChange",1),l([g("value",{waitUntilFirstUpdate:!0})],s.prototype,"handleValueChange",1),l([g("displayInputValue",{waitUntilFirstUpdate:!0})],s.prototype,"handleDisplayInputValueChange",1),l([g("open",{waitUntilFirstUpdate:!0})],s.prototype,"handleOpenChange",1),s=l([F("sd-6-4-2-combobox")],s);C("combobox.show",{keyframes:[{opacity:0},{opacity:1}],options:{duration:"var(--sd-duration-medium, 300)",easing:"ease-in-out"}});C("combobox.hide",{keyframes:[{opacity:1},{opacity:0}],options:{duration:"var(--sd-duration-fast, 150)",easing:"ease-in-out"}});export{s as a};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as g}from"./chunk.I2H6CZK5.js";import{a as z}from"./chunk.2AQOPKKH.js";import{a as L}from"./chunk.G7HKVXLR.js";import{a as m,b as f}from"./chunk.3L472FD4.js";import{a as E}from"./chunk.CGQ2BPPZ.js";import{a as o,c as l}from"./chunk.B2NUKX6G.js";import{a as w}from"./chunk.KLRPP4NQ.js";import{a as C}from"./chunk.IQPMMUES.js";import{a as p}from"./chunk.YFQFOIEM.js";import{a as v}from"./chunk.NYKJXI3Q.js";import{a as x,b as r,d as c,h as b}from"./chunk.ALCKOGA7.js";import{b as k,e as u}from"./chunk.763RLJEK.js";import{b as n,e as h}from"./chunk.W4QBFD6E.js";import{e as i}from"./chunk.6EV4YU6C.js";var t=class extends b{constructor(){super(...arguments);this.hasSlotController=new E(this,"footer");this.localize=new C(this);this.modal=new z(this);this.open=!1;this.label="";this.placement="end";this.contained=!1;this.noHeader=!1;this.handleDocumentKeyDown=e=>{this.open&&e.key==="Escape"&&(e.stopPropagation(),this.requestClose("keyboard"))}}firstUpdated(){this.drawer.hidden=!this.open,this.open&&(this.addOpenListeners(),this.contained||(this.modal.activate(),m(this)))}disconnectedCallback(){super.disconnectedCallback(),f(this)}requestClose(e){if(this.emit("sd-request-close",{cancelable:!0,detail:{source:e}}).defaultPrevented){let a=l(this,"drawer.denyClose",{dir:this.localize.dir()});n(this.panel,a.keyframes,a.options);return}this.hide()}addOpenListeners(){document.addEventListener("keydown",this.handleDocumentKeyDown)}removeOpenListeners(){document.removeEventListener("keydown",this.handleDocumentKeyDown)}async handleOpenChange(){var y;let e=(y=this.closeButton.shadowRoot)==null?void 0:y.querySelector('[part="base"]');if(this.open){this.emit("sd-show"),this.addOpenListeners(),this.originalTrigger=L(),this.contained||(this.modal.activate(),m(this));let a=this.querySelector("[autofocus]");a&&a.removeAttribute("autofocus"),await Promise.all([h(this.drawer),h(this.overlay)]),this.drawer.hidden=!1,this.drawer.removeAttribute("inert");let d=l(this,`drawer.show${g(this.placement)}`,{dir:this.localize.dir()}),s=l(this,"drawer.overlay.show",{dir:this.localize.dir()});await Promise.all([n(this.panel,d.keyframes,d.options),n(this.overlay,s.keyframes,s.options)]),e==null||e.setAttribute("aria-controls","drawer"),e==null||e.setAttribute("aria-expanded","true"),requestAnimationFrame(()=>{this.emit("sd-initial-focus",{cancelable:!0}).defaultPrevented||(a?a.focus({preventScroll:!0}):this.panel.focus({preventScroll:!0})),a?a.setAttribute("autofocus",""):this.closeButton.focus()}),this.emit("sd-after-show")}else{this.emit("sd-hide"),this.removeOpenListeners(),this.contained||(this.modal.deactivate(),f(this)),await Promise.all([h(this.drawer),h(this.overlay)]);let a=l(this,`drawer.hide${g(this.placement)}`,{dir:this.localize.dir()}),d=l(this,"drawer.overlay.hide",{dir:this.localize.dir()});await Promise.all([n(this.overlay,d.keyframes,d.options).then(()=>{this.overlay.hidden=!0}),n(this.panel,a.keyframes,a.options).then(()=>{this.panel.hidden=!0})]),this.drawer.hidden=!0,this.drawer.setAttribute("inert",""),this.overlay.hidden=!1,this.panel.hidden=!1;let s=this.originalTrigger;typeof(s==null?void 0:s.focus)=="function"&&setTimeout(()=>s.focus()),e==null||e.setAttribute("aria-expanded","false"),this.emit("sd-after-hide")}}handleNoModalChange(){this.open&&!this.contained&&(this.modal.activate(),m(this)),this.open&&this.contained&&(this.modal.deactivate(),f(this))}async show(){if(!this.open)return this.open=!0,w(this,"sd-after-show")}async hide(){if(this.open)return this.open=!1,w(this,"sd-after-hide")}render(){return u`<section id="drawer" part="base" class="${p("top-0 start-0 w-full h-full pointer-events-none overflow-hidden",this.contained?"absolute":"fixed")}" aria-label="${this.label}"><div part="overlay" class="${p("block top-0 left-0 right-0 bottom-0 overlay-color-background pointer-events-auto",this.contained?"absolute":"fixed")}" @click="${()=>this.requestClose("overlay")}"></div><div part="panel" class="${p("absolute flex flex-col gap-4 z-10 max-w-full max-h-full bg-white shadow-lg overflow-auto pointer-events-auto focus:outline-none",{end:"top-0 end-0 bottom-auto start-auto w-[var(--width)] h-full",start:"top-0 end-auto bottom-auto start-0 w-[var(--width)] h-full"}[this.placement])}" role="dialog" aria-modal="true" aria-label="${this.label}" tabindex="0">${this.noHeader?u`<sd-6-4-
|
|
2
|
-
:host{--width:25rem;display:contents}:host([contained]){z-index:initial}:host(:not([contained])){z-index:var(--sd-z-index-drawer,700)}[part=body]{-webkit-overflow-scrolling:touch;overflow-y:scroll;scrollbar-width:none}[part=body]::-webkit-scrollbar{height:calc(var(--sd-spacing-1) * 0);width:calc(var(--sd-spacing-1) * 0)}:host [part=panel]{outline:1px solid var(--sd-panel-color-border,transparent)}`],i([c("[part=base]")],t.prototype,"drawer",2),i([c("[part=panel]")],t.prototype,"panel",2),i([c("[part=overlay]")],t.prototype,"overlay",2),i([c("[part=close-button]")],t.prototype,"closeButton",2),i([r({type:Boolean,reflect:!0})],t.prototype,"open",2),i([r({type:String,attribute:"label",reflect:!0})],t.prototype,"label",2),i([r({type:String,reflect:!0})],t.prototype,"placement",2),i([r({type:Boolean,reflect:!0})],t.prototype,"contained",2),i([r({attribute:"no-header",type:Boolean,reflect:!0})],t.prototype,"noHeader",2),i([v("open",{waitUntilFirstUpdate:!0})],t.prototype,"handleOpenChange",1),i([v("contained",{waitUntilFirstUpdate:!0})],t.prototype,"handleNoModalChange",1),t=i([x("sd-6-4-
|
|
1
|
+
import{a as g}from"./chunk.I2H6CZK5.js";import{a as z}from"./chunk.2AQOPKKH.js";import{a as L}from"./chunk.G7HKVXLR.js";import{a as m,b as f}from"./chunk.3L472FD4.js";import{a as E}from"./chunk.CGQ2BPPZ.js";import{a as o,c as l}from"./chunk.B2NUKX6G.js";import{a as w}from"./chunk.KLRPP4NQ.js";import{a as C}from"./chunk.IQPMMUES.js";import{a as p}from"./chunk.YFQFOIEM.js";import{a as v}from"./chunk.NYKJXI3Q.js";import{a as x,b as r,d as c,h as b}from"./chunk.ALCKOGA7.js";import{b as k,e as u}from"./chunk.763RLJEK.js";import{b as n,e as h}from"./chunk.W4QBFD6E.js";import{e as i}from"./chunk.6EV4YU6C.js";var t=class extends b{constructor(){super(...arguments);this.hasSlotController=new E(this,"footer");this.localize=new C(this);this.modal=new z(this);this.open=!1;this.label="";this.placement="end";this.contained=!1;this.noHeader=!1;this.handleDocumentKeyDown=e=>{this.open&&e.key==="Escape"&&(e.stopPropagation(),this.requestClose("keyboard"))}}firstUpdated(){this.drawer.hidden=!this.open,this.open&&(this.addOpenListeners(),this.contained||(this.modal.activate(),m(this)))}disconnectedCallback(){super.disconnectedCallback(),f(this)}requestClose(e){if(this.emit("sd-request-close",{cancelable:!0,detail:{source:e}}).defaultPrevented){let a=l(this,"drawer.denyClose",{dir:this.localize.dir()});n(this.panel,a.keyframes,a.options);return}this.hide()}addOpenListeners(){document.addEventListener("keydown",this.handleDocumentKeyDown)}removeOpenListeners(){document.removeEventListener("keydown",this.handleDocumentKeyDown)}async handleOpenChange(){var y;let e=(y=this.closeButton.shadowRoot)==null?void 0:y.querySelector('[part="base"]');if(this.open){this.emit("sd-show"),this.addOpenListeners(),this.originalTrigger=L(),this.contained||(this.modal.activate(),m(this));let a=this.querySelector("[autofocus]");a&&a.removeAttribute("autofocus"),await Promise.all([h(this.drawer),h(this.overlay)]),this.drawer.hidden=!1,this.drawer.removeAttribute("inert");let d=l(this,`drawer.show${g(this.placement)}`,{dir:this.localize.dir()}),s=l(this,"drawer.overlay.show",{dir:this.localize.dir()});await Promise.all([n(this.panel,d.keyframes,d.options),n(this.overlay,s.keyframes,s.options)]),e==null||e.setAttribute("aria-controls","drawer"),e==null||e.setAttribute("aria-expanded","true"),requestAnimationFrame(()=>{this.emit("sd-initial-focus",{cancelable:!0}).defaultPrevented||(a?a.focus({preventScroll:!0}):this.panel.focus({preventScroll:!0})),a?a.setAttribute("autofocus",""):this.closeButton.focus()}),this.emit("sd-after-show")}else{this.emit("sd-hide"),this.removeOpenListeners(),this.contained||(this.modal.deactivate(),f(this)),await Promise.all([h(this.drawer),h(this.overlay)]);let a=l(this,`drawer.hide${g(this.placement)}`,{dir:this.localize.dir()}),d=l(this,"drawer.overlay.hide",{dir:this.localize.dir()});await Promise.all([n(this.overlay,d.keyframes,d.options).then(()=>{this.overlay.hidden=!0}),n(this.panel,a.keyframes,a.options).then(()=>{this.panel.hidden=!0})]),this.drawer.hidden=!0,this.drawer.setAttribute("inert",""),this.overlay.hidden=!1,this.panel.hidden=!1;let s=this.originalTrigger;typeof(s==null?void 0:s.focus)=="function"&&setTimeout(()=>s.focus()),e==null||e.setAttribute("aria-expanded","false"),this.emit("sd-after-hide")}}handleNoModalChange(){this.open&&!this.contained&&(this.modal.activate(),m(this)),this.open&&this.contained&&(this.modal.deactivate(),f(this))}async show(){if(!this.open)return this.open=!0,w(this,"sd-after-show")}async hide(){if(this.open)return this.open=!1,w(this,"sd-after-hide")}render(){return u`<section id="drawer" part="base" class="${p("top-0 start-0 w-full h-full pointer-events-none overflow-hidden",this.contained?"absolute":"fixed")}" aria-label="${this.label}"><div part="overlay" class="${p("block top-0 left-0 right-0 bottom-0 overlay-color-background pointer-events-auto",this.contained?"absolute":"fixed")}" @click="${()=>this.requestClose("overlay")}"></div><div part="panel" class="${p("absolute flex flex-col gap-4 z-10 max-w-full max-h-full bg-white shadow-lg overflow-auto pointer-events-auto focus:outline-none",{end:"top-0 end-0 bottom-auto start-auto w-[var(--width)] h-full",start:"top-0 end-auto bottom-auto start-0 w-[var(--width)] h-full"}[this.placement])}" role="dialog" aria-modal="true" aria-label="${this.label}" tabindex="0">${this.noHeader?u`<sd-6-4-2-button variant="tertiary" size="lg" part="close-button" @click="${()=>this.requestClose("close-button")}" class="absolute top-2 end-2 z-10"><sd-6-4-2-icon label="${this.localize.term("close")}" name="close" library="_internal"></sd-6-4-2-icon></sd-6-4-2-button>`:u`<header part="header" class="flex justify-between py-2 px-4 items-center flex-shrink-0" style="min-height:64px"><div part="title"><slot name="header" part="title" class="flex-auto text-xl m-0" id="title"></slot></div><div class="shrink-0 flex flex-wrap justify-end gap-1 ms-4 absolute top-2 end-2"><sd-6-4-2-button variant="tertiary" size="lg" part="close-button" @click="${()=>this.requestClose("close-button")}"><sd-6-4-2-icon label="${this.localize.term("close")}" name="close" library="_internal"></sd-6-4-2-icon></sd-6-4-2-button></div></header>`}<div part="body" class="flex-auto block px-4 focus-visible:focus-outline !-outline-offset-2" tabindex="0"><slot></slot></div><footer part="footer" class="${p(this.hasSlotController.test("footer")?"text-left p-4":"hidden")}"><slot name="footer"></slot></footer></div></section>`}};t.styles=[...b.styles,k`/*! tailwindcss v4.1.17 | MIT License | https://tailwindcss.com */@layer theme,base,components,utilities;
|
|
2
|
+
:host{--width:25rem;display:contents}:host([contained]){z-index:initial}:host(:not([contained])){z-index:var(--sd-z-index-drawer,700)}[part=body]{-webkit-overflow-scrolling:touch;overflow-y:scroll;scrollbar-width:none}[part=body]::-webkit-scrollbar{height:calc(var(--sd-spacing-1) * 0);width:calc(var(--sd-spacing-1) * 0)}:host [part=panel]{outline:1px solid var(--sd-panel-color-border,transparent)}`],i([c("[part=base]")],t.prototype,"drawer",2),i([c("[part=panel]")],t.prototype,"panel",2),i([c("[part=overlay]")],t.prototype,"overlay",2),i([c("[part=close-button]")],t.prototype,"closeButton",2),i([r({type:Boolean,reflect:!0})],t.prototype,"open",2),i([r({type:String,attribute:"label",reflect:!0})],t.prototype,"label",2),i([r({type:String,reflect:!0})],t.prototype,"placement",2),i([r({type:Boolean,reflect:!0})],t.prototype,"contained",2),i([r({attribute:"no-header",type:Boolean,reflect:!0})],t.prototype,"noHeader",2),i([v("open",{waitUntilFirstUpdate:!0})],t.prototype,"handleOpenChange",1),i([v("contained",{waitUntilFirstUpdate:!0})],t.prototype,"handleNoModalChange",1),t=i([x("sd-6-4-2-drawer")],t);o("drawer.showStart",{keyframes:[{opacity:0,translate:"-100%"},{opacity:1,translate:"0"}],rtlKeyframes:[{opacity:0,translate:"100%"},{opacity:1,translate:"0"}],options:{duration:"var(--sd-duration-medium, 300)",easing:"ease-in-out"}});o("drawer.hideStart",{keyframes:[{opacity:1,translate:"0"},{opacity:0,translate:"-100%"}],rtlKeyframes:[{opacity:1,translate:"0"},{opacity:0,translate:"100%"}],options:{duration:"var(--sd-duration-fast, 150)",easing:"ease-in-out"}});o("drawer.showEnd",{keyframes:[{opacity:0,translate:"100%"},{opacity:1,translate:"0"}],rtlKeyframes:[{opacity:0,translate:"-100%"},{opacity:1,translate:"0"}],options:{duration:"var(--sd-duration-medium, 300)",easing:"ease-in-out"}});o("drawer.hideEnd",{keyframes:[{opacity:1,translate:"0"},{opacity:0,translate:"100%"}],rtlKeyframes:[{opacity:1,translate:"0"},{opacity:0,translate:"-100%"}],options:{duration:"var(--sd-duration-fast, 150)",easing:"ease-in-out"}});o("drawer.denyClose",{keyframes:[{scale:1},{scale:1.01},{scale:1}],options:{duration:"var(--sd-duration-medium, 300)",easing:"ease-in-out"}});o("drawer.overlay.show",{keyframes:[{opacity:0},{opacity:1}],options:{duration:"var(--sd-duration-medium, 300)",easing:"ease-in-out"}});o("drawer.overlay.hide",{keyframes:[{opacity:1},{opacity:0}],options:{duration:"var(--sd-duration-medium, 300)",easing:"ease-in-out"}});export{t as a};
|
|
@@ -10,4 +10,4 @@ import{a as M,h as V}from"./chunk.ALCKOGA7.js";import{b as j}from"./chunk.763RLJ
|
|
|
10
10
|
color: transparent;
|
|
11
11
|
}
|
|
12
12
|
`),i.shadowRoot.adoptedStyleSheets.push(e);let s=e.cssRules[0].style;s.setProperty("--style-observer-adopted-style-sheet-bug","1");let r=getComputedStyle(i),t=r.getPropertyValue("--style-observer-adopted-style-sheet-bug");s.removeProperty("--style-observer-adopted-style-sheet-bug"),r=getComputedStyle(i);let n=r.getPropertyValue("--style-observer-adopted-style-sheet-bug");return i.remove(),t===n}});var E=class extends WeakMap{has(e,s){if(arguments.length===1)return super.has(e);let r=super.get(e);return(r==null?void 0:r.has(s))||!1}add(e,s){var t;let r=(t=super.get(e))!=null?t:new Set;r.add(s),super.set(e,r)}delete(e,...s){let r=super.get(e);if(r){for(let t of s)r.delete(t);r.size===0&&super.delete(e)}}};function f(i){return i==null?[]:Array.isArray(i)?i:typeof i!="string"&&typeof i[Symbol.iterator]=="function"?Array.from(i):[i]}function H(i){return i?new Promise(e=>setTimeout(e,i)):new Promise(e=>requestAnimationFrame(e))}var N;function Q(i){N!=null||(N=document.createElement("div"));let e=N.style;e[i]="inherit";let s=[...e];return s.length===0&&(s=[i]),e.cssText="",s}function X(i){let e=i.matchAll(/(?:^|\s)([+-]?(?:\d+|\d*\.\d+))\s*(ms|s)?(?=\s|$)/g),s=[];for(let r of e){let[,t,n]=r;t=parseFloat(t),n==="s"&&(t*=1e3),s.push(t)}return s}function W(i,e){e=Z(e);let s;if(i==="all")s=/\b\w+\b/g;else{let m=[...new Set([...Q(i),i,"all"])];s=RegExp(`(?:^|\\s)(${m.join("|")})\\b`)}let r=e.findLast(m=>s.test(m)),t=r?X(r):[0,0];t.length===0?t=[0,0]:t.length===1&&t.push(0);let[n,o]=t;return{duration:n,delay:o}}function Z(i){let e=[],s=0,r=[];for(let t of i.matchAll(/[,()]/g)){let n=t[0];if(n===","){if(r.length===0){let o=i.slice(s,t.index);e.push(o.trim()),s=t.index+1}}else n==="("?r.push("("):n===")"&&r.pop()}if(s<i.length){let t=i.slice(s);e.push(t.trim())}return e}var y,T,P=class{constructor(e){d(this,y,new Set);d(this,T,new WeakMap);this.callback=e}observe(e){if(l(this,y).has(e))return;let s=e.ownerDocument,r=l(this,T).get(s);r||(r=new IntersectionObserver(t=>{this.callback(t.map(({target:n})=>({target:n})))},{root:s.documentElement}),l(this,T).set(s,r)),l(this,y).add(e),r.observe(e)}unobserve(e){if(!e){for(let t of l(this,y))this.unobserve(t);return}let s=e.ownerDocument,r=l(this,T).get(s);r==null||r.unobserve(e),l(this,y).delete(e)}};y=new WeakMap,T=new WeakMap;var R,q,ee=(q=(R=globalThis.CSS)==null?void 0:R.supports)!=null&&q.call(R,"transition-behavior","allow-discrete")?" allow-discrete":"";globalThis.document&&(S("--style-observer-transition",{inherits:!1}),a.detectAll());var x,_,G,O,c=class{constructor(e,s,r={}){d(this,_);h(this,"properties");h(this,"target");h(this,"callback");h(this,"options");d(this,x,!1);d(this,O);h(this,"_shadowSheet");h(this,"_styles",{});this.constructor.all.add(e,this),this.properties=new Map,this.target=e,this.callback=s,this.options=I({properties:[]},r);let t=f(r.properties);this.renderedObserver=new P(n=>{this.propertyNames.length>0&&this.handleEvent()}),t.length>0&&this.observe(t)}get propertyNames(){return[...this.properties.keys()]}resolveOptions(e){return Object.assign(k(e),this.options)}async handleEvent(e){if(e&&!this.properties.has(e.propertyName))return;if(a.TRANSITIONRUN_EVENT_LOOP&&(e==null?void 0:e.type)==="transitionrun"||this.options.throttle>0){let t=a.TRANSITIONRUN_EVENT_LOOP?"transitionrun":"transitionstart",n=Math.max(this.options.throttle,50);if(a.TRANSITIONRUN_EVENT_LOOP){let o=W(e.propertyName,getComputedStyle(this.target).transition);n=Math.max(n,o.duration+o.delay+16)}this.target.removeEventListener(t,this),await H(n),this.target.addEventListener(t,this)}let s=getComputedStyle(this.target),r=[];for(let t of this.propertyNames){let n=s.getPropertyValue(t),o=this.properties.get(t);n!==o&&(r.push({target:this.target,property:t,value:n,oldValue:o}),this.properties.set(t,n))}r.length>0&&this.callback(r)}observe(e){var r;if(e=f(e),e=e.filter(t=>!this.properties.has(t)),e.length===0)return;$(this,_,G).call(this);let s=getComputedStyle(this.target);for(let t of e){a.UNREGISTERED_TRANSITION&&!this.constructor.properties.has(t)&&(S(t,void 0,this.target.ownerDocument),this.constructor.properties.add(t));let n=s.getPropertyValue(t);this.properties.set(t,n)}a.TRANSITIONRUN_EVENT_LOOP&&(this.target.addEventListener("transitionrun",this),(r=a.all.TRANSITIONRUN_EVENT_LOOP.valuePending)==null||r.then(t=>{t||this.target.removeEventListener("transitionrun",this)})),this.target.addEventListener("transitionstart",this),this.target.addEventListener("transitionend",this),this.updateTransitionProperties(),this.renderedObserver.observe(this.target)}updateTransitionProperties(){this.setProperty("--style-observer-transition","");let e=new Set(getComputedStyle(this.target).transitionProperty.split(", ")),s=[];for(let t of this.constructor.all.get(this.target))s.push(...t.propertyNames);s=[...new Set(s)];let r=s.filter(t=>!e.has(t)).map(t=>`${t} 1ms step-start${ee}`).join(", ");this.setProperty("--style-observer-transition",r)}updateTransition({firstTime:e}={}){let s="var(--style-observer-transition, --style-observer-noop)",r=this.getProperty("transition"),t;(e?r:!r.includes(s))&&(t=g(this,O,r)),t===void 0&&(e||!l(this,O))&&(r.includes(s)&&this.setProperty("transition",""),t=getComputedStyle(this.target).transition),t==="all"?t="":t=t.replace(/^none\b/,"");let n=t?t+", ":"";this.setProperty("transition",n+s),this.updateTransitionProperties()}get _isHost(){return this.target.shadowRoot&&!a.ADOPTED_STYLE_SHEET&&!Object.isFrozen(this.target.shadowRoot.adoptedStyleSheets)}setProperty(e,s,r){let t=this.target.style,n=t;if(this._isHost){if(!this._shadowSheet&&(this._shadowSheet=new CSSStyleSheet,this._shadowSheet.insertRule(":host { }"),this.target.shadowRoot.adoptedStyleSheets.push(this._shadowSheet),Object.keys(this._styles).length>0))for(let o in this._styles){let m=this._styles[o];this.setProperty(o,m),t.getPropertyValue(o)===m&&t.removeProperty(o)}n=this._shadowSheet.cssRules[0].style}n.setProperty(e,s,r),this._styles[e]=this.getProperty(e)}getProperty(e){var r,t,n;return((n=(t=(r=this._shadowSheet)==null?void 0:r.cssRules[0])==null?void 0:t.style)!=null?n:this.target.style).getPropertyValue(e)}unobserve(e){e=f(e),e=e.filter(s=>this.properties.has(s));for(let s of e)this.properties.delete(s);this.properties.size===0&&(this.target.removeEventListener("transitionrun",this),this.target.removeEventListener("transitionstart",this),this.target.removeEventListener("transitionend",this),this.renderedObserver.unobserve(this.target)),this.updateTransitionProperties()}};x=new WeakMap,_=new WeakSet,G=function(){if(l(this,x))return;let e=this.constructor.all.get(this.target).size===1;this.updateTransition({firstTime:e}),g(this,x,!0)},O=new WeakMap,h(c,"properties",new Set),h(c,"all",new E);function k(i){return i?(typeof i=="string"||Array.isArray(i)?i={properties:f(i)}:typeof i=="object"&&(i=I({properties:[]},i)),i):{}}var b=class{constructor(e,s){h(this,"elementObservers",new WeakMap);var r;this.callback=e,s=k(s),(r=s.targets)!=null||(s.targets=[]),s.target&&s.targets.push(s.target),this.options=s,this.options.targets.length>0&&this.options.properties.length>0&&this.observe(this.options.targets,this.options.properties)}changed(e){this.callback(e)}observe(...e){let{targets:s,properties:r}=Y(...e);if(s.length===0&&(s=this.options.targets),s.length!==0)for(let t of s){let n=this.elementObservers.get(t);n||(n=new c(t,o=>this.changed(o),this.options),this.elementObservers.set(t,n)),n.observe(r)}}unobserve(...e){let{targets:s,properties:r}=Y(...e);if(s.length===0&&(s=this.options.targets),s.length!==0){r.length===0&&(r=this.options.properties);for(let t of s){let n=this.elementObservers.get(t);n&&n.unobserve(r)}}}updateTransition(e){for(let s of f(e)){let r=this.elementObservers.get(s);r&&r.updateTransition()}}};function Y(i,e){let s=[...f(i),...f(e)];i=[],e=[];for(let r of s)(typeof r=="string"||r instanceof String?e:i).push(r);return{targets:i,properties:e}}var A=class{constructor(e,s){this.host=e,this.callback=s}connect(){this.observer=new b(e=>{var r,t;let s=(t=(r=e==null?void 0:e[0])==null?void 0:r.value)==null?void 0:t.replaceAll("'","");s&&this.callback(s)}),this.observer.observe(this.host,"--sd-theme")}disconnect(){var e;(e=this.observer)==null||e.unobserve(this.host)}};var w=class extends V{handleThemeChange(e){this.emit("sd-theme-change",{detail:{theme:e},bubbles:!0})}connectedCallback(){super.connectedCallback(),this.themeObserver=new A(this,this.handleThemeChange.bind(this)),this.themeObserver.connect()}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this.themeObserver)==null||e.disconnect()}};w.styles=[...V.styles,j`/*! tailwindcss v4.1.17 | MIT License | https://tailwindcss.com */@layer theme,base,components,utilities;
|
|
13
|
-
:host{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border-width:0}`],w=D([M("sd-6-4-
|
|
13
|
+
:host{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border-width:0}`],w=D([M("sd-6-4-2-theme-listener")],w);export{w as a};
|
|
@@ -0,0 +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 P}from"./chunk.NYKJXI3Q.js";import{a as N,b as y,c as x,d as R,h as H}from"./chunk.ALCKOGA7.js";import{b as W,e as V,i as q}from"./chunk.763RLJEK.js";import{e as d}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 z=[],t=E.trim();if(t.startsWith("["))try{let s=JSON.parse(t);Array.isArray(s)&&(z=s.map(String))}catch(s){return[]}else z=t.split(/[\s,]+/).map(s=>s.trim()).filter(Boolean);let e=[];for(let s of z){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-4-2-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),h=o.slice(8,16),p=this.buildDmyFromDigits(c),I=this.buildDmyFromDigits(h),S;c.length===0?S="":c.length<8?S=p:h.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],k=a.isSameDay(F,T);if((this.allowSameDayRange||!k)&&!this.wouldRangeContainDisabled(F,T)){let C=a.toLocalISODate(a.startOfDayLocal(F)),Y=a.toLocalISODate(a.startOfDayLocal(T));(this.rangeStart!==C||this.rangeEnd!==Y)&&(this.rangeStart=C,this.rangeEnd=Y,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,h=(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=h,v=L=>{let C=[];for(let Y=0;Y<L.length;Y++)L[Y]==="."&&C.push(Y);return C},M=v(O),A=v(D),F=M.filter(L=>L<h).length,k=A.filter(L=>L<h).length-F;if(k>0?g+=k:!M.includes(h)&&A.includes(h)&&(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)}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 h=o?a.parseLocalISO(o):null,p=c?a.parseLocalISO(c):null;if(h&&p){if(a.compareDates(h,p)>0){let w=h;h=p,p=w}if(!this.allowSameDayRange&&a.isSameDay(h,p))return this.showInvalidStyle=!0,this.showValidStyle=!1,!1;if(this.wouldRangeContainDisabled(h,p))return this.showInvalidStyle=!0,this.showValidStyle=!1,!1}let I=h?a.toLocalISODate(a.startOfDayLocal(h)):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=h!=null?h: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 h;let c=this.input;c&&(c.value=(h=this.inputValue)!=null?h:"",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 h=o.value.length;o.setSelectionRange(h,h)})}))});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-4-2-icon library="_internal" name="chevrons-sm-left" class="h-6 w-6"></sd-6-4-2-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-4-2-icon library="_internal" name="chevron-sm-left" class="h-6 w-6"></sd-6-4-2-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-4-2-icon library="_internal" name="chevron-sm-right" class="h-6 w-6"></sd-6-4-2-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-4-2-icon library="_internal" name="chevrons-sm-right" class="h-6 w-6"></sd-6-4-2-icon></button></div></div><sd-6-4-2-divider></sd-6-4-2-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((h,p)=>{let I=h.getMonth()===this.viewMonth.getMonth(),S=this.isDisabled(h)||!this.inMinMax(h),w=a.isSameDay(h,this.focusedDate),D=a.isSameDay(h,this.today),O=!this.range&&i?a.isSameDay(h,i):!1,g=this.range&&n?a.isSameDay(h,n):!1,v=this.range&&l?a.isSameDay(h,l):!1,M=this.range&&n&&l?a.isBetweenInclusive(h,n,l):!1,A=f(h)&&!S,F=-1,T=b&&a.isSameDay(h,b);(this.tabbingIntoGrid&&T||!this.tabbingIntoGrid&&w)&&(F=0);let k=this.isWeekend(h),L=h.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(h)||!this.inMinMax(h)?"out-month text-neutral-500":this.disabledWeekends&&k?"weekend-day text-neutral-500":"in-month text-primary":this.disabledWeekends&&k?"out-month weekend-day text-neutral-500":k?"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(h)}" @mouseenter="${()=>this.onDayMouseEnter(h)}" @keydown="${this.onKeyDown}" @click="${()=>{this.focusedDate=a.startOfDayLocal(h),this.selectDate(h)}}">${h.getDate()}</button>`})}</div>`)}</div></div>`}render(){var h,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")}"><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&&((h=this.currentPlacement)!=null&&h.startsWith("bottom")?"rounded-bl-none rounded-br-none":"rounded-tl-none rounded-tr-none"))}">${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 text-base",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><sd-6-4-2-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-4-2-icon part="invalid-icon" class="${$("text-error",f,b)}" library="_internal" name="risk"></sd-6-4-2-icon>`:""} ${this.showValidStyle&&this.styleOnValid?V`<sd-6-4-2-icon class="${$("text-success flex-shrink-0",f,b)}" library="_internal" name="confirm-circle" part="valid-icon"></sd-6-4-2-icon>`:""}<sd-6-4-2-icon class="${$(u,f,b,"hover:cursor-pointer")}" library="_internal" name="calendar" @click="${this.show}"></sd-6-4-2-icon></div>${this.renderCalendar()}</sd-6-4-2-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}`],d([y({type:String,reflect:!0})],r.prototype,"locale",2),d([y({type:String,converter:B,reflect:!0})],r.prototype,"value",2),d([y({type:Boolean,reflect:!0})],r.prototype,"range",2),d([y({attribute:"range-start",converter:B,reflect:!0})],r.prototype,"rangeStart",2),d([y({attribute:"range-end",converter:B,reflect:!0})],r.prototype,"rangeEnd",2),d([y({type:Boolean})],r.prototype,"allowSameDayRange",2),d([y({type:String,converter:B,reflect:!0})],r.prototype,"min",2),d([y({type:String,converter:B,reflect:!0})],r.prototype,"max",2),d([y({type:Number})],r.prototype,"firstDayOfWeek",2),d([y({type:Boolean,reflect:!0,attribute:"disabled-weekends"})],r.prototype,"disabledWeekends",2),d([y({attribute:"disabled-dates",converter:_})],r.prototype,"disabledDates",2),d([y({attribute:!1})],r.prototype,"isDateDisabled",2),d([y({type:String,reflect:!0})],r.prototype,"size",2),d([y({type:String})],r.prototype,"alignment",2),d([y({type:String,reflect:!0})],r.prototype,"label",2),d([y({type:String,attribute:"help-text",reflect:!0})],r.prototype,"helpText",2),d([y({attribute:"floating-label",type:Boolean,reflect:!0})],r.prototype,"floatingLabel",2),d([y({type:Boolean,reflect:!0})],r.prototype,"disabled",2),d([y({type:Boolean,reflect:!0})],r.prototype,"required",2),d([y({type:Boolean,attribute:"visually-disabled"})],r.prototype,"visuallyDisabled",2),d([y({type:Boolean,reflect:!0,attribute:"style-on-valid"})],r.prototype,"styleOnValid",2),d([y({type:Boolean,reflect:!0})],r.prototype,"readonly",2),d([y({type:String,reflect:!0})],r.prototype,"placement",2),d([y({type:String,reflect:!0})],r.prototype,"placeholder",2),d([y({reflect:!0})],r.prototype,"name",2),d([y({type:String,reflect:!0})],r.prototype,"form",2),d([x()],r.prototype,"open",2),d([x()],r.prototype,"viewMonth",2),d([x()],r.prototype,"focusedDate",2),d([x()],r.prototype,"today",2),d([x()],r.prototype,"disabledDatesSet",2),d([x()],r.prototype,"previewEnd",2),d([x()],r.prototype,"statusNavText",2),d([x()],r.prototype,"statusSelectText",2),d([x()],r.prototype,"hasFocus",2),d([x()],r.prototype,"showValidStyle",2),d([x()],r.prototype,"showInvalidStyle",2),d([x()],r.prototype,"currentPlacement",2),d([x()],r.prototype,"inputValue",2),d([R("sd-6-4-2-popup")],r.prototype,"popup",2),d([R("#invalid-message")],r.prototype,"invalidMessage",2),d([R("#input")],r.prototype,"input",2),d([P("open",{waitUntilFirstUpdate:!0})],r.prototype,"handleOpenChange",1),d([P("locale")],r.prototype,"handleLocaleChange",1),d([P("disabledDates")],r.prototype,"handleDisabledDatesChange",1),d([P("value")],r.prototype,"handleValueChange",1),d([P("rangeStart"),P("rangeEnd")],r.prototype,"handleRangeChange",1),d([P(["disabled","visually-disabled"],{waitUntilFirstUpdate:!0})],r.prototype,"handleDisabledChange",1),r=d([N("sd-6-4-2-datepicker")],r);export{r as a};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import{a as l,b as i,g as c,h as o}from"./chunk.ALCKOGA7.js";import{b as a,e as n}from"./chunk.763RLJEK.js";import{e as t}from"./chunk.6EV4YU6C.js";var e=class extends o{constructor(){super(...arguments);this.closeOthers=!1;this.handleAccordionShow=r=>{this.closeOthers&&this._accordionsInDefaultSlot.forEach(s=>{s!==r.target&&s.parentNode===r.target.parentNode&&s.removeAttribute("open")})}}connectedCallback(){super.connectedCallback(),this.addEventListener("sd-show",this.handleAccordionShow)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("sd-show",this.handleAccordionShow)}render(){return n`<div part="base"><slot></slot></div>`}};e.styles=[...o.styles,a`/*! tailwindcss v4.1.17 | MIT License | https://tailwindcss.com */@layer theme,base,components,utilities;
|
|
2
|
-
:host{display:block}::slotted(sd-6-4-
|
|
2
|
+
:host{display:block}::slotted(sd-6-4-2-accordion:not(:first-of-type)){margin-top:calc(-1 * var(--sd-accordion-border-width))!important}`],t([c({selector:"sd-6-4-2-accordion"})],e.prototype,"_accordionsInDefaultSlot",2),t([i({attribute:"close-others",type:Boolean,reflect:!0})],e.prototype,"closeOthers",2),e=t([l("sd-6-4-2-accordion-group")],e);export{e as a};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as c}from"./chunk.IQPMMUES.js";import{a as s}from"./chunk.YFQFOIEM.js";import{a as i,b as a,h as r}from"./chunk.ALCKOGA7.js";import{b as l,e as o}from"./chunk.763RLJEK.js";import{e}from"./chunk.6EV4YU6C.js";var t=class extends r{constructor(){super(...arguments);this.localize=new c(this);this.subtick=!1}render(){return o`<div part="base" class="${s(this.subtick?"w-0.25":"w-0.5")}"><div part="line" class="${s(this.subtick?"h-2":"h-[10px]")}"></div><div part="label" class="flex items-center justify-center text-center text-nowrap text-sm sd-6-4-
|
|
2
|
-
[part='line']{background-color:rgba(var(--sd-color-border-neutral-400,rgba(var(--sd-color-neutral-400))))}`],e([a({type:Boolean,reflect:!0})],t.prototype,"subtick",2),t=e([i("sd-6-4-
|
|
1
|
+
import{a as c}from"./chunk.IQPMMUES.js";import{a as s}from"./chunk.YFQFOIEM.js";import{a as i,b as a,h as r}from"./chunk.ALCKOGA7.js";import{b as l,e as o}from"./chunk.763RLJEK.js";import{e}from"./chunk.6EV4YU6C.js";var t=class extends r{constructor(){super(...arguments);this.localize=new c(this);this.subtick=!1}render(){return o`<div part="base" class="${s(this.subtick?"w-0.25":"w-0.5")}"><div part="line" class="${s(this.subtick?"h-2":"h-[10px]")}"></div><div part="label" class="flex items-center justify-center text-center text-nowrap text-sm sd-6-4-2-range-scale-ticks-color-text"><slot></slot></div></div>`}};t.styles=[...r.styles,l`/*! tailwindcss v4.1.17 | MIT License | https://tailwindcss.com */@layer theme,base,components,utilities;
|
|
2
|
+
[part='line']{background-color:rgba(var(--sd-color-border-neutral-400,rgba(var(--sd-color-neutral-400))))}`],e([a({type:Boolean,reflect:!0})],t.prototype,"subtick",2),t=e([i("sd-6-4-2-range-tick")],t);export{t as a};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{a as c}from"./chunk.CGQ2BPPZ.js";import{a as r}from"./chunk.YFQFOIEM.js";import{a as s,b as n,d,h as e}from"./chunk.ALCKOGA7.js";import{b as i,e as l}from"./chunk.763RLJEK.js";import{e as o}from"./chunk.6EV4YU6C.js";var a=class extends e{constructor(){super(...arguments);this.variant="white";this.hasSlotController=new c(this,"[default]","media","meta","headline","expandable")}render(){let t={"teaser-has-default":this.hasSlotController.test("[default]"),"teaser-has-media":this.hasSlotController.test("media"),"teaser-has-meta":this.hasSlotController.test("meta"),"teaser-has-headline":this.hasSlotController.test("headline"),"teaser-has-expandable":this.hasSlotController.test("expandable")};return l`<div class="relative flex flex-col group" part="base"><div class="absolute flex flex-col justify-end h-full w-full pb-4"><div class="${r("flex-1",this.variant==="gradient-light"&&"bg-gradient-to-t from-white/[.8] to-60%",this.variant==="gradient-dark"&&"bg-gradient-to-t from-primary-800/[.8] to-60%")}"></div><div class="${r("relative",["primary","gradient-dark"].includes(this.variant)&&"text-white")}"><div class="${r("absolute inset-0",{white:"bg-white/[.8] group-hover:bg-white/90","neutral-100":"sd-6-4-
|
|
1
|
+
import{a as c}from"./chunk.CGQ2BPPZ.js";import{a as r}from"./chunk.YFQFOIEM.js";import{a as s,b as n,d,h as e}from"./chunk.ALCKOGA7.js";import{b as i,e as l}from"./chunk.763RLJEK.js";import{e as o}from"./chunk.6EV4YU6C.js";var a=class extends e{constructor(){super(...arguments);this.variant="white";this.hasSlotController=new c(this,"[default]","media","meta","headline","expandable")}render(){let t={"teaser-has-default":this.hasSlotController.test("[default]"),"teaser-has-media":this.hasSlotController.test("media"),"teaser-has-meta":this.hasSlotController.test("meta"),"teaser-has-headline":this.hasSlotController.test("headline"),"teaser-has-expandable":this.hasSlotController.test("expandable")};return l`<div class="relative flex flex-col group" part="base"><div class="absolute flex flex-col justify-end h-full w-full pb-4"><div class="${r("flex-1",this.variant==="gradient-light"&&"bg-gradient-to-t from-white/[.8] to-60%",this.variant==="gradient-dark"&&"bg-gradient-to-t from-primary-800/[.8] to-60%")}"></div><div class="${r("relative",["primary","gradient-dark"].includes(this.variant)&&"text-white")}"><div class="${r("absolute inset-0",{white:"bg-white/[.8] group-hover:bg-white/90","neutral-100":"sd-6-4-2-teaser-media--neutral-100-color-background group-hover:sd-6-4-2-teaser-media--neutral-100--hover-color-background",primary:"bg-primary/[.8] text-white group-hover:bg-primary/90","primary-100":"sd-6-4-2-teaser-media--primary-100-color-background group-hover:sd-6-4-2-teaser-media--primary-100--hover-color-background","gradient-light":"bg-gradient-to-t from-white/90 to-white/[.8]","gradient-dark":"bg-gradient-to-t from-primary-800/90 to-primary-800/[.8]"}[this.variant])}"></div><div class="relative flex-col text-left p-4" part="content"><div class="flex flex-col"><div part="headline" class="text-lg font-bold m-0 order-2"><slot name="headline">Always insert one semantically correct heading element here (e. g. <h2>)</slot></div><div part="meta" class="${r("gap-2 mb-4 order-1",!t["teaser-has-meta"]&&"hidden")}"><slot name="meta"></slot></div></div><div class="${r("hidden",t["teaser-has-expandable"]&&"h-[0px] invisible opacity-0 md:[transition:_height_0.2s_linear,opacity_0.1s_linear_0.1s] md:block md:group-hover:h-auto md:group-hover:my-4 md:group-hover:opacity-[100%] md:group-hover:visible")}" part="expandable" aria-hidden="true"><slot name="expandable"></slot></div><div part="main" class="${r(!t["teaser-has-default"]&&"hidden")}"><slot></slot></div></div></div></div><div class="${r("mb-4 -z-10",!t["teaser-has-media"]&&"hidden")}" part="media"><slot name="media"></slot></div></div>`}};a.styles=[...e.styles,i`/*! tailwindcss v4.1.17 | MIT License | https://tailwindcss.com */@layer theme,base,components,utilities;
|
|
2
2
|
:host{display:block}::slotted(*){margin:calc(var(--sd-spacing-1) * 0)}:host([variant=white]) .background:focus-within{background-color:rgba(var(--sd-color-background-white))}@supports (color:color-mix(in lab,red,red)){:host([variant=white]) .background:focus-within{background-color:color-mix(in oklab,rgba(var(--sd-color-background-white)) var(--sd-opacity-90),transparent)}}:host([variant=neutral-100]) .background:focus-within{background-color:rgba(var(--sd-color-background-neutral-100))}@supports (color:color-mix(in lab,red,red)){:host([variant=neutral-100]) .background:focus-within{background-color:color-mix(in oklab,rgba(var(--sd-color-background-neutral-100)) var(--sd-opacity-90),transparent)}}:host([variant=primary]) .background:focus-within{background-color:rgba(var(--sd-color-background-primary))}@supports (color:color-mix(in lab,red,red)){:host([variant=primary]) .background:focus-within{background-color:color-mix(in oklab,rgba(var(--sd-color-background-primary)) var(--sd-opacity-90),transparent)}}:host([variant=primary-100]) .background:focus-within{background-color:rgba(var(--sd-color-background-primary-100))}@supports (color:color-mix(in lab,red,red)){:host([variant=primary-100]) .background:focus-within{background-color:color-mix(in oklab,rgba(var(--sd-color-background-primary-100)) var(--sd-opacity-90),transparent)}}:host([variant=gradient-light]) .bg-gradient-to-t{--sd-color-background-white:var(--sd-informational-gradient--white-color-background, var(--sd-color-white))}:host([variant=gradient-dark]) .bg-gradient-to-t{--sd-color-background-primary-800:var(
|
|
3
3
|
--sd-informational-gradient--primary-800-color-background,
|
|
4
4
|
var(--sd-color-primary-800)
|
|
5
|
-
)}`],o([n({type:String,reflect:!0})],a.prototype,"variant",2),o([d('[part="base"]')],a.prototype,"teaserMedia",2),a=o([s("sd-6-4-
|
|
5
|
+
)}`],o([n({type:String,reflect:!0})],a.prototype,"variant",2),o([d('[part="base"]')],a.prototype,"teaserMedia",2),a=o([s("sd-6-4-2-teaser-media")],a);export{a};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as c}from"./chunk.YFQFOIEM.js";import{a as l}from"./chunk.NYKJXI3Q.js";import{a as o,b as i,h as a}from"./chunk.ALCKOGA7.js";import{b as s,e as r}from"./chunk.763RLJEK.js";import{e}from"./chunk.6EV4YU6C.js";var n=0,t=class extends a{constructor(){super(...arguments);this.attrId=++n;this.componentId=`sd-6-4-
|
|
2
|
-
:host{--padding:0;display:none}:host([active]){display:block}::part(base){padding:var(--padding)}`],e([i({type:String,reflect:!0})],t.prototype,"name",2),e([i({type:Boolean,reflect:!0})],t.prototype,"active",2),e([l("active")],t.prototype,"handleActiveChange",1),t=e([o("sd-6-4-
|
|
1
|
+
import{a as c}from"./chunk.YFQFOIEM.js";import{a as l}from"./chunk.NYKJXI3Q.js";import{a as o,b as i,h as a}from"./chunk.ALCKOGA7.js";import{b as s,e as r}from"./chunk.763RLJEK.js";import{e}from"./chunk.6EV4YU6C.js";var n=0,t=class extends a{constructor(){super(...arguments);this.attrId=++n;this.componentId=`sd-6-4-2-tab-panel-${this.attrId}`;this.name="";this.active=!1}connectedCallback(){super.connectedCallback(),this.id=this.id.length>0?this.id:this.componentId,this.setAttribute("role","tabpanel")}handleActiveChange(){this.setAttribute("aria-hidden",this.active?"false":"true")}render(){return r`<slot part="base" class="${c("block",this.active&&"tab-panel--active")}"></slot>`}};t.styles=[...a.styles,s`/*! tailwindcss v4.1.17 | MIT License | https://tailwindcss.com */@layer theme,base,components,utilities;
|
|
2
|
+
:host{--padding:0;display:none}:host([active]){display:block}::part(base){padding:var(--padding)}`],e([i({type:String,reflect:!0})],t.prototype,"name",2),e([i({type:Boolean,reflect:!0})],t.prototype,"active",2),e([l("active")],t.prototype,"handleActiveChange",1),t=e([o("sd-6-4-2-tab-panel")],t);export{t as a};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{a as C}from"./chunk.BJBQEPZV.js";import{a as k}from"./chunk.EOXYPQZI.js";import{a as T}from"./chunk.GP2QVZP5.js";import{a as M}from"./chunk.CBQWVOOS.js";import{a as A}from"./chunk.IQPMMUES.js";import{a as n}from"./chunk.YFQFOIEM.js";import{a as v}from"./chunk.NYKJXI3Q.js";import{a as _,b as p,c as m,d as f,e as E,h as w}from"./chunk.ALCKOGA7.js";import{b as P,e as b}from"./chunk.763RLJEK.js";import{d as $}from"./chunk.W4QBFD6E.js";import{e as o}from"./chunk.6EV4YU6C.js";function I(u,d,e){let i=t=>Object.is(t,-0)?0:t;return u<d?i(d):u>e?i(e):i(u)}function*L(u,d){if(u!==void 0){let e=0;for(let i of u)yield d(i,e++)}}function*B(u,d,e=1){let i=d===void 0?0:u;d!=null||(d=u);for(let t=i;e>0?t<d:d<t;t+=e)yield t}var r=class extends w{constructor(){super(...arguments);this.variant="number";this.inverted=!1;this.loop=!1;this.autoplay=!1;this.fade=!1;this.slidesPerPage=1;this.slidesPerMove=1;this.activeSlide=0;this.currentPage=1;this.pausedAutoplay=!1;this.autoplayController=new M(this,()=>this.next());this.scrollController=new k(this);this.slides=this.getElementsByTagName("sd-6-4-0-carousel-item");this.intersectionObserverEntries=new Map;this.localize=new A(this);this.userInteracted=!1;this.fadeController=new C(this);this.handleUserInteraction=()=>{this.userInteracted=!0};this.handleSlotChange=e=>{e.some(t=>[...t.addedNodes,...t.removedNodes].some(s=>T.isCarouselItem(s)&&!s.hasAttribute("data-clone")))&&this.initializeSlides(),this.requestUpdate()};this.unblockAutoplay=(e,i)=>{e.detail&&i.blur()}}connectedCallback(){super.connectedCallback(),["click","keydown"].forEach(i=>this.addEventListener(i,this.handleUserInteraction));let e=new IntersectionObserver(i=>{i.forEach(t=>{this.intersectionObserverEntries.set(t.target,t);let s=t.target;s.toggleAttribute("inert",!t.isIntersecting),s.classList.toggle("--in-view",t.isIntersecting),s.setAttribute("aria-hidden",t.isIntersecting?"false":"true")})},{root:this,threshold:.6});this.intersectionObserver=e,e.takeRecords().forEach(i=>{this.intersectionObserverEntries.set(i.target,i)})}disconnectedCallback(){super.disconnectedCallback(),this.intersectionObserver.disconnect(),this.mutationObserver.disconnect(),["click","keydown"].forEach(e=>this.removeEventListener(e,this.handleUserInteraction)),this.fade&&this.fadeController.disable()}async firstUpdated(){if((()=>{let i=this.getSlides({excludeClones:!1});return i.length>0&&i[0].getBoundingClientRect().width>0})())this.initializeSlides();else{let i=new IntersectionObserver(t=>{t.forEach(s=>{s.isIntersecting&&s.target.getBoundingClientRect().width>0&&(this.initializeSlides(),i.disconnect())})});i.observe(this)}this.mutationObserver=new MutationObserver(this.handleSlotChange),this.mutationObserver.observe(this,{childList:!0,subtree:!1}),this.fade&&(await this.updateComplete,this.fadeController.enable())}getPageCount(e,i,t){return Math.ceil((e-i)/t)+1>0?Math.ceil((e-i)/t)+1:1}getCurrentPage(e,i,t,s){return Math.ceil((e-t)/s)-Math.ceil((e-t-i)/s)+1}getSlides({excludeClones:e=!0}={}){return[...this.slides].filter(i=>!e||!i.hasAttribute("data-clone"))}handleKeyDown(e){if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(e.key)){let i=e.target,t=this.localize.dir()==="rtl",s=i.closest('[part~="pagination-item"]')!==null,l=e.key==="ArrowDown"||!t&&e.key==="ArrowRight"||t&&e.key==="ArrowLeft",h=e.key==="ArrowUp"||!t&&e.key==="ArrowLeft"||t&&e.key==="ArrowRight";e.preventDefault(),h&&this.previous(),l&&this.next(),e.key==="Home"&&this.goToSlide(0),e.key==="End"&&this.goToSlide(this.getSlides().length-1),s&&this.updateComplete.then(()=>{var a;let c=(a=this.shadowRoot)==null?void 0:a.querySelector('[part~="pagination-item--active"]');c&&c.focus()})}}handleScrollEnd(){if(this.fade)return;let e=this.getSlides(),t=[...this.intersectionObserverEntries.values()].find(s=>s.isIntersecting);if(this.loop&&(t!=null&&t.target.hasAttribute("data-clone"))){let s=Number(t.target.getAttribute("data-clone"));this.goToSlide(s,"auto");return}t&&(this.activeSlide=e.indexOf(t.target))}handleFocus(){this.autoplay&&this.scrollContainer.setAttribute("aria-live","polite")}handleBlur(){this.autoplay&&this.scrollContainer.setAttribute("aria-live","off")}pause(){this.pausedAutoplay=!0}resume(){this.pausedAutoplay=!1}handlePausedAutoplay(){var e,i;this.pausedAutoplay?(this.autoplayController.stop(),(e=this.autoplayControls)==null||e.setAttribute("aria-pressed","false")):this.autoplay&&(this.autoplayController.start(3e3),(i=this.autoplayControls)==null||i.setAttribute("aria-pressed","true"))}handleFadeChange(){this.fade?this.fadeController.enable():this.fadeController.disable()}initializeSlides(){let e=this.getSlides(),i=this.intersectionObserver;if(this.intersectionObserverEntries.clear(),this.getSlides({excludeClones:!1}).forEach((t,s)=>{i.unobserve(t),t.classList.remove("--in-view"),t.classList.remove("--is-active"),t.setAttribute("aria-label",this.localize.term("slideNum",s+1,e.length)),t.hasAttribute("data-clone")&&t.remove()}),this.loop&&!this.fade){let t=this.slidesPerPage,s=e.slice(-t),l=e.slice(0,t);s.reverse().forEach((h,c)=>{let a=h.cloneNode(!0);a.setAttribute("data-clone",String(e.length-c-1)),this.prepend(a)}),l.forEach((h,c)=>{let a=h.cloneNode(!0);a.setAttribute("data-clone",String(c)),this.append(a)})}this.getSlides({excludeClones:!1}).forEach(t=>{i.observe(t)}),this.fade&&this.updateComplete.then(()=>{this.fadeController.enable()}),this.fade||this.goToSlide(this.activeSlide,"auto")}handleSlideChange(){let e=this.getSlides();e.forEach((s,l)=>{s.classList.toggle("--is-active",l===this.activeSlide)}),this.fade&&this.fadeController.updateActiveSlide(this.activeSlide);let i=this.getCurrentPage(e.length,this.activeSlide,this.slidesPerPage,this.slidesPerMove);this.currentPage!==i&&(this.currentPage=i),this.hasUpdated&&this.emit("sd-slide-change",{detail:{index:this.activeSlide,slide:e[this.activeSlide]}});let t=this.getPageCount(e.length,this.slidesPerPage,this.slidesPerMove);this.currentPage>t&&requestAnimationFrame(()=>{this.nextTillFirst()})}handleSlidesPerMoveChange(){if(this.fade)return;let e=this.getSlides({excludeClones:!1}),i=this.slidesPerMove;e.forEach((t,s)=>{Math.abs(s-i)%i===0?t.style.removeProperty("scroll-snap-align"):t.style.setProperty("scroll-snap-align","none")})}handleAutoplayChange(){this.autoplayController.stop(),this.autoplay&&!this.pausedAutoplay&&this.autoplayController.start(3e3)}previous(e="smooth"){if(this.fade){let s=this.loop?(this.activeSlide-1+this.getSlides().length)%this.getSlides().length:Math.max(0,this.activeSlide-1);this.goToSlide(s);return}let i=this.activeSlide||this.activeSlide-this.slidesPerMove,t=!1;for(;!t&&i>0;)i-=1,t=Math.abs(i-this.slidesPerMove)%this.slidesPerMove===0;this.currentPage-1===0&&this.loop?this.goToSlide(this.activeSlide-this.slidesPerPage,e):this.goToSlide(i,e)}next(e="smooth"){if(this.fade){let i=this.loop?(this.activeSlide+1)%this.getSlides().length:Math.min(this.getSlides().length-1,this.activeSlide+1);this.goToSlide(i);return}this.currentPage+1<=this.getPageCount(this.getSlides().length,this.slidesPerPage,this.slidesPerMove)?this.goToSlide(this.activeSlide+this.slidesPerMove,e):this.loop&&this.nextTillFirst(e)}nextTillFirst(e="smooth"){if(this.fade){this.goToSlide(0);return}for(;this.activeSlide!==0;)this.goToSlide(this.activeSlide+1,e);this.currentPage=this.getCurrentPage(this.getSlides().length,this.activeSlide,this.slidesPerPage,this.slidesPerMove)}goToSlide(e,i="smooth"){let{slidesPerPage:t,loop:s,scrollContainer:l,fade:h}=this,c=this.getSlides(),a=this.getSlides({excludeClones:!1}),g=(e+c.length)%c.length;if(this.activeSlide=g,h)return;let y=I(e+(s?t:0),0,a.length+1),O=a[y],S=l.getBoundingClientRect(),x=O.getBoundingClientRect();if(l.scrollTo({left:x.left-S.left+l.scrollLeft,top:x.top-S.top+l.scrollTop,behavior:$()?"auto":i}),this.userInteracted&&!this.loop){let z=this.activeSlide===c.length-1||this.activeSlide===this.slides.length-this.slidesPerPage,H=this.activeSlide===0;z?this.previousButton.focus({preventScroll:!0}):H&&this.nextButton.focus({preventScroll:!0})}}render(){let{scrollController:e,slidesPerMove:i}=this,t=this.getPageCount(this.getSlides().length,this.slidesPerPage,this.slidesPerMove),s=this.getCurrentPage(this.getSlides().length,this.activeSlide,this.slidesPerPage,this.slidesPerMove),l=this.loop||s>1,h=this.loop||s<t,c=this.localize.dir()==="ltr";return b`<div part="base" class="${n("carousel h-full w-full")}"><div id="scroll-container" part="scroll-container" class="${n("carousel__slides mb-6 max-h-full w-full items-center justify-items-center",this.inverted?"focus-visible:focus-outline-inverted":"focus-visible:focus-outline",this.fade?"relative overflow-hidden":"grid overflow-auto overscroll-x-contain grid-flow-col auto-rows-[100%] snap-x snap-mandatory overflow-y-hidden")}" style="--slides-per-page:${this.slidesPerPage}" aria-busy="${e.scrolling?"true":"false"}" aria-label="${this.localize.term("carouselContainer",Array.from(this.slides).filter(a=>!a.hasAttribute("data-clone")).length)}" aria-live="${this.autoplay?"off":"polite"}" tabindex="0" @keydown="${this.handleKeyDown}" @scrollend="${this.handleScrollEnd}" @focus="${this.handleFocus}" @blur="${this.handleBlur}"><slot></slot></div><div part="controls" class="${n("w-full flex items-center justify-center relative")}"><div part="navigation" class="${n("carousel__navigation flex items-center justify-center")}"><button part="navigation-button navigation-button--previous" id="carousel__navigation-button--previous" ?disabled="${!l}" class="${n("!mr-6 !rounded-sm sd-interactive transition-colors duration-fast ease-in-out",!l&&"sd-interactive--disabled",this.inverted?"sd-interactive--inverted":"sd-interactive--reset")}" aria-label="${this.localize.term("previousSlide")}" aria-controls="scroll-container" aria-disabled="${l?"false":"true"}" @focus="${this.handleFocus}" @blur="${this.handleBlur}" @click="${l?a=>{this.previous(),this.unblockAutoplay(a,this.previousButton)}:null}"><slot name="previous-icon"><sd-6-4-0-icon class="${n("h-6 w-6 rotate-90 grid place-items-center")}" library="_internal" name="${c?"chevron-down":"chevron-up"}"></sd-6-4-0-icon></slot></button> ${this.variant==="dot"?b`<div part="pagination-dot" role="tablist" class="${n("carousel__pagination dot flex wrap items-center gap-2")}" aria-controls="scroll-container">${L(B(t),a=>{let g=a+1===s;return b`<button part="pagination-item ${g?"pagination-item--active":""}" class="${n("carousel__pagination-item","block cursor-pointer bg-none border-0 rounded-full",g?"bg-accent":"",this.inverted?"focus-within:focus-outline-inverted":"focus-within:focus-outline")}" role="tab" tabindex="0" aria-selected="${g?"true":"false"}" aria-label="${this.localize.term("goToSlide",a+1,t)}" @click="${y=>{this.goToSlide(a*i),this.unblockAutoplay(y,this.paginationItems[a])}}" @keydown="${this.handleKeyDown}"><span class="${n("h-4 w-4 block border sd-6-4-0-carousel__pager-dot-border-width rounded-full transition-colors duration-slow hover:duration-fast ease-in-out",this.inverted?"sd-6-4-0-carousel__pager-dot--inverted-border hover:border-primary-200":"border-primary hover:border-primary-500",g&&"border-none",g?this.inverted?"sd-6-4-0-carousel__pager-dot--inverted-background hover:sd-6-4-0-carousel__pager-dot--inverted--hovered-background":"sd-6-4-0-carousel__pager-dot-background hover:bg-accent-550":"")}"></span></button>`})}</div>`:b`<span part="pagination-number" class="carousel__pagination number flex gap-0.5 cursor-default select-none" aria-controls="scroll-container"><span part="pagination-item" class="${n("w-5 text-center border-b-2",this.inverted?"text-white sd-6-4-0-carousel--active--inverted-color-border":"text-black sd-6-4-0-carousel--active-color-border")}">${s}</span> <span part="pagination-divider" class="${n("scale-y-[1.5]","text-center",this.inverted?"text-white":"text-black")}">/</span> <span part="pagination-item" class="${n("w-5 text-center",this.inverted?"text-white":"text-black")}">${t}</span></span>`} <button part="navigation-button navigation-button--next" id="carousel__navigation-button--next" ?disabled="${!h}" class="${n("!ml-6 !rounded-sm sd-interactive transition-colors duration-fast ease-in-out",!h&&"sd-interactive--disabled",this.inverted?"sd-interactive--inverted":"sd-interactive--reset")}" aria-label="${this.localize.term("nextSlide")}" aria-controls="scroll-container" aria-disabled="${h?"false":"true"}" @focus="${this.handleFocus}" @blur="${this.handleBlur}" @click="${h?a=>{this.next(),this.unblockAutoplay(a,this.nextButton)}:null}"><slot name="next-icon"><sd-6-4-0-icon class="${n("h-6 w-6 rotate-90 grid place-items-center")}" library="_internal" name="${c?"chevron-up":"chevron-down"}"></sd-6-4-0-icon></slot></button></div><button class="${n("ml-6 !rounded-sm","!absolute !right-0 sd-interactive",this.inverted?"sd-interactive--inverted":"sd-interactive--reset",!this.autoplay&&"!hidden")}" part="autoplay-controls" aria-label="${this.localize.term("autoplay")}" aria-pressed="true" @click="${a=>{this.pausedAutoplay=!this.pausedAutoplay,a.detail&&this.autoplayControls.blur()}}"><slot name="autoplay-start" class="${n(this.pausedAutoplay?"":"hidden")}"><sd-6-4-0-icon class="h-6 w-6 grid place-items-center" library="_internal" name="start"></sd-6-4-0-icon></slot><slot name="autoplay-pause" class="${n(this.pausedAutoplay?"hidden":"")}"><sd-6-4-0-icon class="h-6 w-6 grid place-items-center" library="_internal" name="pause"></sd-6-4-0-icon></slot></button></div></div>`}};r.styles=[...w.styles,P`/*! tailwindcss v4.1.17 | MIT License | https://tailwindcss.com */@layer theme,base,components,utilities;
|
|
2
|
-
:host{--slide-gap:var(--sl-spacing-medium, 1rem);--scroll-hint:0px;display:flex}.carousel{grid-template-areas:'. slides .' '. pagination .'}.carousel__pagination{grid-area:pagination}.carousel__slides{grid-area:slides;scrollbar-width:none;--slide-size:calc((100% - (var(--slides-per-page) - 1) * var(--slide-gap)) / var(--slides-per-page));grid-auto-columns:var(--slide-size);-moz-column-gap:var(--slide-gap);column-gap:var(--slide-gap);scroll-padding-inline:var(--scroll-hint);padding-inline:var(--scroll-hint)}.carousel__slides::-webkit-scrollbar{display:none}:host([fade]){--carousel-height:auto}:host([fade]) .carousel__slides{position:relative;display:block;overflow:hidden;height:var(--carousel-height)}@media (prefers-reduced-motion){:where(.carousel__slides){scroll-behavior:auto}}.carousel__navigation{grid-area:navigation}sd-6-4-
|
|
1
|
+
import{a as C}from"./chunk.BJBQEPZV.js";import{a as k}from"./chunk.EOXYPQZI.js";import{a as T}from"./chunk.GP2QVZP5.js";import{a as M}from"./chunk.CBQWVOOS.js";import{a as A}from"./chunk.IQPMMUES.js";import{a as n}from"./chunk.YFQFOIEM.js";import{a as v}from"./chunk.NYKJXI3Q.js";import{a as _,b as p,c as m,d as f,e as E,h as w}from"./chunk.ALCKOGA7.js";import{b as P,e as b}from"./chunk.763RLJEK.js";import{d as $}from"./chunk.W4QBFD6E.js";import{e as o}from"./chunk.6EV4YU6C.js";function I(u,d,e){let i=t=>Object.is(t,-0)?0:t;return u<d?i(d):u>e?i(e):i(u)}function*L(u,d){if(u!==void 0){let e=0;for(let i of u)yield d(i,e++)}}function*B(u,d,e=1){let i=d===void 0?0:u;d!=null||(d=u);for(let t=i;e>0?t<d:d<t;t+=e)yield t}var r=class extends w{constructor(){super(...arguments);this.variant="number";this.inverted=!1;this.loop=!1;this.autoplay=!1;this.fade=!1;this.slidesPerPage=1;this.slidesPerMove=1;this.activeSlide=0;this.currentPage=1;this.pausedAutoplay=!1;this.autoplayController=new M(this,()=>this.next());this.scrollController=new k(this);this.slides=this.getElementsByTagName("sd-6-4-2-carousel-item");this.intersectionObserverEntries=new Map;this.localize=new A(this);this.userInteracted=!1;this.fadeController=new C(this);this.handleUserInteraction=()=>{this.userInteracted=!0};this.handleSlotChange=e=>{e.some(t=>[...t.addedNodes,...t.removedNodes].some(s=>T.isCarouselItem(s)&&!s.hasAttribute("data-clone")))&&this.initializeSlides(),this.requestUpdate()};this.unblockAutoplay=(e,i)=>{e.detail&&i.blur()}}connectedCallback(){super.connectedCallback(),["click","keydown"].forEach(i=>this.addEventListener(i,this.handleUserInteraction));let e=new IntersectionObserver(i=>{i.forEach(t=>{this.intersectionObserverEntries.set(t.target,t);let s=t.target;s.toggleAttribute("inert",!t.isIntersecting),s.classList.toggle("--in-view",t.isIntersecting),s.setAttribute("aria-hidden",t.isIntersecting?"false":"true")})},{root:this,threshold:.6});this.intersectionObserver=e,e.takeRecords().forEach(i=>{this.intersectionObserverEntries.set(i.target,i)})}disconnectedCallback(){super.disconnectedCallback(),this.intersectionObserver.disconnect(),this.mutationObserver.disconnect(),["click","keydown"].forEach(e=>this.removeEventListener(e,this.handleUserInteraction)),this.fade&&this.fadeController.disable()}async firstUpdated(){if((()=>{let i=this.getSlides({excludeClones:!1});return i.length>0&&i[0].getBoundingClientRect().width>0})())this.initializeSlides();else{let i=new IntersectionObserver(t=>{t.forEach(s=>{s.isIntersecting&&s.target.getBoundingClientRect().width>0&&(this.initializeSlides(),i.disconnect())})});i.observe(this)}this.mutationObserver=new MutationObserver(this.handleSlotChange),this.mutationObserver.observe(this,{childList:!0,subtree:!1}),this.fade&&(await this.updateComplete,this.fadeController.enable())}getPageCount(e,i,t){return Math.ceil((e-i)/t)+1>0?Math.ceil((e-i)/t)+1:1}getCurrentPage(e,i,t,s){return Math.ceil((e-t)/s)-Math.ceil((e-t-i)/s)+1}getSlides({excludeClones:e=!0}={}){return[...this.slides].filter(i=>!e||!i.hasAttribute("data-clone"))}handleKeyDown(e){if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(e.key)){let i=e.target,t=this.localize.dir()==="rtl",s=i.closest('[part~="pagination-item"]')!==null,l=e.key==="ArrowDown"||!t&&e.key==="ArrowRight"||t&&e.key==="ArrowLeft",h=e.key==="ArrowUp"||!t&&e.key==="ArrowLeft"||t&&e.key==="ArrowRight";e.preventDefault(),h&&this.previous(),l&&this.next(),e.key==="Home"&&this.goToSlide(0),e.key==="End"&&this.goToSlide(this.getSlides().length-1),s&&this.updateComplete.then(()=>{var a;let c=(a=this.shadowRoot)==null?void 0:a.querySelector('[part~="pagination-item--active"]');c&&c.focus()})}}handleScrollEnd(){if(this.fade)return;let e=this.getSlides(),t=[...this.intersectionObserverEntries.values()].find(s=>s.isIntersecting);if(this.loop&&(t!=null&&t.target.hasAttribute("data-clone"))){let s=Number(t.target.getAttribute("data-clone"));this.goToSlide(s,"auto");return}t&&(this.activeSlide=e.indexOf(t.target))}handleFocus(){this.autoplay&&this.scrollContainer.setAttribute("aria-live","polite")}handleBlur(){this.autoplay&&this.scrollContainer.setAttribute("aria-live","off")}pause(){this.pausedAutoplay=!0}resume(){this.pausedAutoplay=!1}handlePausedAutoplay(){var e,i;this.pausedAutoplay?(this.autoplayController.stop(),(e=this.autoplayControls)==null||e.setAttribute("aria-pressed","false")):this.autoplay&&(this.autoplayController.start(3e3),(i=this.autoplayControls)==null||i.setAttribute("aria-pressed","true"))}handleFadeChange(){this.fade?this.fadeController.enable():this.fadeController.disable()}initializeSlides(){let e=this.getSlides(),i=this.intersectionObserver;if(this.intersectionObserverEntries.clear(),this.getSlides({excludeClones:!1}).forEach((t,s)=>{i.unobserve(t),t.classList.remove("--in-view"),t.classList.remove("--is-active"),t.setAttribute("aria-label",this.localize.term("slideNum",s+1,e.length)),t.hasAttribute("data-clone")&&t.remove()}),this.loop&&!this.fade){let t=this.slidesPerPage,s=e.slice(-t),l=e.slice(0,t);s.reverse().forEach((h,c)=>{let a=h.cloneNode(!0);a.setAttribute("data-clone",String(e.length-c-1)),this.prepend(a)}),l.forEach((h,c)=>{let a=h.cloneNode(!0);a.setAttribute("data-clone",String(c)),this.append(a)})}this.getSlides({excludeClones:!1}).forEach(t=>{i.observe(t)}),this.fade&&this.updateComplete.then(()=>{this.fadeController.enable()}),this.fade||this.goToSlide(this.activeSlide,"auto")}handleSlideChange(){let e=this.getSlides();e.forEach((s,l)=>{s.classList.toggle("--is-active",l===this.activeSlide)}),this.fade&&this.fadeController.updateActiveSlide(this.activeSlide);let i=this.getCurrentPage(e.length,this.activeSlide,this.slidesPerPage,this.slidesPerMove);this.currentPage!==i&&(this.currentPage=i),this.hasUpdated&&this.emit("sd-slide-change",{detail:{index:this.activeSlide,slide:e[this.activeSlide]}});let t=this.getPageCount(e.length,this.slidesPerPage,this.slidesPerMove);this.currentPage>t&&requestAnimationFrame(()=>{this.nextTillFirst()})}handleSlidesPerMoveChange(){if(this.fade)return;let e=this.getSlides({excludeClones:!1}),i=this.slidesPerMove;e.forEach((t,s)=>{Math.abs(s-i)%i===0?t.style.removeProperty("scroll-snap-align"):t.style.setProperty("scroll-snap-align","none")})}handleAutoplayChange(){this.autoplayController.stop(),this.autoplay&&!this.pausedAutoplay&&this.autoplayController.start(3e3)}previous(e="smooth"){if(this.fade){let s=this.loop?(this.activeSlide-1+this.getSlides().length)%this.getSlides().length:Math.max(0,this.activeSlide-1);this.goToSlide(s);return}let i=this.activeSlide||this.activeSlide-this.slidesPerMove,t=!1;for(;!t&&i>0;)i-=1,t=Math.abs(i-this.slidesPerMove)%this.slidesPerMove===0;this.currentPage-1===0&&this.loop?this.goToSlide(this.activeSlide-this.slidesPerPage,e):this.goToSlide(i,e)}next(e="smooth"){if(this.fade){let i=this.loop?(this.activeSlide+1)%this.getSlides().length:Math.min(this.getSlides().length-1,this.activeSlide+1);this.goToSlide(i);return}this.currentPage+1<=this.getPageCount(this.getSlides().length,this.slidesPerPage,this.slidesPerMove)?this.goToSlide(this.activeSlide+this.slidesPerMove,e):this.loop&&this.nextTillFirst(e)}nextTillFirst(e="smooth"){if(this.fade){this.goToSlide(0);return}for(;this.activeSlide!==0;)this.goToSlide(this.activeSlide+1,e);this.currentPage=this.getCurrentPage(this.getSlides().length,this.activeSlide,this.slidesPerPage,this.slidesPerMove)}goToSlide(e,i="smooth"){let{slidesPerPage:t,loop:s,scrollContainer:l,fade:h}=this,c=this.getSlides(),a=this.getSlides({excludeClones:!1}),g=(e+c.length)%c.length;if(this.activeSlide=g,h)return;let y=I(e+(s?t:0),0,a.length+1),O=a[y],S=l.getBoundingClientRect(),x=O.getBoundingClientRect();if(l.scrollTo({left:x.left-S.left+l.scrollLeft,top:x.top-S.top+l.scrollTop,behavior:$()?"auto":i}),this.userInteracted&&!this.loop){let z=this.activeSlide===c.length-1||this.activeSlide===this.slides.length-this.slidesPerPage,H=this.activeSlide===0;z?this.previousButton.focus({preventScroll:!0}):H&&this.nextButton.focus({preventScroll:!0})}}render(){let{scrollController:e,slidesPerMove:i}=this,t=this.getPageCount(this.getSlides().length,this.slidesPerPage,this.slidesPerMove),s=this.getCurrentPage(this.getSlides().length,this.activeSlide,this.slidesPerPage,this.slidesPerMove),l=this.loop||s>1,h=this.loop||s<t,c=this.localize.dir()==="ltr";return b`<div part="base" class="${n("carousel h-full w-full")}"><div id="scroll-container" part="scroll-container" class="${n("carousel__slides mb-6 max-h-full w-full items-center justify-items-center",this.inverted?"focus-visible:focus-outline-inverted":"focus-visible:focus-outline",this.fade?"relative overflow-hidden":"grid overflow-auto overscroll-x-contain grid-flow-col auto-rows-[100%] snap-x snap-mandatory overflow-y-hidden")}" style="--slides-per-page:${this.slidesPerPage}" aria-busy="${e.scrolling?"true":"false"}" aria-label="${this.localize.term("carouselContainer",Array.from(this.slides).filter(a=>!a.hasAttribute("data-clone")).length)}" aria-live="${this.autoplay?"off":"polite"}" tabindex="0" @keydown="${this.handleKeyDown}" @scrollend="${this.handleScrollEnd}" @focus="${this.handleFocus}" @blur="${this.handleBlur}"><slot></slot></div><div part="controls" class="${n("w-full flex items-center justify-center relative")}"><div part="navigation" class="${n("carousel__navigation flex items-center justify-center")}"><button part="navigation-button navigation-button--previous" id="carousel__navigation-button--previous" ?disabled="${!l}" class="${n("!mr-6 !rounded-sm sd-interactive transition-colors duration-fast ease-in-out",!l&&"sd-interactive--disabled",this.inverted?"sd-interactive--inverted":"sd-interactive--reset")}" aria-label="${this.localize.term("previousSlide")}" aria-controls="scroll-container" aria-disabled="${l?"false":"true"}" @focus="${this.handleFocus}" @blur="${this.handleBlur}" @click="${l?a=>{this.previous(),this.unblockAutoplay(a,this.previousButton)}:null}"><slot name="previous-icon"><sd-6-4-2-icon class="${n("h-6 w-6 rotate-90 grid place-items-center")}" library="_internal" name="${c?"chevron-down":"chevron-up"}"></sd-6-4-2-icon></slot></button> ${this.variant==="dot"?b`<div part="pagination-dot" role="tablist" class="${n("carousel__pagination dot flex wrap items-center gap-2")}" aria-controls="scroll-container">${L(B(t),a=>{let g=a+1===s;return b`<button part="pagination-item ${g?"pagination-item--active":""}" class="${n("carousel__pagination-item","block cursor-pointer bg-none border-0 rounded-full",g?"bg-accent":"",this.inverted?"focus-within:focus-outline-inverted":"focus-within:focus-outline")}" role="tab" tabindex="0" aria-selected="${g?"true":"false"}" aria-label="${this.localize.term("goToSlide",a+1,t)}" @click="${y=>{this.goToSlide(a*i),this.unblockAutoplay(y,this.paginationItems[a])}}" @keydown="${this.handleKeyDown}"><span class="${n("h-4 w-4 block border sd-6-4-2-carousel__pager-dot-border-width rounded-full transition-colors duration-slow hover:duration-fast ease-in-out",this.inverted?"sd-6-4-2-carousel__pager-dot--inverted-border hover:border-primary-200":"border-primary hover:border-primary-500",g&&"border-none",g?this.inverted?"sd-6-4-2-carousel__pager-dot--inverted-background hover:sd-6-4-2-carousel__pager-dot--inverted--hovered-background":"sd-6-4-2-carousel__pager-dot-background hover:bg-accent-550":"")}"></span></button>`})}</div>`:b`<span part="pagination-number" class="carousel__pagination number flex gap-0.5 cursor-default select-none" aria-controls="scroll-container"><span part="pagination-item" class="${n("w-5 text-center border-b-2",this.inverted?"text-white sd-6-4-2-carousel--active--inverted-color-border":"text-black sd-6-4-2-carousel--active-color-border")}">${s}</span> <span part="pagination-divider" class="${n("scale-y-[1.5]","text-center",this.inverted?"text-white":"text-black")}">/</span> <span part="pagination-item" class="${n("w-5 text-center",this.inverted?"text-white":"text-black")}">${t}</span></span>`} <button part="navigation-button navigation-button--next" id="carousel__navigation-button--next" ?disabled="${!h}" class="${n("!ml-6 !rounded-sm sd-interactive transition-colors duration-fast ease-in-out",!h&&"sd-interactive--disabled",this.inverted?"sd-interactive--inverted":"sd-interactive--reset")}" aria-label="${this.localize.term("nextSlide")}" aria-controls="scroll-container" aria-disabled="${h?"false":"true"}" @focus="${this.handleFocus}" @blur="${this.handleBlur}" @click="${h?a=>{this.next(),this.unblockAutoplay(a,this.nextButton)}:null}"><slot name="next-icon"><sd-6-4-2-icon class="${n("h-6 w-6 rotate-90 grid place-items-center")}" library="_internal" name="${c?"chevron-up":"chevron-down"}"></sd-6-4-2-icon></slot></button></div><button class="${n("ml-6 !rounded-sm","!absolute !right-0 sd-interactive",this.inverted?"sd-interactive--inverted":"sd-interactive--reset",!this.autoplay&&"!hidden")}" part="autoplay-controls" aria-label="${this.localize.term("autoplay")}" aria-pressed="true" @click="${a=>{this.pausedAutoplay=!this.pausedAutoplay,a.detail&&this.autoplayControls.blur()}}"><slot name="autoplay-start" class="${n(this.pausedAutoplay?"":"hidden")}"><sd-6-4-2-icon class="h-6 w-6 grid place-items-center" library="_internal" name="start"></sd-6-4-2-icon></slot><slot name="autoplay-pause" class="${n(this.pausedAutoplay?"hidden":"")}"><sd-6-4-2-icon class="h-6 w-6 grid place-items-center" library="_internal" name="pause"></sd-6-4-2-icon></slot></button></div></div>`}};r.styles=[...w.styles,P`/*! tailwindcss v4.1.17 | MIT License | https://tailwindcss.com */@layer theme,base,components,utilities;
|
|
2
|
+
:host{--slide-gap:var(--sl-spacing-medium, 1rem);--scroll-hint:0px;display:flex}.carousel{grid-template-areas:'. slides .' '. pagination .'}.carousel__pagination{grid-area:pagination}.carousel__slides{grid-area:slides;scrollbar-width:none;--slide-size:calc((100% - (var(--slides-per-page) - 1) * var(--slide-gap)) / var(--slides-per-page));grid-auto-columns:var(--slide-size);-moz-column-gap:var(--slide-gap);column-gap:var(--slide-gap);scroll-padding-inline:var(--scroll-hint);padding-inline:var(--scroll-hint)}.carousel__slides::-webkit-scrollbar{display:none}:host([fade]){--carousel-height:auto}:host([fade]) .carousel__slides{position:relative;display:block;overflow:hidden;height:var(--carousel-height)}@media (prefers-reduced-motion){:where(.carousel__slides){scroll-behavior:auto}}.carousel__navigation{grid-area:navigation}sd-6-4-2-button::part(label){pointer-events:none;display:flex;flex:auto;align-items:center}#carousel__navigation-button--next,#carousel__navigation-button--previous{color:rgba(var(--sd-color-icon-fill-primary))}#carousel__navigation-button--next:disabled,#carousel__navigation-button--previous:disabled{color:rgba(var(--sd-color-icon-fill-neutral-500))}:host([inverted]) #carousel__navigation-button--next,:host([inverted]) #carousel__navigation-button--previous{color:rgba(var(--sd-color-icon-fill-white))}:host([inverted]) #carousel__navigation-button--next:disabled,:host([inverted]) #carousel__navigation-button--previous:disabled{color:rgba(var(--sd-color-icon-fill-neutral-600))}`],o([f('[part~="autoplay-controls"]')],r.prototype,"autoplayControls",2),o([f('[part~="navigation-button--previous"]')],r.prototype,"previousButton",2),o([f('[part~="navigation-button--next"]')],r.prototype,"nextButton",2),o([E('[part~="pagination-item"]')],r.prototype,"paginationItems",2),o([p({type:String,reflect:!0})],r.prototype,"variant",2),o([p({type:Boolean,reflect:!0})],r.prototype,"inverted",2),o([p({type:Boolean,reflect:!0})],r.prototype,"loop",2),o([p({type:Boolean,reflect:!0})],r.prototype,"autoplay",2),o([p({type:Boolean,reflect:!0})],r.prototype,"fade",2),o([p({type:Number,attribute:"slides-per-page",reflect:!0})],r.prototype,"slidesPerPage",2),o([p({type:Number,attribute:"slides-per-move",reflect:!0})],r.prototype,"slidesPerMove",2),o([f("slot:not([name])")],r.prototype,"defaultSlot",2),o([f(".carousel__slides")],r.prototype,"scrollContainer",2),o([f(".carousel__pagination")],r.prototype,"paginationContainer",2),o([m()],r.prototype,"activeSlide",2),o([m()],r.prototype,"currentPage",2),o([m()],r.prototype,"pausedAutoplay",2),o([v("pausedAutoplay")],r.prototype,"handlePausedAutoplay",1),o([v("fade",{waitUntilFirstUpdate:!0})],r.prototype,"handleFadeChange",1),o([v("loop",{waitUntilFirstUpdate:!0}),v("slidesPerPage",{waitUntilFirstUpdate:!0})],r.prototype,"initializeSlides",1),o([v("activeSlide")],r.prototype,"handleSlideChange",1),o([v("slidesPerMove")],r.prototype,"handleSlidesPerMoveChange",1),o([v("autoplay")],r.prototype,"handleAutoplayChange",1),r=o([_("sd-6-4-2-carousel")],r);export{r as a};
|
|
3
3
|
/*! Bundled license information:
|
|
4
4
|
|
|
5
5
|
lit-html/directives/map.js:
|
|
@@ -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.ALCKOGA7.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-4-
|
|
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-4-
|
|
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-4-2-switch--checked--hover-color-background bg-accent hover:border-accent-550 group-hover:sd-6-4-2-switch--checked--hover-color-background":"sd-6-4-2-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-4-2-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-4-2-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-4-2-icon part="invalid-icon" class="${l("text-error")}" library="_internal" name="risk"></sd-6-4-2-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-4-2-switch")],e);export{e as a};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as f}from"./chunk.PV6UYBMY.js";import{a as h}from"./chunk.IQPMMUES.js";import{a as p}from"./chunk.NYKJXI3Q.js";import{a as o,b as r,d as c,h as i}from"./chunk.ALCKOGA7.js";import{b as l,e as a}from"./chunk.763RLJEK.js";import{e}from"./chunk.6EV4YU6C.js";var t=class extends i{constructor(){super(...arguments);this.localize=new h(this);this.href="";this.current=!1}handleCurrentChange(){var s,n;!this.base||!this.current||(n=(s=this.base.shadowRoot)==null?void 0:s.querySelector("a"))==null||n.setAttribute("aria-current","page")}connectedCallback(){this.hasAttribute("role")||this.setAttribute("role","listitem"),super.connectedCallback()}firstUpdated(){requestAnimationFrame(()=>this.handleCurrentChange())}render(){return a`<sd-6-4-
|
|
2
|
-
:host{display:inline-flex;align-items:center}sd-6-4-
|
|
1
|
+
import{a as f}from"./chunk.PV6UYBMY.js";import{a as h}from"./chunk.IQPMMUES.js";import{a as p}from"./chunk.NYKJXI3Q.js";import{a as o,b as r,d as c,h as i}from"./chunk.ALCKOGA7.js";import{b as l,e as a}from"./chunk.763RLJEK.js";import{e}from"./chunk.6EV4YU6C.js";var t=class extends i{constructor(){super(...arguments);this.localize=new h(this);this.href="";this.current=!1}handleCurrentChange(){var s,n;!this.base||!this.current||(n=(s=this.base.shadowRoot)==null?void 0:s.querySelector("a"))==null||n.setAttribute("aria-current","page")}connectedCallback(){this.hasAttribute("role")||this.setAttribute("role","listitem"),super.connectedCallback()}firstUpdated(){requestAnimationFrame(()=>this.handleCurrentChange())}render(){return a`<sd-6-4-2-link part="base" href="${f(this.current?void 0:this.href)}" target="${this.target}" standalone class="text-nowrap"><slot></slot></sd-6-4-2-link>`}};t.styles=[...i.styles,l`/*! tailwindcss v4.1.17 | MIT License | https://tailwindcss.com */@layer theme,base,components,utilities;
|
|
2
|
+
:host{display:inline-flex;align-items:center}sd-6-4-2-link::part(base){align-items:center}sd-6-4-2-link::part(icon-left){margin-right:calc(var(--sd-spacing-1) * 0);display:inline-flex}:host([current]) sd-6-4-2-link::part(base){color:rgba(var(--sd-color-text-neutral-700))}:host([current]) sd-6-4-2-link::part(label){text-decoration-line:none}`],e([c('[part="base"]')],t.prototype,"base",2),e([r({type:String,reflect:!0})],t.prototype,"href",2),e([r({type:String,reflect:!0})],t.prototype,"target",2),e([r({type:Boolean,reflect:!0})],t.prototype,"current",2),e([p("current")],t.prototype,"handleCurrentChange",1),t=e([o("sd-6-4-2-breadcrumb-item")],t);export{t as a};
|