primeng
Version:
PrimeNG is an open source UI library for Angular featuring a rich set of 80+ components, a theme designer, various theme alternatives such as Material, Bootstrap, Tailwind, premium templates and professional support. In addition, it integrates with PrimeB
684 lines (673 loc) • 35.3 kB
JavaScript
import * as i1 from '@angular/common';
import { CommonModule } from '@angular/common';
import * as i0 from '@angular/core';
import { Injectable, contentChildren, forwardRef, inject, ViewEncapsulation, ChangeDetectionStrategy, Component, model, computed, contentChild, effect, input, ContentChildren, ContentChild, signal, NgModule } from '@angular/core';
import { trigger, state, transition, style as style$1, animate } from '@angular/animations';
import { find, findIndexInList, uuid } from '@primeuix/utils';
import { SharedModule, PrimeTemplate } from 'primeng/api';
import { BaseComponent } from 'primeng/basecomponent';
import { transformToBoolean } from 'primeng/utils';
import { BaseStyle } from 'primeng/base';
import { style } from '@primeuix/styles/stepper';
const classes$5 = {
root: ({ instance }) => [
'p-stepitem',
{
'p-stepitem-active': instance.isActive()
}
]
};
class StepItemStyle extends BaseStyle {
name = 'stepitem';
classes = classes$5;
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: StepItemStyle, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: StepItemStyle });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: StepItemStyle, decorators: [{
type: Injectable
}] });
/**
*
* Stepper is a component that streamlines a wizard-like workflow, organizing content into coherent steps and visually guiding users through a numbered progression in a multi-step process.
*
* [Live Demo](https://www.primeng.org/stepper/)
*
* @module stepitemstyle
*
*/
var StepItemClasses;
(function (StepItemClasses) {
/**
* Class name of the root element
*/
StepItemClasses["root"] = "p-stepitem";
})(StepItemClasses || (StepItemClasses = {}));
const classes$4 = {
root: 'p-steplist'
};
class StepListStyle extends BaseStyle {
name = 'steplist';
classes = classes$4;
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: StepListStyle, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: StepListStyle });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: StepListStyle, decorators: [{
type: Injectable
}] });
/**
*
* Stepper is a component that streamlines a wizard-like workflow, organizing content into coherent steps and visually guiding users through a numbered progression in a multi-step process.
*
* [Live Demo](https://www.primeng.org/stepper/)
*
* @module stepliststyle
*
*/
var StepListClasses;
(function (StepListClasses) {
/**
* Class name of the root element
*/
StepListClasses["root"] = "p-stepitem";
})(StepListClasses || (StepListClasses = {}));
const classes$3 = {
root: 'p-steppanels'
};
class StepPanelsStyle extends BaseStyle {
name = 'steppanel';
classes = classes$3;
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: StepPanelsStyle, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: StepPanelsStyle });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: StepPanelsStyle, decorators: [{
type: Injectable
}] });
/**
*
* StepPanel is a helper component for Stepper component.
*
* [Live Demo](https://www.primeng.org/stepper/)
*
* @module steppanelsstyle
*
*/
var StepPanelsClasses;
(function (StepPanelsClasses) {
/**
* Class name of the root element
*/
StepPanelsClasses["root"] = "p-steppanels";
})(StepPanelsClasses || (StepPanelsClasses = {}));
const classes$2 = {
root: ({ instance }) => [
'p-steppanel',
{
'p-steppanel-active': instance.isVertical() && instance.active()
}
],
content: 'p-steppanel-content'
};
class StepPanelStyle extends BaseStyle {
name = 'steppanel';
classes = classes$2;
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: StepPanelStyle, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: StepPanelStyle });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: StepPanelStyle, decorators: [{
type: Injectable
}] });
/**
*
* StepPanel is a helper component for Stepper component.
*
* [Live Demo](https://www.primeng.org/stepper/)
*
* @module steppanelstyle
*
*/
var StepPanelClasses;
(function (StepPanelClasses) {
/**
* Class name of the root element
*/
StepPanelClasses["root"] = "p-steppanel";
})(StepPanelClasses || (StepPanelClasses = {}));
const theme = /*css*/ `
${style}
/* For PrimeNG */
.p-steppanel:not(.p-steppanel-active) > .p-steppanel-content,
.p-steppanel-content.ng-animating {
overflow: hidden;
}
`;
const classes$1 = {
root: ({ instance }) => [
'p-stepper p-component',
{
'p-readonly': instance.linear()
}
],
separator: 'p-stepper-separator'
};
class StepperStyle extends BaseStyle {
name = 'stepper';
theme = theme;
classes = classes$1;
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: StepperStyle, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: StepperStyle });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: StepperStyle, decorators: [{
type: Injectable
}] });
/**
*
* Stepper is a component that streamlines a wizard-like workflow, organizing content into coherent steps and visually guiding users through a numbered progression in a multi-step process.
*
* [Live Demo](https://www.primeng.org/stepper/)
*
* @module stepperstyle
*
*/
var StepperClasses;
(function (StepperClasses) {
/**
* Class name of the root element
*/
StepperClasses["root"] = "p-stepper";
/**
* Class name of the separator element
*/
StepperClasses["separator"] = "p-stepper-separator";
})(StepperClasses || (StepperClasses = {}));
const classes = {
root: ({ instance }) => [
'p-step',
{
'p-step-active': instance.active(),
'p-disabled': instance.isStepDisabled()
}
],
header: 'p-step-header',
number: 'p-step-number',
title: 'p-step-title'
};
class StepStyle extends BaseStyle {
name = 'step';
classes = classes;
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: StepStyle, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: StepStyle });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: StepStyle, decorators: [{
type: Injectable
}] });
/**
*
* Stepper is a component that streamlines a wizard-like workflow, organizing content into coherent steps and visually guiding users through a numbered progression in a multi-step process.
*
* [Live Demo](https://www.primeng.org/stepper/)
*
* @module stepstyle
*
*/
var StepClasses;
(function (StepClasses) {
/**
* Class name of the root element
*/
StepClasses["root"] = "p-step";
/**
* Class name of the header element
*/
StepClasses["header"] = "p-step-header";
/**
* Class name of the number element
*/
StepClasses["number"] = "p-step-number";
/**
* Class name of the title element
*/
StepClasses["title"] = "p-step-title";
})(StepClasses || (StepClasses = {}));
class StepList extends BaseComponent {
steps = contentChildren(forwardRef(() => Step), ...(ngDevMode ? [{ debugName: "steps" }] : []));
_componentStyle = inject(StepListStyle);
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: StepList, deps: null, target: i0.ɵɵFactoryTarget.Component });
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.1.3", type: StepList, isStandalone: true, selector: "p-step-list", host: { properties: { "class": "cx(\"root\")" } }, providers: [StepListStyle], queries: [{ propertyName: "steps", predicate: i0.forwardRef(() => Step), isSignal: true }], usesInheritance: true, ngImport: i0, template: ` <ng-content></ng-content>`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: StepList, decorators: [{
type: Component,
args: [{
selector: 'p-step-list',
standalone: true,
imports: [CommonModule],
template: ` <ng-content></ng-content>`,
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
host: {
'[class]': 'cx("root")'
},
providers: [StepListStyle]
}]
}] });
class StepperSeparator extends BaseComponent {
_componentStyle = inject(StepperStyle);
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: StepperSeparator, deps: null, target: i0.ɵɵFactoryTarget.Component });
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.3", type: StepperSeparator, isStandalone: true, selector: "p-stepper-separator", host: { properties: { "class": "cx(\"separator\")" } }, providers: [StepperStyle], usesInheritance: true, ngImport: i0, template: ` <ng-content></ng-content>`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: StepperSeparator, decorators: [{
type: Component,
args: [{
selector: 'p-stepper-separator',
standalone: true,
imports: [CommonModule],
template: ` <ng-content></ng-content>`,
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
host: {
'[class]': 'cx("separator")'
},
providers: [StepperStyle]
}]
}] });
/**
* StepItem is a helper component for Stepper component used in vertical orientation.
* @group Components
*/
class StepItem extends BaseComponent {
pcStepper = inject(forwardRef(() => Stepper));
/**
* Value of step.
* @type {<number | undefined>}
* @defaultValue undefined
* @group Props
*/
value = model(...(ngDevMode ? [undefined, { debugName: "value" }] : []));
isActive = computed(() => this.pcStepper.value() === this.value(), ...(ngDevMode ? [{ debugName: "isActive" }] : []));
step = contentChild(forwardRef(() => Step), ...(ngDevMode ? [{ debugName: "step" }] : []));
stepPanel = contentChild(forwardRef(() => StepPanel), ...(ngDevMode ? [{ debugName: "stepPanel" }] : []));
constructor() {
super();
effect(() => {
this.step().value.set(this.value());
});
effect(() => {
this.stepPanel().value.set(this.value());
});
}
_componentStyle = inject(StepItemStyle);
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: StepItem, deps: [], target: i0.ɵɵFactoryTarget.Component });
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.1.3", type: StepItem, isStandalone: true, selector: "p-step-item", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { properties: { "class": "cx(\"root\")", "attr.data-p-active": "isActive()" } }, providers: [StepItemStyle], queries: [{ propertyName: "step", first: true, predicate: i0.forwardRef(() => Step), descendants: true, isSignal: true }, { propertyName: "stepPanel", first: true, predicate: i0.forwardRef(() => StepPanel), descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: ` <ng-content></ng-content>`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: StepItem, decorators: [{
type: Component,
args: [{
selector: 'p-step-item',
standalone: true,
imports: [CommonModule],
template: ` <ng-content></ng-content>`,
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
host: {
'[class]': 'cx("root")',
'[attr.data-p-active]': 'isActive()'
},
providers: [StepItemStyle]
}]
}], ctorParameters: () => [] });
/**
* Step is a helper component for Stepper component.
* @group Components
*/
class Step extends BaseComponent {
pcStepper = inject(forwardRef(() => Stepper));
/**
* Active value of stepper.
* @type {number}
* @defaultValue undefined
* @group Props
*/
value = model(...(ngDevMode ? [undefined, { debugName: "value" }] : []));
/**
* Whether the step is disabled.
* @type {boolean}
* @defaultValue false
* @group Props
*/
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled", transform: (v) => transformToBoolean(v) }] : [{
transform: (v) => transformToBoolean(v)
}]));
active = computed(() => this.pcStepper.isStepActive(this.value()), ...(ngDevMode ? [{ debugName: "active" }] : []));
isStepDisabled = computed(() => !this.active() && (this.pcStepper.linear() || this.disabled()), ...(ngDevMode ? [{ debugName: "isStepDisabled" }] : []));
id = computed(() => `${this.pcStepper.id()}_step_${this.value()}`, ...(ngDevMode ? [{ debugName: "id" }] : []));
ariaControls = computed(() => `${this.pcStepper.id()}_steppanel_${this.value()}`, ...(ngDevMode ? [{ debugName: "ariaControls" }] : []));
isSeparatorVisible = computed(() => {
if (this.pcStepper.stepList()) {
const steps = this.pcStepper.stepList().steps();
const index = steps.indexOf(this);
const stepLen = steps.length;
return index !== stepLen - 1;
}
else {
return false;
}
}, ...(ngDevMode ? [{ debugName: "isSeparatorVisible" }] : []));
/**
* Content template.
* @type {TemplateRef<StepContentTemplateContext>}
* @group Templates
*/
content;
templates;
_contentTemplate;
_componentStyle = inject(StepStyle);
ngAfterContentInit() {
this.templates?.forEach((item) => {
switch (item.getType()) {
case 'content':
this._contentTemplate = item.template;
break;
}
});
}
onStepClick() {
this.pcStepper.updateValue(this.value());
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: Step, deps: null, target: i0.ɵɵFactoryTarget.Component });
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.3", type: Step, isStandalone: true, selector: "p-step", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { properties: { "class": "cx(\"root\")", "attr.aria-current": "active() ? \"step\" : undefined", "attr.role": "\"presentation\"", "attr.data-p-active": "active()", "attr.data-p-disabled": "isStepDisabled()", "attr.data-pc-name": "\"step\"" } }, providers: [StepStyle], queries: [{ propertyName: "content", first: true, predicate: ["content"] }, { propertyName: "templates", predicate: PrimeTemplate }], usesInheritance: true, ngImport: i0, template: `
(!content && !_contentTemplate) {
<button [attr.id]="id()" [class]="cx('header')" [attr.role]="'tab'" [tabindex]="isStepDisabled() ? -1 : undefined" [attr.aria-controls]="ariaControls()" [disabled]="isStepDisabled()" (click)="onStepClick()" type="button">
<span [class]="cx('number')">{{ value() }}</span>
<span [class]="cx('title')">
<ng-content></ng-content>
</span>
</button>
(isSeparatorVisible()) {
<p-stepper-separator />
}
} {
<ng-container *ngTemplateOutlet="content || _contentTemplate; context: { activateCallback: onStepClick.bind(this), value: value(), active: active() }"></ng-container>
(isSeparatorVisible()) {
<p-stepper-separator />
}
}
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: StepperSeparator, selector: "p-stepper-separator" }, { kind: "ngmodule", type: SharedModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: Step, decorators: [{
type: Component,
args: [{
selector: 'p-step',
standalone: true,
imports: [CommonModule, StepperSeparator, SharedModule],
template: `
(!content && !_contentTemplate) {
<button [attr.id]="id()" [class]="cx('header')" [attr.role]="'tab'" [tabindex]="isStepDisabled() ? -1 : undefined" [attr.aria-controls]="ariaControls()" [disabled]="isStepDisabled()" (click)="onStepClick()" type="button">
<span [class]="cx('number')">{{ value() }}</span>
<span [class]="cx('title')">
<ng-content></ng-content>
</span>
</button>
(isSeparatorVisible()) {
<p-stepper-separator />
}
} {
<ng-container *ngTemplateOutlet="content || _contentTemplate; context: { activateCallback: onStepClick.bind(this), value: value(), active: active() }"></ng-container>
(isSeparatorVisible()) {
<p-stepper-separator />
}
}
`,
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
host: {
'[class]': 'cx("root")',
'[attr.aria-current]': 'active() ? "step" : undefined',
'[attr.role]': '"presentation"',
'[attr.data-p-active]': 'active()',
'[attr.data-p-disabled]': 'isStepDisabled()',
'[attr.data-pc-name]': '"step"'
},
providers: [StepStyle]
}]
}], propDecorators: { content: [{
type: ContentChild,
args: ['content', { descendants: false }]
}], templates: [{
type: ContentChildren,
args: [PrimeTemplate]
}] } });
/**
* StepPanel is a helper component for Stepper component.
* @group Components
*/
class StepPanel extends BaseComponent {
pcStepper = inject(forwardRef(() => Stepper));
transitionOptions = computed(() => this.pcStepper.transitionOptions(), ...(ngDevMode ? [{ debugName: "transitionOptions" }] : []));
/**
* Active value of stepper.
* @type {number}
* @defaultValue undefined
* @group Props
*/
value = model(undefined, ...(ngDevMode ? [{ debugName: "value" }] : []));
active = computed(() => this.pcStepper.value() === this.value(), ...(ngDevMode ? [{ debugName: "active" }] : []));
visible = signal(this.active(), ...(ngDevMode ? [{ debugName: "visible" }] : []));
isVisible = computed(() => this.active() || (this.isVertical() && this.visible()), ...(ngDevMode ? [{ debugName: "isVisible" }] : []));
ariaControls = computed(() => `${this.pcStepper.id()}_step_${this.value()}`, ...(ngDevMode ? [{ debugName: "ariaControls" }] : []));
id = computed(() => `${this.pcStepper.id()}_steppanel_${this.value()}`, ...(ngDevMode ? [{ debugName: "id" }] : []));
isVertical = computed(() => this.pcStepper.stepItems().length > 0, ...(ngDevMode ? [{ debugName: "isVertical" }] : []));
isSeparatorVisible = computed(() => {
if (this.pcStepper.stepItems()) {
const stepLen = this.pcStepper.stepItems().length;
const stepPanelElements = find(this.pcStepper.el.nativeElement, '[data-pc-name="steppanel"]');
const index = findIndexInList(this.el.nativeElement, stepPanelElements);
return index !== stepLen - 1;
}
}, ...(ngDevMode ? [{ debugName: "isSeparatorVisible" }] : []));
/**
* Content template.
* @param {StepPanelContentTemplateContext} context - Context of the template
* @see {@link StepPanelContentTemplateContext}
* @group Templates
*/
contentTemplate;
templates;
_contentTemplate;
_componentStyle = inject(StepPanelStyle);
ngAfterContentInit() {
this.templates?.forEach((item) => {
switch (item.getType()) {
case 'content':
this._contentTemplate = item.template;
break;
}
});
}
onAnimationStart(event) {
if (event.toState === 'visible') {
this.visible.set(true);
}
}
onAnimationEnd(event) {
if (event.toState === 'hidden') {
this.visible.set(false);
}
}
updateValue(value) {
this.pcStepper.updateValue(value);
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: StepPanel, deps: null, target: i0.ɵɵFactoryTarget.Component });
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.3", type: StepPanel, isStandalone: true, selector: "p-step-panel", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { properties: { "class": "cx(\"root\")", "attr.role": "\"tabpanel\"", "attr.aria-controls": "ariaControls()", "attr.id": "id()", "attr.data-p-active": "active()", "attr.data-pc-name": "\"steppanel\"" } }, providers: [StepPanelStyle], queries: [{ propertyName: "contentTemplate", first: true, predicate: ["content"], descendants: true }, { propertyName: "templates", predicate: PrimeTemplate }], usesInheritance: true, ngImport: i0, template: `
(isSeparatorVisible()) {
<p-stepper-separator />
}
<div
[class]="cx('content')"
[ ]="isVertical() ? (active() ? { value: 'visible', params: { transitionParams: transitionOptions() } } : { value: 'hidden', params: { transitionParams: transitionOptions() } }) : undefined"
( .start)="onAnimationStart($event)"
( .done)="onAnimationEnd($event)"
>
(isVisible()) {
<ng-container *ngTemplateOutlet="contentTemplate || _contentTemplate; context: { activateCallback: updateValue.bind(this), value: value(), active: active() }"></ng-container>
}
</div>
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: StepperSeparator, selector: "p-stepper-separator" }, { kind: "ngmodule", type: SharedModule }], animations: [
trigger('content', [
state('hidden', style$1({
height: '0'
})),
state('visible', style$1({
height: '*'
})),
transition('visible <=> hidden', [animate('400ms cubic-bezier(0.86, 0, 0.07, 1)')]),
transition('void => *', animate(0))
])
], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: StepPanel, decorators: [{
type: Component,
args: [{
selector: 'p-step-panel',
standalone: true,
imports: [CommonModule, StepperSeparator, SharedModule],
template: `
(isSeparatorVisible()) {
<p-stepper-separator />
}
<div
[class]="cx('content')"
[ ]="isVertical() ? (active() ? { value: 'visible', params: { transitionParams: transitionOptions() } } : { value: 'hidden', params: { transitionParams: transitionOptions() } }) : undefined"
( .start)="onAnimationStart($event)"
( .done)="onAnimationEnd($event)"
>
(isVisible()) {
<ng-container *ngTemplateOutlet="contentTemplate || _contentTemplate; context: { activateCallback: updateValue.bind(this), value: value(), active: active() }"></ng-container>
}
</div>
`,
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
host: {
'[class]': 'cx("root")',
'[attr.role]': '"tabpanel"',
'[attr.aria-controls]': 'ariaControls()',
'[attr.id]': 'id()',
'[attr.data-p-active]': 'active()',
'[attr.data-pc-name]': '"steppanel"'
},
animations: [
trigger('content', [
state('hidden', style$1({
height: '0'
})),
state('visible', style$1({
height: '*'
})),
transition('visible <=> hidden', [animate('400ms cubic-bezier(0.86, 0, 0.07, 1)')]),
transition('void => *', animate(0))
])
],
providers: [StepPanelStyle]
}]
}], propDecorators: { contentTemplate: [{
type: ContentChild,
args: ['content']
}], templates: [{
type: ContentChildren,
args: [PrimeTemplate]
}] } });
class StepPanels extends BaseComponent {
_componentStyle = inject(StepPanelsStyle);
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: StepPanels, deps: null, target: i0.ɵɵFactoryTarget.Component });
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.3", type: StepPanels, isStandalone: true, selector: "p-step-panels", host: { properties: { "class": "cx(\"root\")" } }, providers: [StepPanelsStyle], usesInheritance: true, ngImport: i0, template: ` <ng-content></ng-content>`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: SharedModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: StepPanels, decorators: [{
type: Component,
args: [{
selector: 'p-step-panels',
standalone: true,
imports: [CommonModule, SharedModule],
template: ` <ng-content></ng-content>`,
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
host: {
'[class]': 'cx("root")'
},
providers: [StepPanelsStyle]
}]
}] });
/**
* Stepper is a component that streamlines a wizard-like workflow, organizing content into coherent steps and visually guiding users through a numbered progression in a multistep process.
* @group Components
*/
class Stepper extends BaseComponent {
/**
* A model that can hold a numeric value or be undefined.
* @defaultValue undefined
* @type {ModelSignal<number | undefined>}
* @group Props
*/
value = model(undefined, ...(ngDevMode ? [{ debugName: "value" }] : []));
/**
* A boolean variable that captures user input.
* @defaultValue false
* @type {InputSignalWithTransform<any, boolean >}
* @group Props
*/
linear = input(false, ...(ngDevMode ? [{ debugName: "linear", transform: (v) => transformToBoolean(v) }] : [{
transform: (v) => transformToBoolean(v)
}]));
/**
* Transition options of the animation.
* @defaultValue 400ms cubic-bezier(0.86, 0, 0.07, 1)
* @type {InputSignal<string >}
* @group Props
*/
transitionOptions = input('400ms cubic-bezier(0.86, 0, 0.07, 1)', ...(ngDevMode ? [{ debugName: "transitionOptions" }] : []));
_componentStyle = inject(StepperStyle);
id = signal(uuid('pn_id_'), ...(ngDevMode ? [{ debugName: "id" }] : []));
stepItems = contentChildren(StepItem, ...(ngDevMode ? [{ debugName: "stepItems" }] : []));
steps = contentChildren(Step, ...(ngDevMode ? [{ debugName: "steps" }] : []));
stepList = contentChild(StepList, ...(ngDevMode ? [{ debugName: "stepList" }] : []));
updateValue(value) {
this.value.set(value);
}
isStepActive(value) {
return this.value() === value;
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: Stepper, deps: null, target: i0.ɵɵFactoryTarget.Component });
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.1.3", type: Stepper, isStandalone: true, selector: "p-stepper", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, linear: { classPropertyName: "linear", publicName: "linear", isSignal: true, isRequired: false, transformFunction: null }, transitionOptions: { classPropertyName: "transitionOptions", publicName: "transitionOptions", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { properties: { "class": "cx(\"root\")", "attr.role": "\"tablist\"", "attr.id": "id()" } }, providers: [StepperStyle], queries: [{ propertyName: "stepItems", predicate: StepItem, isSignal: true }, { propertyName: "steps", predicate: Step, isSignal: true }, { propertyName: "stepList", first: true, predicate: StepList, descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: ` <ng-content></ng-content>`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: SharedModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: Stepper, decorators: [{
type: Component,
args: [{
selector: 'p-stepper',
standalone: true,
imports: [CommonModule, SharedModule],
template: ` <ng-content></ng-content>`,
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
providers: [StepperStyle],
host: {
'[class]': 'cx("root")',
'[attr.role]': '"tablist"',
'[attr.id]': 'id()'
}
}]
}] });
class StepperModule {
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: StepperModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.1.3", ngImport: i0, type: StepperModule, imports: [Stepper, StepList, StepPanels, StepPanel, StepItem, Step, StepperSeparator, SharedModule], exports: [Stepper, StepList, StepPanels, StepPanel, StepItem, Step, StepperSeparator, SharedModule] });
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: StepperModule, imports: [Stepper, StepList, StepPanels, StepPanel, StepItem, Step, StepperSeparator, SharedModule, SharedModule] });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: StepperModule, decorators: [{
type: NgModule,
args: [{
imports: [Stepper, StepList, StepPanels, StepPanel, StepItem, Step, StepperSeparator, SharedModule],
exports: [Stepper, StepList, StepPanels, StepPanel, StepItem, Step, StepperSeparator, SharedModule]
}]
}] });
/**
* Generated bundle index. Do not edit.
*/
export { Step, StepItem, StepList, StepPanel, StepPanels, Stepper, StepperClasses, StepperModule, StepperSeparator, StepperStyle };
//# sourceMappingURL=primeng-stepper.mjs.map