(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('@angular/router')) : typeof define === 'function' && define.amd ? define('primeng/steps', ['exports', '@angular/core', '@angular/common', '@angular/router'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.primeng = global.primeng || {}, global.primeng.steps = {}), global.ng.core, global.ng.common, global.ng.router)); }(this, (function (exports, core, common, router) { 'use strict'; var Steps = /** @class */ (function () { function Steps(router, route, cd) { this.router = router; this.route = route; this.cd = cd; this.activeIndex = 0; this.readonly = true; this.activeIndexChange = new core.EventEmitter(); } Steps.prototype.ngOnInit = function () { var _this = this; this.subscription = this.router.events.subscribe(function () { return _this.cd.markForCheck(); }); }; Steps.prototype.itemClick = function (event, item, i) { if (this.readonly || item.disabled) { event.preventDefault(); return; } this.activeIndexChange.emit(i); if (!item.url) { event.preventDefault(); } if (item.command) { item.command({ originalEvent: event, item: item, index: i }); } }; Steps.prototype.isClickableRouterLink = function (item) { return item.routerLink && !this.readonly && !item.disabled; }; Steps.prototype.isActive = function (item, index) { if (item.routerLink) return this.router.isActive(item.routerLink, false) || this.router.isActive(this.router.createUrlTree([item.routerLink], { relativeTo: this.route }).toString(), false); else return index === this.activeIndex; }; Steps.prototype.ngOnDestroy = function () { this.subscription.unsubscribe(); }; return Steps; }()); Steps.decorators = [ { type: core.Component, args: [{ selector: 'p-steps', template: "\n
\n \n
\n ", changeDetection: core.ChangeDetectionStrategy.OnPush, encapsulation: core.ViewEncapsulation.None, styles: [".p-steps{position:relative}.p-steps ul{list-style-type:none;margin:0;padding:0}.p-steps-item,.p-steps ul{display:-ms-flexbox;display:flex}.p-steps-item{-ms-flex:1 1 auto;-ms-flex-pack:center;flex:1 1 auto;justify-content:center;position:relative}.p-steps-item .p-menuitem-link{-ms-flex-align:center;-ms-flex-direction:column;align-items:center;display:-ms-inline-flexbox;display:inline-flex;flex-direction:column;overflow:hidden;text-decoration:none}.p-steps.p-steps-readonly .p-steps-item{cursor:auto}.p-steps-item.p-steps-current .p-menuitem-link{cursor:default}.p-steps-title{white-space:nowrap}.p-steps-number{-ms-flex-align:center;-ms-flex-pack:center;align-items:center;display:-ms-flexbox;display:flex;justify-content:center}.p-steps-title{display:block}"] },] } ]; Steps.ctorParameters = function () { return [ { type: router.Router }, { type: router.ActivatedRoute }, { type: core.ChangeDetectorRef } ]; }; Steps.propDecorators = { activeIndex: [{ type: core.Input }], model: [{ type: core.Input }], readonly: [{ type: core.Input }], style: [{ type: core.Input }], styleClass: [{ type: core.Input }], activeIndexChange: [{ type: core.Output }] }; var StepsModule = /** @class */ (function () { function StepsModule() { } return StepsModule; }()); StepsModule.decorators = [ { type: core.NgModule, args: [{ imports: [common.CommonModule, router.RouterModule], exports: [Steps, router.RouterModule], declarations: [Steps] },] } ]; /** * Generated bundle index. Do not edit. */ exports.Steps = Steps; exports.StepsModule = StepsModule; Object.defineProperty(exports, '__esModule', { value: true }); }))); //# sourceMappingURL=primeng-steps.umd.js.map