@solid-design-system/components 5.1.0 → 5.2.0
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.BV574DRQ.js +1 -0
- package/cdn/components/scrollable/scrollable.js +1 -1
- package/cdn/custom-elements.json +1 -1
- package/cdn/solid-components.bundle.js +1 -1
- package/cdn/solid-components.iife.js +1 -1
- package/cdn/solid-components.js +1 -1
- package/cdn/web-types.json +1 -1
- package/cdn-versioned/_components/menu/menu.js +1 -1
- package/cdn-versioned/_components/menu/menu.styles.js +1 -1
- package/cdn-versioned/_components/menu-item/menu-item.js +2 -2
- package/cdn-versioned/chunks/chunk.2SOEBGDS.js +1 -1
- package/cdn-versioned/chunks/chunk.3AEOVI4V.js +1 -1
- package/cdn-versioned/chunks/chunk.4336N4TN.js +4 -4
- package/cdn-versioned/chunks/chunk.466HB7MH.js +1 -1
- package/cdn-versioned/chunks/chunk.54XQKZNU.js +1 -1
- package/cdn-versioned/chunks/chunk.5I76HTXX.js +1 -1
- package/cdn-versioned/chunks/chunk.5SNCMR36.js +1 -1
- package/cdn-versioned/chunks/chunk.6HLS5XU2.js +1 -1
- package/cdn-versioned/chunks/chunk.6OJK4N6O.js +1 -1
- package/cdn-versioned/chunks/chunk.7LHKLE4G.js +1 -1
- package/cdn-versioned/chunks/chunk.7RCSPRWP.js +1 -1
- package/cdn-versioned/chunks/chunk.7SJEXZSM.js +1 -1
- package/cdn-versioned/chunks/chunk.AFKPYWS5.js +4 -4
- package/cdn-versioned/chunks/chunk.AMKBNS7H.js +1 -1
- package/cdn-versioned/chunks/chunk.BV574DRQ.js +1 -0
- package/cdn-versioned/chunks/chunk.CEVVDV52.js +1 -1
- package/cdn-versioned/chunks/chunk.EVLY2HWM.js +1 -1
- package/cdn-versioned/chunks/chunk.FY4ZQ25C.js +1 -1
- package/cdn-versioned/chunks/chunk.HAYM6MTB.js +1 -1
- package/cdn-versioned/chunks/chunk.I4VI7CRD.js +1 -1
- package/cdn-versioned/chunks/chunk.IDX4RDHZ.js +1 -1
- package/cdn-versioned/chunks/chunk.KINWB3R6.js +1 -1
- package/cdn-versioned/chunks/chunk.KYWP646O.js +1 -1
- package/cdn-versioned/chunks/chunk.LQ5Q73YJ.js +1 -1
- package/cdn-versioned/chunks/chunk.LRTBIARY.js +1 -1
- package/cdn-versioned/chunks/chunk.M43SHSJ7.js +3 -3
- package/cdn-versioned/chunks/chunk.MFSX5MIZ.js +1 -1
- package/cdn-versioned/chunks/chunk.MHPWICL2.js +1 -1
- package/cdn-versioned/chunks/chunk.MNEGNJBN.js +2 -2
- package/cdn-versioned/chunks/chunk.OOE73LIA.js +1 -1
- package/cdn-versioned/chunks/chunk.ORM6LFSP.js +1 -1
- package/cdn-versioned/chunks/chunk.PIYHBRRO.js +1 -1
- package/cdn-versioned/chunks/chunk.PKL7HSML.js +1 -1
- package/cdn-versioned/chunks/chunk.PM4HPYFT.js +2 -2
- package/cdn-versioned/chunks/chunk.QCGZSSDL.js +1 -1
- package/cdn-versioned/chunks/chunk.QDPTVUAW.js +1 -1
- package/cdn-versioned/chunks/chunk.QHURAHWP.js +1 -1
- package/cdn-versioned/chunks/chunk.RYR5JMPR.js +1 -1
- package/cdn-versioned/chunks/chunk.T25YQB27.js +1 -1
- package/cdn-versioned/chunks/chunk.TUVJON3T.js +1 -1
- package/cdn-versioned/chunks/chunk.UUQIXQII.js +1 -1
- package/cdn-versioned/chunks/chunk.VYFYAVQV.js +1 -1
- package/cdn-versioned/chunks/chunk.W7A3TU2Z.js +1 -1
- package/cdn-versioned/chunks/chunk.WHJMIN4O.js +1 -1
- package/cdn-versioned/chunks/chunk.XLPONTTF.js +1 -1
- package/cdn-versioned/chunks/chunk.Y63VGL2X.js +1 -1
- package/cdn-versioned/chunks/chunk.YBDULCI5.js +1 -1
- package/cdn-versioned/chunks/chunk.Z7R4W5J7.js +1 -1
- package/cdn-versioned/chunks/chunk.ZGWHWNN7.js +1 -1
- package/cdn-versioned/chunks/chunk.ZHIT75AP.js +1 -1
- package/cdn-versioned/chunks/chunk.ZIXORQQN.js +1 -1
- package/cdn-versioned/chunks/chunk.ZUSDFNOR.js +1 -1
- package/cdn-versioned/chunks/chunk.ZWRWVYOC.js +1 -1
- package/cdn-versioned/components/accordion/accordion.d.ts +1 -1
- package/cdn-versioned/components/accordion-group/accordion-group.d.ts +1 -1
- package/cdn-versioned/components/animation/animation.d.ts +1 -1
- package/cdn-versioned/components/audio/audio.d.ts +1 -1
- package/cdn-versioned/components/badge/badge.d.ts +1 -1
- package/cdn-versioned/components/brandshape/brandshape.d.ts +1 -1
- package/cdn-versioned/components/button/button.d.ts +1 -1
- package/cdn-versioned/components/button-group/button-group.d.ts +1 -1
- package/cdn-versioned/components/carousel/carousel.d.ts +1 -1
- package/cdn-versioned/components/carousel-item/carousel-item.d.ts +1 -1
- package/cdn-versioned/components/checkbox/checkbox.d.ts +1 -1
- package/cdn-versioned/components/checkbox-group/checkbox-group.d.ts +1 -1
- package/cdn-versioned/components/combobox/combobox.d.ts +1 -1
- package/cdn-versioned/components/dialog/dialog.d.ts +1 -1
- package/cdn-versioned/components/divider/divider.d.ts +1 -1
- package/cdn-versioned/components/drawer/drawer.d.ts +1 -1
- package/cdn-versioned/components/dropdown/dropdown.d.ts +1 -1
- package/cdn-versioned/components/expandable/expandable.d.ts +1 -1
- package/cdn-versioned/components/flipcard/flipcard.d.ts +1 -1
- package/cdn-versioned/components/header/header.d.ts +1 -1
- package/cdn-versioned/components/icon/icon.d.ts +1 -1
- package/cdn-versioned/components/include/include.d.ts +1 -1
- package/cdn-versioned/components/input/input.d.ts +1 -1
- package/cdn-versioned/components/link/link.d.ts +1 -1
- package/cdn-versioned/components/map-marker/map-marker.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 +2 -2
- 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 +2 -2
- package/cdn-versioned/components/scrollable/scrollable.d.ts +1 -1
- package/cdn-versioned/components/scrollable/scrollable.js +1 -1
- package/cdn-versioned/components/select/select.d.ts +1 -1
- package/cdn-versioned/components/spinner/spinner.d.ts +1 -1
- package/cdn-versioned/components/step/step.d.ts +1 -1
- package/cdn-versioned/components/step-group/step-group.d.ts +1 -1
- package/cdn-versioned/components/switch/switch.d.ts +1 -1
- package/cdn-versioned/components/tab/tab.d.ts +1 -1
- package/cdn-versioned/components/tab-group/tab-group.d.ts +1 -1
- package/cdn-versioned/components/tab-panel/tab-panel.d.ts +1 -1
- package/cdn-versioned/components/tag/tag.d.ts +1 -1
- package/cdn-versioned/components/textarea/textarea.d.ts +1 -1
- package/cdn-versioned/components/tooltip/tooltip.d.ts +1 -1
- package/cdn-versioned/components/video/video.d.ts +1 -1
- package/cdn-versioned/custom-elements.json +211 -211
- package/cdn-versioned/internal/form.js +3 -3
- package/cdn-versioned/solid-components.bundle.js +17 -17
- package/cdn-versioned/solid-components.css +2 -2
- package/cdn-versioned/solid-components.iife.js +17 -17
- package/cdn-versioned/solid-components.js +1 -1
- package/cdn-versioned/vscode.html-custom-data.json +80 -80
- package/cdn-versioned/web-types.json +137 -137
- package/dist/chunks/{chunk.JK7S3JAQ.js → chunk.HPEQN7OA.js} +22 -6
- package/dist/components/scrollable/scrollable.js +1 -1
- package/dist/custom-elements.json +1 -1
- package/dist/solid-components.js +1 -1
- package/dist/web-types.json +1 -1
- package/dist-versioned/_components/menu/menu.js +1 -1
- package/dist-versioned/_components/menu/menu.styles.js +1 -1
- package/dist-versioned/_components/menu-item/menu-item.js +2 -2
- package/dist-versioned/chunks/chunk.25JYDDEL.js +2 -2
- package/dist-versioned/chunks/chunk.2KW3OQK3.js +1 -1
- package/dist-versioned/chunks/chunk.2XYOJHUN.js +2 -2
- package/dist-versioned/chunks/chunk.4JIUFSXL.js +1 -1
- package/dist-versioned/chunks/chunk.4X5KLZKG.js +2 -2
- package/dist-versioned/chunks/chunk.57IRQB22.js +5 -5
- package/dist-versioned/chunks/chunk.5E7OOWFM.js +2 -2
- package/dist-versioned/chunks/chunk.5HB4AZFH.js +11 -11
- package/dist-versioned/chunks/chunk.67HGWRDC.js +3 -3
- package/dist-versioned/chunks/chunk.6BPYGYKJ.js +1 -1
- package/dist-versioned/chunks/chunk.6DKXZWRN.js +4 -4
- package/dist-versioned/chunks/chunk.6MIVTHPW.js +26 -26
- package/dist-versioned/chunks/chunk.7A77E2WF.js +3 -3
- package/dist-versioned/chunks/chunk.AD7FTSCZ.js +2 -2
- package/dist-versioned/chunks/chunk.ASKGMA6Q.js +1 -1
- package/dist-versioned/chunks/chunk.CY7STHBY.js +5 -5
- package/dist-versioned/chunks/chunk.DFQ36XHY.js +2 -2
- package/dist-versioned/chunks/chunk.DPVQIW2K.js +5 -5
- package/dist-versioned/chunks/chunk.EH5YMA4E.js +5 -5
- package/dist-versioned/chunks/chunk.EOLWJNLD.js +3 -3
- package/dist-versioned/chunks/chunk.EQXVKF2G.js +2 -2
- package/dist-versioned/chunks/chunk.FA2PSB3G.js +6 -6
- package/dist-versioned/chunks/chunk.FZYBHAXZ.js +14 -14
- package/dist-versioned/chunks/chunk.GCBWRTSA.js +4 -4
- package/dist-versioned/chunks/chunk.GIDPKVNI.js +1 -1
- package/dist-versioned/chunks/{chunk.JK7S3JAQ.js → chunk.HPEQN7OA.js} +29 -13
- package/dist-versioned/chunks/chunk.I5QIVC43.js +3 -3
- package/dist-versioned/chunks/chunk.IUBULF5H.js +1 -1
- package/dist-versioned/chunks/chunk.JNTYSC5E.js +1 -1
- package/dist-versioned/chunks/chunk.JQ4VVB6S.js +2 -2
- package/dist-versioned/chunks/chunk.KPGT5KTE.js +4 -4
- package/dist-versioned/chunks/chunk.KVKRZJS7.js +3 -3
- package/dist-versioned/chunks/chunk.LO2A6JZJ.js +2 -2
- package/dist-versioned/chunks/chunk.LVZUFX7G.js +1 -1
- package/dist-versioned/chunks/chunk.MGN6UKEO.js +5 -5
- package/dist-versioned/chunks/chunk.MTWZ3KVK.js +1 -1
- package/dist-versioned/chunks/chunk.NG6H4NIH.js +2 -2
- package/dist-versioned/chunks/chunk.NTCYC424.js +1 -1
- package/dist-versioned/chunks/chunk.QJGXEBXI.js +13 -13
- package/dist-versioned/chunks/chunk.TIB22UHZ.js +6 -6
- package/dist-versioned/chunks/chunk.TJBA6JWN.js +1 -1
- package/dist-versioned/chunks/chunk.TYVXH7ZW.js +9 -9
- package/dist-versioned/chunks/chunk.U6ZVQYN2.js +1 -1
- package/dist-versioned/chunks/chunk.UIQBHPD3.js +2 -2
- package/dist-versioned/chunks/chunk.UT2PBNPH.js +2 -2
- package/dist-versioned/chunks/chunk.UUW3B5S5.js +2 -2
- package/dist-versioned/chunks/chunk.W5BEGOS2.js +3 -3
- package/dist-versioned/chunks/chunk.XAOH7E5Y.js +2 -2
- package/dist-versioned/chunks/chunk.XQPSZT7C.js +2 -2
- package/dist-versioned/chunks/chunk.Z2TW3FW6.js +1 -1
- package/dist-versioned/chunks/chunk.Z7OTCKNY.js +2 -2
- package/dist-versioned/chunks/chunk.ZQKFSIZX.js +1 -1
- package/dist-versioned/chunks/chunk.ZU6B6J6V.js +24 -24
- 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/button/button.d.ts +1 -1
- package/dist-versioned/components/button-group/button-group.d.ts +1 -1
- package/dist-versioned/components/carousel/carousel.d.ts +1 -1
- package/dist-versioned/components/carousel-item/carousel-item.d.ts +1 -1
- package/dist-versioned/components/checkbox/checkbox.d.ts +1 -1
- package/dist-versioned/components/checkbox-group/checkbox-group.d.ts +1 -1
- package/dist-versioned/components/combobox/combobox.d.ts +1 -1
- package/dist-versioned/components/dialog/dialog.d.ts +1 -1
- package/dist-versioned/components/divider/divider.d.ts +1 -1
- package/dist-versioned/components/drawer/drawer.d.ts +1 -1
- package/dist-versioned/components/dropdown/dropdown.d.ts +1 -1
- package/dist-versioned/components/expandable/expandable.d.ts +1 -1
- package/dist-versioned/components/flipcard/flipcard.d.ts +1 -1
- package/dist-versioned/components/header/header.d.ts +1 -1
- package/dist-versioned/components/icon/icon.d.ts +1 -1
- package/dist-versioned/components/include/include.d.ts +1 -1
- package/dist-versioned/components/input/input.d.ts +1 -1
- package/dist-versioned/components/link/link.d.ts +1 -1
- package/dist-versioned/components/map-marker/map-marker.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 +2 -2
- 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 +2 -2
- package/dist-versioned/components/scrollable/scrollable.d.ts +1 -1
- package/dist-versioned/components/scrollable/scrollable.js +1 -1
- package/dist-versioned/components/select/select.d.ts +1 -1
- package/dist-versioned/components/spinner/spinner.d.ts +1 -1
- package/dist-versioned/components/step/step.d.ts +1 -1
- package/dist-versioned/components/step-group/step-group.d.ts +1 -1
- package/dist-versioned/components/switch/switch.d.ts +1 -1
- package/dist-versioned/components/tab/tab.d.ts +1 -1
- package/dist-versioned/components/tab-group/tab-group.d.ts +1 -1
- package/dist-versioned/components/tab-panel/tab-panel.d.ts +1 -1
- package/dist-versioned/components/tag/tag.d.ts +1 -1
- package/dist-versioned/components/textarea/textarea.d.ts +1 -1
- package/dist-versioned/components/tooltip/tooltip.d.ts +1 -1
- package/dist-versioned/components/video/video.d.ts +1 -1
- package/dist-versioned/custom-elements.json +211 -211
- 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 +80 -80
- package/dist-versioned/web-types.json +137 -137
- package/package.json +2 -2
- package/cdn/chunks/chunk.66GOZEE4.js +0 -1
- package/cdn-versioned/chunks/chunk.66GOZEE4.js +0 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solid-design-system/components",
|
|
3
3
|
"description": "Solid Design System: Components",
|
|
4
|
-
"version": "5.
|
|
4
|
+
"version": "5.2.0",
|
|
5
5
|
"homepage": "https://solid-design-system.fe.union-investment.de/docs/",
|
|
6
6
|
"author": "Union Investment",
|
|
7
7
|
"license": "MIT",
|
|
@@ -111,7 +111,7 @@
|
|
|
111
111
|
"readme": "README.md",
|
|
112
112
|
"meta": {
|
|
113
113
|
"bundleSizeInKb": {
|
|
114
|
-
"uncompressed":
|
|
114
|
+
"uncompressed": 432,
|
|
115
115
|
"gzip": 101
|
|
116
116
|
}
|
|
117
117
|
},
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a}from"./chunk.YTG5BN3U.js";import{a as k}from"./chunk.DEXOQON7.js";import{a as s}from"./chunk.26V4EXHB.js";import{a as T,b as h,c as b,d as u,h as $}from"./chunk.RYR5JMPR.js";import{b as S,e as r}from"./chunk.UWPDCU52.js";import{e as o}from"./chunk.TJOCV4DC.js";var n=class extends ${constructor(){super(...arguments);this.localize=new k(this);this.orientation="horizontal";this.scrollbars=!1;this.buttons=!1;this.shadows=!1;this.inset=!1;this.step=150;this.canScroll={left:!1,right:!1,up:!1,down:!1};this.isScrollHorizontalEnabled=!1;this.isScrollVerticalEnabled=!1}connectedCallback(){super.connectedCallback(),this.updateScrollEnabledFlags(),this.resizeObserver=new ResizeObserver(()=>{this.handleContainerScroll()}),this.updateComplete.then(()=>{this.container&&this.resizeObserver.observe(this.container)})}disconnectedCallback(){super.disconnectedCallback(),this.container&&this.resizeObserver.unobserve(this.container)}updated(t){super.updated(t),(t.has("orientation")||t.has("buttons")||t.has("shadows"))&&(this.updateScrollEnabledFlags(),this.handleContainerScroll())}updateScrollEnabledFlags(){let t=this.orientation;this.isScrollHorizontalEnabled=t==="horizontal"||t==="auto",this.isScrollVerticalEnabled=t==="vertical"||t==="auto"}get scrollButtons(){return{left:this.leftButton,right:this.rightButton,up:this.upButton,down:this.downButton}}handleContainerScroll(){if(!this.container)return;let t=this.container.scrollLeft>0,l=this.container.scrollLeft+this.container.clientWidth<this.container.scrollWidth-1,e=this.container.scrollTop>0,d=this.container.scrollTop+this.container.clientHeight<this.container.scrollHeight-1,c=this.canScroll,i={left:this.isScrollHorizontalEnabled&&t,right:this.isScrollHorizontalEnabled&&l,up:this.isScrollVerticalEnabled&&e,down:this.isScrollVerticalEnabled&&d},v=c.left&&!i.left,m=c.up&&!i.up,E=c.right&&!i.right,p=c.down&&!i.down;(v||m)&&this.dispatchEvent(new CustomEvent("start")),(E||p)&&this.dispatchEvent(new CustomEvent("end")),this.canScroll=i}handleScroll(t,l){var y,x,B;let e=["left","up"].includes(t)?-this.step:this.step,d=["left","right"].includes(t)?"horizontal":"vertical",c=["left","up"].includes(t)?"start":"end",i=!["mouse","touch"].includes((y=l==null?void 0:l.pointerType)!=null?y:""),v=d==="horizontal"?"left":"top";(x=this.container)==null||x.scrollBy({behavior:"smooth",[v]:e});let m=`button-${t}`;this.dispatchEvent(new CustomEvent(m,{bubbles:!0,composed:!0}));let p=(d==="horizontal"?this.container.scrollLeft:this.container.scrollTop)+e,C=d==="horizontal"?this.container.scrollWidth-this.container.clientWidth:this.container.scrollHeight-this.container.clientHeight,z=c==="start"&&p<=0,H=c==="end"&&p>=C-1;if(!(z||H)){let w=this.localize.term("scrolled");this.announcementContainer.textContent=this.announcementContainer.textContent===w?`${w}\u200B`:w;return}let g=this.scrollButtons[t],f={left:this.rightButton,right:this.leftButton,up:this.downButton,down:this.upButton}[t],L=z?`${this.localize.term("scrolled")}. ${this.localize.term("scrollToEnd")}`:`${this.localize.term("scrolled")}. ${this.localize.term("scrollToStart")}`;(B=f==null?void 0:f.querySelector("sd-icon"))==null||B.setAttribute("label",L),i?f==null||f.focus():g==null||g.blur()}handleButtonBlur(t,l){var i;let d=(["left","up"].includes(t)?"start":"end")==="start"?this.localize.term("scrollToStart"):this.localize.term("scrollToEnd");(i=l.target.querySelector("sd-icon"))==null||i.setAttribute("label",d)}render(){let t="relative p-0 border-0 bg-transparent cursor-pointer w-5 h-5 flex items-center justify-center sd-interactive rounded-md flex text-lg",l="scroll-shadow absolute z-10 pointer-events-none";return r`<div part="base" class="${s("scroll-container flex overflow-hidden flex-1",this.scrollbars?"show-scrollbars":"hide-scrollbars",this.inset&&"p-4",{horizontal:"scroll-horizontal flex-row whitespace-nowrap items-center overflow-x-scroll overflow-y-hidden",vertical:"scroll-vertical justify-items-center overflow-y-scroll overflow-x-hidden",auto:"scroll-auto overflow-auto"}[this.orientation])}" @scroll="${this.handleContainerScroll}" tabindex="0"><div id="announcement-container" role="status" class="sr-only"></div><div part="scroll-content" class="flex-1"><slot></slot></div></div>${this.buttons?r`${this.isScrollHorizontalEnabled?r`<div part="button-left" class="${s("absolute z-10 flex items-center justify-center top-0 left-0 h-full w-8",!this.canScroll.left&&"opacity-0 pointer-events-none")}"><button part="button-start" class="${s(t)}" aria-hidden="${a(!this.canScroll.left||void 0)}" tabindex="${a(this.canScroll.left?void 0:-1)}" @click="${e=>this.handleScroll("left",e)}" @blur="${e=>this.handleButtonBlur("left",e)}"><slot name="icon-start"><sd-icon library="_internal" name="chevron-up" class="rotate-[-90deg]" label="${this.localize.term("scrollToStart")}"></sd-icon></slot></button></div><div part="button-right" class="${s("absolute z-10 flex items-center justify-center top-0 right-0 h-full w-8",!this.canScroll.right&&"opacity-0 pointer-events-none")}"><button part="button-end" class="${s(t)}" aria-hidden="${a(!this.canScroll.right||void 0)}" tabindex="${a(this.canScroll.right?void 0:-1)}" @click="${e=>this.handleScroll("right",e)}" @blur="${e=>this.handleButtonBlur("right",e)}"><slot name="icon-end"><sd-icon library="_internal" name="chevron-down" class="rotate-[-90deg]" label="${this.localize.term("scrollToEnd")}"></sd-icon></slot></button></div>`:null} ${this.isScrollVerticalEnabled?r`<div part="button-top" class="${s("absolute z-10 flex items-center justify-center top-0 left-0 w-full h-8",!this.canScroll.up&&"opacity-0 pointer-events-none")}"><button part="button-start" class="${s(t)}" aria-hidden="${a(!this.canScroll.up||void 0)}" tabindex="${a(this.canScroll.up?void 0:-1)}" @click="${e=>this.handleScroll("up",e)}" @blur="${e=>this.handleButtonBlur("up",e)}"><slot name="icon-start"><sd-icon library="_internal" name="chevron-up" label="${this.localize.term("scrollToStart")}"></sd-icon></slot></button></div><div part="button-bottom" class="${s("absolute z-10 flex items-center justify-center bottom-0 left-0 w-full h-8",!this.canScroll.down&&"opacity-0 pointer-events-none")}"><button part="button-end" class="${s(t)}" aria-hidden="${a(!this.canScroll.down||void 0)}" tabindex="${a(this.canScroll.down?void 0:-1)}" @click="${e=>this.handleScroll("down",e)}" @blur="${e=>this.handleButtonBlur("down",e)}"><slot name="icon-end"><sd-icon library="_internal" name="chevron-down" label="${this.localize.term("scrollToEnd")}"></sd-icon></slot></button></div>`:null}`:null} ${this.shadows?r`${this.isScrollHorizontalEnabled?r`${this.canScroll.left?r`<div part="shadow-left" class="${l} left top-0 left-0 w-[6px] h-full"></div>`:null} ${this.canScroll.right?r`<div part="shadow-right" class="${l} right top-0 right-0 w-[6px] h-full"></div>`:null}`:null} ${this.isScrollVerticalEnabled?r`${this.canScroll.up?r`<div part="shadow-top" class="${l} top top-0 left-0 w-full h-[6px]"></div>`:null} ${this.canScroll.down?r`<div part="shadow-bottom" class="${l} bottom bottom-0 left-0 w-full h-[6px]"></div>`:null}`:null}`:null}`}};n.styles=[...$.styles,S`:host{--gradient-color:hsla(0,0%,100%,0);--gradient:var(--gradient-color) 0%,#fff 80%,#fff 100%;display:flex;overflow:hidden;position:relative}.hide-scrollbars{scrollbar-width:none;-ms-overflow-style:none}.hide-scrollbars::-webkit-scrollbar{display:none}.scroll-container::-webkit-scrollbar-thumb{background-color:transparent}.scroll-container:hover::-webkit-scrollbar-thumb{background:var(--background-neutral-400,#c3c3c3);border-radius:var(--sd-border-radius-sm,.125rem)}.scroll-container::-webkit-scrollbar{height:var(--sd-spacing-1,.25rem);width:var(--sd-spacing-1,.25rem)}.scroll-auto{overflow:auto}[part=button-left]{background:linear-gradient(270deg,var(--gradient))}[part=button-right]{background:linear-gradient(90deg,var(--gradient))}[part=button-top]{background:linear-gradient(0deg,var(--gradient))}[part=button-bottom]{background:linear-gradient(180deg,var(--gradient))}[part=shadow-left]{background:linear-gradient(270deg,hsla(0,0%,9%,0) 50%,hsla(0,0%,9%,.4))}[part=shadow-right]{background:linear-gradient(90deg,hsla(0,0%,9%,0) 50%,hsla(0,0%,9%,.4))}[part=shadow-top]{background:linear-gradient(0deg,hsla(0,0%,9%,0) 50%,hsla(0,0%,9%,.4))}[part=shadow-bottom]{background:linear-gradient(180deg,hsla(0,0%,9%,0) 50%,hsla(0,0%,9%,.4))}.sd-icon--top{align-self:flex-start}.sd-icon--down{align-self:flex-end}`],o([u('[part="button-right"] button')],n.prototype,"rightButton",2),o([u('[part="button-left"] button')],n.prototype,"leftButton",2),o([u('[part="button-bottom"] button')],n.prototype,"downButton",2),o([u('[part="button-top"] button')],n.prototype,"upButton",2),o([u(".scroll-container")],n.prototype,"container",2),o([u("#announcement-container")],n.prototype,"announcementContainer",2),o([h({type:String,reflect:!0})],n.prototype,"orientation",2),o([h({type:Boolean,reflect:!0})],n.prototype,"scrollbars",2),o([h({type:Boolean,reflect:!0})],n.prototype,"buttons",2),o([h({type:Boolean,reflect:!0})],n.prototype,"shadows",2),o([h({type:Boolean,reflect:!0})],n.prototype,"inset",2),o([h({type:Number,reflect:!0})],n.prototype,"step",2),o([b()],n.prototype,"canScroll",2),o([b()],n.prototype,"isScrollHorizontalEnabled",2),o([b()],n.prototype,"isScrollVerticalEnabled",2),n=o([T("sd-scrollable")],n);export{n as a};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a}from"./chunk.YTG5BN3U.js";import{a as k}from"./chunk.DEXOQON7.js";import{a as s}from"./chunk.26V4EXHB.js";import{a as T,b as h,c as b,d as u,h as $}from"./chunk.RYR5JMPR.js";import{b as S,e as r}from"./chunk.UWPDCU52.js";import{e as o}from"./chunk.TJOCV4DC.js";var n=class extends ${constructor(){super(...arguments);this.localize=new k(this);this.orientation="horizontal";this.scrollbars=!1;this.buttons=!1;this.shadows=!1;this.inset=!1;this.step=150;this.canScroll={left:!1,right:!1,up:!1,down:!1};this.isScrollHorizontalEnabled=!1;this.isScrollVerticalEnabled=!1}connectedCallback(){super.connectedCallback(),this.updateScrollEnabledFlags(),this.resizeObserver=new ResizeObserver(()=>{this.handleContainerScroll()}),this.updateComplete.then(()=>{this.container&&this.resizeObserver.observe(this.container)})}disconnectedCallback(){super.disconnectedCallback(),this.container&&this.resizeObserver.unobserve(this.container)}updated(t){super.updated(t),(t.has("orientation")||t.has("buttons")||t.has("shadows"))&&(this.updateScrollEnabledFlags(),this.handleContainerScroll())}updateScrollEnabledFlags(){let t=this.orientation;this.isScrollHorizontalEnabled=t==="horizontal"||t==="auto",this.isScrollVerticalEnabled=t==="vertical"||t==="auto"}get scrollButtons(){return{left:this.leftButton,right:this.rightButton,up:this.upButton,down:this.downButton}}handleContainerScroll(){if(!this.container)return;let t=this.container.scrollLeft>0,l=this.container.scrollLeft+this.container.clientWidth<this.container.scrollWidth-1,e=this.container.scrollTop>0,d=this.container.scrollTop+this.container.clientHeight<this.container.scrollHeight-1,c=this.canScroll,i={left:this.isScrollHorizontalEnabled&&t,right:this.isScrollHorizontalEnabled&&l,up:this.isScrollVerticalEnabled&&e,down:this.isScrollVerticalEnabled&&d},v=c.left&&!i.left,m=c.up&&!i.up,E=c.right&&!i.right,p=c.down&&!i.down;(v||m)&&this.dispatchEvent(new CustomEvent("start")),(E||p)&&this.dispatchEvent(new CustomEvent("end")),this.canScroll=i}handleScroll(t,l){var y,x,B;let e=["left","up"].includes(t)?-this.step:this.step,d=["left","right"].includes(t)?"horizontal":"vertical",c=["left","up"].includes(t)?"start":"end",i=!["mouse","touch"].includes((y=l==null?void 0:l.pointerType)!=null?y:""),v=d==="horizontal"?"left":"top";(x=this.container)==null||x.scrollBy({behavior:"smooth",[v]:e});let m=`button-${t}`;this.dispatchEvent(new CustomEvent(m,{bubbles:!0,composed:!0}));let p=(d==="horizontal"?this.container.scrollLeft:this.container.scrollTop)+e,C=d==="horizontal"?this.container.scrollWidth-this.container.clientWidth:this.container.scrollHeight-this.container.clientHeight,z=c==="start"&&p<=0,H=c==="end"&&p>=C-1;if(!(z||H)){let w=this.localize.term("scrolled");this.announcementContainer.textContent=this.announcementContainer.textContent===w?`${w}\u200B`:w;return}let g=this.scrollButtons[t],f={left:this.rightButton,right:this.leftButton,up:this.downButton,down:this.upButton}[t],L=z?`${this.localize.term("scrolled")}. ${this.localize.term("scrollToEnd")}`:`${this.localize.term("scrolled")}. ${this.localize.term("scrollToStart")}`;(B=f==null?void 0:f.querySelector("sd-5-1-0-icon"))==null||B.setAttribute("label",L),i?f==null||f.focus():g==null||g.blur()}handleButtonBlur(t,l){var i;let d=(["left","up"].includes(t)?"start":"end")==="start"?this.localize.term("scrollToStart"):this.localize.term("scrollToEnd");(i=l.target.querySelector("sd-5-1-0-icon"))==null||i.setAttribute("label",d)}render(){let t="relative p-0 border-0 bg-transparent cursor-pointer w-5 h-5 flex items-center justify-center sd-interactive rounded-md flex text-lg",l="scroll-shadow absolute z-10 pointer-events-none";return r`<div part="base" class="${s("scroll-container flex overflow-hidden flex-1",this.scrollbars?"show-scrollbars":"hide-scrollbars",this.inset&&"p-4",{horizontal:"scroll-horizontal flex-row whitespace-nowrap items-center overflow-x-scroll overflow-y-hidden",vertical:"scroll-vertical justify-items-center overflow-y-scroll overflow-x-hidden",auto:"scroll-auto overflow-auto"}[this.orientation])}" @scroll="${this.handleContainerScroll}" tabindex="0"><div id="announcement-container" role="status" class="sr-only"></div><div part="scroll-content" class="flex-1"><slot></slot></div></div>${this.buttons?r`${this.isScrollHorizontalEnabled?r`<div part="button-left" class="${s("absolute z-10 flex items-center justify-center top-0 left-0 h-full w-8",!this.canScroll.left&&"opacity-0 pointer-events-none")}"><button part="button-start" class="${s(t)}" aria-hidden="${a(!this.canScroll.left||void 0)}" tabindex="${a(this.canScroll.left?void 0:-1)}" @click="${e=>this.handleScroll("left",e)}" @blur="${e=>this.handleButtonBlur("left",e)}"><slot name="icon-start"><sd-5-1-0-icon library="_internal" name="chevron-up" class="rotate-[-90deg]" label="${this.localize.term("scrollToStart")}"></sd-5-1-0-icon></slot></button></div><div part="button-right" class="${s("absolute z-10 flex items-center justify-center top-0 right-0 h-full w-8",!this.canScroll.right&&"opacity-0 pointer-events-none")}"><button part="button-end" class="${s(t)}" aria-hidden="${a(!this.canScroll.right||void 0)}" tabindex="${a(this.canScroll.right?void 0:-1)}" @click="${e=>this.handleScroll("right",e)}" @blur="${e=>this.handleButtonBlur("right",e)}"><slot name="icon-end"><sd-5-1-0-icon library="_internal" name="chevron-down" class="rotate-[-90deg]" label="${this.localize.term("scrollToEnd")}"></sd-5-1-0-icon></slot></button></div>`:null} ${this.isScrollVerticalEnabled?r`<div part="button-top" class="${s("absolute z-10 flex items-center justify-center top-0 left-0 w-full h-8",!this.canScroll.up&&"opacity-0 pointer-events-none")}"><button part="button-start" class="${s(t)}" aria-hidden="${a(!this.canScroll.up||void 0)}" tabindex="${a(this.canScroll.up?void 0:-1)}" @click="${e=>this.handleScroll("up",e)}" @blur="${e=>this.handleButtonBlur("up",e)}"><slot name="icon-start"><sd-5-1-0-icon library="_internal" name="chevron-up" label="${this.localize.term("scrollToStart")}"></sd-5-1-0-icon></slot></button></div><div part="button-bottom" class="${s("absolute z-10 flex items-center justify-center bottom-0 left-0 w-full h-8",!this.canScroll.down&&"opacity-0 pointer-events-none")}"><button part="button-end" class="${s(t)}" aria-hidden="${a(!this.canScroll.down||void 0)}" tabindex="${a(this.canScroll.down?void 0:-1)}" @click="${e=>this.handleScroll("down",e)}" @blur="${e=>this.handleButtonBlur("down",e)}"><slot name="icon-end"><sd-5-1-0-icon library="_internal" name="chevron-down" label="${this.localize.term("scrollToEnd")}"></sd-5-1-0-icon></slot></button></div>`:null}`:null} ${this.shadows?r`${this.isScrollHorizontalEnabled?r`${this.canScroll.left?r`<div part="shadow-left" class="${l} left top-0 left-0 w-[6px] h-full"></div>`:null} ${this.canScroll.right?r`<div part="shadow-right" class="${l} right top-0 right-0 w-[6px] h-full"></div>`:null}`:null} ${this.isScrollVerticalEnabled?r`${this.canScroll.up?r`<div part="shadow-top" class="${l} top top-0 left-0 w-full h-[6px]"></div>`:null} ${this.canScroll.down?r`<div part="shadow-bottom" class="${l} bottom bottom-0 left-0 w-full h-[6px]"></div>`:null}`:null}`:null}`}};n.styles=[...$.styles,S`:host{--gradient-color:hsla(0,0%,100%,0);--gradient:var(--gradient-color) 0%,#fff 80%,#fff 100%;display:flex;overflow:hidden;position:relative}.hide-scrollbars{scrollbar-width:none;-ms-overflow-style:none}.hide-scrollbars::-webkit-scrollbar{display:none}.scroll-container::-webkit-scrollbar-thumb{background-color:transparent}.scroll-container:hover::-webkit-scrollbar-thumb{background:var(--background-neutral-400,#c3c3c3);border-radius:var(--sd-border-radius-sm,.125rem)}.scroll-container::-webkit-scrollbar{height:var(--sd-spacing-1,.25rem);width:var(--sd-spacing-1,.25rem)}.scroll-auto{overflow:auto}[part=button-left]{background:linear-gradient(270deg,var(--gradient))}[part=button-right]{background:linear-gradient(90deg,var(--gradient))}[part=button-top]{background:linear-gradient(0deg,var(--gradient))}[part=button-bottom]{background:linear-gradient(180deg,var(--gradient))}[part=shadow-left]{background:linear-gradient(270deg,hsla(0,0%,9%,0) 50%,hsla(0,0%,9%,.4))}[part=shadow-right]{background:linear-gradient(90deg,hsla(0,0%,9%,0) 50%,hsla(0,0%,9%,.4))}[part=shadow-top]{background:linear-gradient(0deg,hsla(0,0%,9%,0) 50%,hsla(0,0%,9%,.4))}[part=shadow-bottom]{background:linear-gradient(180deg,hsla(0,0%,9%,0) 50%,hsla(0,0%,9%,.4))}.sd-5-1-0-icon--top{align-self:flex-start}.sd-5-1-0-icon--down{align-self:flex-end}`],o([u('[part="button-right"] button')],n.prototype,"rightButton",2),o([u('[part="button-left"] button')],n.prototype,"leftButton",2),o([u('[part="button-bottom"] button')],n.prototype,"downButton",2),o([u('[part="button-top"] button')],n.prototype,"upButton",2),o([u(".scroll-container")],n.prototype,"container",2),o([u("#announcement-container")],n.prototype,"announcementContainer",2),o([h({type:String,reflect:!0})],n.prototype,"orientation",2),o([h({type:Boolean,reflect:!0})],n.prototype,"scrollbars",2),o([h({type:Boolean,reflect:!0})],n.prototype,"buttons",2),o([h({type:Boolean,reflect:!0})],n.prototype,"shadows",2),o([h({type:Boolean,reflect:!0})],n.prototype,"inset",2),o([h({type:Number,reflect:!0})],n.prototype,"step",2),o([b()],n.prototype,"canScroll",2),o([b()],n.prototype,"isScrollHorizontalEnabled",2),o([b()],n.prototype,"isScrollVerticalEnabled",2),n=o([T("sd-5-1-0-scrollable")],n);export{n as a};
|