@scania/tegel
Version:
Tegel Design System
1 lines • 2.52 kB
JavaScript
import{t as e,p as t,H as i,c as s,h as a,a as n}from"./index.js";import{g as l}from"./p-Cn4f8w1e.js";const o=t(class extends i{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.internalTdsPropsChange=s(this,"internalTdsPropsChange",6),this.orientation="horizontal",this.labelPosition="below",this.size="lg",this.hideLabels=!1,this.stepperId=l(),this.tdsAriaLabel="Progress steps"}componentWillLoad(){"vertical"===this.orientation&&(this.labelPosition="aside")}handleDirectionChange(){this.internalTdsPropsChange.emit({stepperId:this.stepperId,changed:["orientation"],orientation:this.orientation})}handleLabelPositionChange(){this.internalTdsPropsChange.emit({stepperId:this.stepperId,changed:["labelPosition"],labelPosition:this.labelPosition})}handleSizeChange(){this.internalTdsPropsChange.emit({stepperId:this.stepperId,changed:["size"],size:this.size})}handleHideLabelsChange(){this.internalTdsPropsChange.emit({stepperId:this.stepperId,changed:["hideLabels"],hideLabels:this.hideLabels})}render(){return a(n,{key:"a62077cf8b1936e7109eea64cad0ceb67a45c676"},a("div",{key:"f958fcd53b074ac8ac72d055162e738116e94956",role:"list","aria-label":this.tdsAriaLabel,class:`${this.orientation} text-position-${this.labelPosition} ${this.size}`},a("slot",{key:"e9dfa6c14ec134baafe5a58394337b09ca091809"})))}get host(){return this}static get watchers(){return{orientation:[{handleDirectionChange:0}],labelPosition:[{handleLabelPositionChange:0}],size:[{handleSizeChange:0}],hideLabels:[{handleHideLabelsChange:0}]}}static get style(){return":host [role=list]{display:flex;justify-content:space-evenly;min-width:100%}:host [role=list]:not(.text-position-aside){display:table;table-layout:fixed;width:100%;list-style:none}:host [role=list].vertical{height:100%;display:flex;flex-direction:column;justify-content:unset;gap:52px}:host [role=list].vertical.sm{gap:36px}:host [role=list].horizontal.text-position-aside{justify-content:unset}"}},[257,"tds-stepper",{orientation:[1],labelPosition:[1,"label-position"],size:[1],hideLabels:[4,"hide-labels"],stepperId:[1,"stepper-id"],tdsAriaLabel:[1,"tds-aria-label"]},void 0,{orientation:[{handleDirectionChange:0}],labelPosition:[{handleLabelPositionChange:0}],size:[{handleSizeChange:0}],hideLabels:[{handleHideLabelsChange:0}]}]);function h(){"undefined"!=typeof customElements&&["tds-stepper"].forEach((t=>{"tds-stepper"===t&&(customElements.get(e(t))||customElements.define(e(t),o))}))}h();const d=o,r=h;export{d as TdsStepper,r as defineCustomElement}