@telekom/scale-components
Version:
Scale is the digital design system for Telekom products and experiences.
1 lines • 1.22 kB
JavaScript
import{r as t,h as s,a as e,g as i}from"./p-d52b3602.js";import{c as r}from"./p-c608c6dc.js";const l=class{constructor(s){t(this,s),this.isNested=!1,this.ordered=!1}orderedChanged(t){this.propagatePropsToChildren(t)}componentDidLoad(){this.propagatePropsToChildren(this.ordered)}connectedCallback(){this.isNested=null!=this.el.closest("scale-list-item"),this.isNested?this.el.setAttribute("slot","nested"):this.el.removeAttribute("slot")}propagatePropsToChildren(t){Array.from(this.el.children).filter((t=>t.matches("scale-list-item"))).forEach(((s,e)=>{s.ordered=t,s.index=e+1}))}render(){const t=this.ordered?"ol":"ul";return s(e,null,this.styles&&s("style",null,this.styles),s(t,{class:this.getCssClassMap(),part:r("base",this.ordered&&"ordered",this.isNested&&"nested")},s("slot",null)))}getCssClassMap(){return r("list",this.ordered&&"list--type-ordered",this.isNested&&"list--nested")}get el(){return i(this)}static get watchers(){return{ordered:["orderedChanged"]}}};l.style=":host{--spacing-left:0;--spacing-left-nested:var(--telekom-spacing-composition-space-04)}.list{padding-left:var(--spacing-left)}.list--nested{margin-top:0;margin-bottom:0;padding-left:var(--spacing-left-nested)}";export{l as scale_list}