UNPKG

@postnord/web-components

Version:

PostNord Web Components

44 lines (40 loc) 1.58 kB
/*! * Built with Stencil * By PostNord. */ import { r as registerInstance, c as createEvent, g as getElement, h } from './index-5606614b.js'; const pnProgressIndicatorCss = ".pn-progress-indicator{display:flex;padding:2.8em 1em 0}"; const PnProgressIndicatorStyle0 = pnProgressIndicatorCss; const PnProgressIndicator = class { constructor(hostRef) { registerInstance(this, hostRef); this.progresschange = createEvent(this, "progresschange", 7); this.activeStep = 0; } get hostElement() { return getElement(this); } /** This will emit when progress is changed and is the value you want to bind to your VM state */ progresschange; setActiveStepHandler({ detail }) { this.activeStep = detail; this.progresschange.emit(this.activeStep); } componentWillLoad() { this.passPropsToChildren(); } componentDidUpdate() { this.passPropsToChildren(); } passPropsToChildren() { const children = Array.from(this.hostElement.querySelectorAll('pn-progress-indicator-step')); children.forEach((child, i) => { child.activeStep = this.activeStep; child.index = i; }); } render() { return (h("div", { key: 'c78f37115c48eaff800b2f372a78efa406f79f1f', class: "pn-progress-indicator" }, h("slot", { key: '0e6dea61f881561da76a6979451c29eea31ab119' }))); } }; PnProgressIndicator.style = PnProgressIndicatorStyle0; export { PnProgressIndicator as pn_progress_indicator }; //# sourceMappingURL=pn-progress-indicator.entry.js.map