@postnord/web-components
Version:
PostNord Web Components
48 lines (42 loc) • 1.64 kB
JavaScript
/*!
* Built with Stencil
* By PostNord.
*/
;
Object.defineProperty(exports, '__esModule', { value: true });
const index = require('./index-ec4ed1cc.js');
const pnProgressIndicatorCss = ".pn-progress-indicator{display:flex;padding:2.8em 1em 0}";
const PnProgressIndicatorStyle0 = pnProgressIndicatorCss;
const PnProgressIndicator = class {
constructor(hostRef) {
index.registerInstance(this, hostRef);
this.progresschange = index.createEvent(this, "progresschange", 7);
this.activeStep = 0;
}
get hostElement() { return index.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 (index.h("div", { key: 'c78f37115c48eaff800b2f372a78efa406f79f1f', class: "pn-progress-indicator" }, index.h("slot", { key: '0e6dea61f881561da76a6979451c29eea31ab119' })));
}
};
PnProgressIndicator.style = PnProgressIndicatorStyle0;
exports.pn_progress_indicator = PnProgressIndicator;
//# sourceMappingURL=pn-progress-indicator.cjs.entry.js.map