2023-03-01 13:04:38 +00:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
* Steps components is an indicator for the steps in a wizard workflow. Example below uses nested routes with Steps.
|
|
|
|
*
|
|
|
|
* [Live Demo](https://www.primevue.org/steps/)
|
|
|
|
*
|
|
|
|
* @module steps
|
|
|
|
*
|
|
|
|
*/
|
2022-09-06 12:03:37 +00:00
|
|
|
import { VNode } from 'vue';
|
2023-07-06 11:17:08 +00:00
|
|
|
import { ComponentHooks } from '../basecomponent';
|
2022-09-06 12:03:37 +00:00
|
|
|
import { MenuItem } from '../menuitem';
|
2023-09-05 08:50:46 +00:00
|
|
|
import { PassThroughOptions } from '../passthrough';
|
2023-09-05 11:28:04 +00:00
|
|
|
import { ClassComponent, GlobalComponentConstructor, PassThrough } from '../ts-helpers';
|
2022-09-06 12:03:37 +00:00
|
|
|
|
2023-07-11 22:42:43 +00:00
|
|
|
export declare type StepsPassThroughOptionType = StepsPassThroughAttributes | ((options: StepsPassThroughMethodOptions) => StepsPassThroughAttributes | string) | string | null | undefined;
|
2023-04-26 09:58:46 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Custom passthrough(pt) option method.
|
|
|
|
*/
|
|
|
|
export interface StepsPassThroughMethodOptions {
|
2023-09-05 06:50:04 +00:00
|
|
|
/**
|
|
|
|
* Defines instance.
|
|
|
|
*/
|
2023-07-06 12:01:33 +00:00
|
|
|
instance: any;
|
2023-09-05 06:50:04 +00:00
|
|
|
/**
|
|
|
|
* Defines valid properties.
|
|
|
|
*/
|
2023-04-26 09:58:46 +00:00
|
|
|
props: StepsProps;
|
2023-09-05 06:50:04 +00:00
|
|
|
/**
|
|
|
|
* Defines current options.
|
|
|
|
*/
|
2023-07-24 10:57:49 +00:00
|
|
|
context: StepsContext;
|
2023-12-05 11:06:32 +00:00
|
|
|
/**
|
|
|
|
* Defines parent options.
|
|
|
|
*/
|
|
|
|
parent: any;
|
2023-09-05 08:50:46 +00:00
|
|
|
/**
|
|
|
|
* Defines passthrough(pt) options in global config.
|
|
|
|
*/
|
|
|
|
global: object | undefined;
|
2023-04-26 09:58:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Custom passthrough(pt) options.
|
|
|
|
* @see {@link StepsProps.pt}
|
|
|
|
*/
|
|
|
|
export interface StepsPassThroughOptions {
|
|
|
|
/**
|
2023-08-01 14:01:12 +00:00
|
|
|
* Used to pass attributes to the root's DOM element.
|
2023-04-26 09:58:46 +00:00
|
|
|
*/
|
|
|
|
root?: StepsPassThroughOptionType;
|
|
|
|
/**
|
2023-08-01 14:01:12 +00:00
|
|
|
* Used to pass attributes to the list's DOM element.
|
2023-04-26 09:58:46 +00:00
|
|
|
*/
|
|
|
|
menu?: StepsPassThroughOptionType;
|
|
|
|
/**
|
2023-08-01 14:01:12 +00:00
|
|
|
* Used to pass attributes to the list item's DOM element.
|
2023-04-26 09:58:46 +00:00
|
|
|
*/
|
|
|
|
menuitem?: StepsPassThroughOptionType;
|
|
|
|
/**
|
2023-08-01 14:01:12 +00:00
|
|
|
* Used to pass attributes to the action's DOM element.
|
2023-04-26 09:58:46 +00:00
|
|
|
*/
|
|
|
|
action?: StepsPassThroughOptionType;
|
|
|
|
/**
|
2023-08-01 14:01:12 +00:00
|
|
|
* Used to pass attributes to the step's DOM element.
|
2023-04-26 09:58:46 +00:00
|
|
|
*/
|
|
|
|
step?: StepsPassThroughOptionType;
|
|
|
|
/**
|
2023-08-01 14:01:12 +00:00
|
|
|
* Used to pass attributes to the label's DOM element.
|
2023-04-26 09:58:46 +00:00
|
|
|
*/
|
|
|
|
label?: StepsPassThroughOptionType;
|
2023-07-06 11:09:01 +00:00
|
|
|
/**
|
2023-11-07 06:16:39 +00:00
|
|
|
* Used to manage all lifecycle hooks.
|
2023-07-06 11:09:01 +00:00
|
|
|
* @see {@link BaseComponent.ComponentHooks}
|
|
|
|
*/
|
|
|
|
hooks?: ComponentHooks;
|
2023-04-26 09:58:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Custom passthrough attributes for each DOM elements
|
|
|
|
*/
|
|
|
|
export interface StepsPassThroughAttributes {
|
|
|
|
[key: string]: any;
|
|
|
|
}
|
|
|
|
|
2023-07-24 10:57:49 +00:00
|
|
|
/**
|
|
|
|
* Defines current options in Steps component.
|
|
|
|
*/
|
|
|
|
export interface StepsContext {
|
2023-07-25 09:11:49 +00:00
|
|
|
/**
|
|
|
|
* Current menuitem
|
|
|
|
*/
|
|
|
|
item: any;
|
2023-07-24 10:57:49 +00:00
|
|
|
/**
|
|
|
|
* Index of the menuitem.
|
|
|
|
*/
|
|
|
|
index: number;
|
|
|
|
/**
|
|
|
|
* Current active state of menuitem as a boolean.
|
|
|
|
* @defaultValue false
|
|
|
|
*/
|
|
|
|
active: boolean;
|
|
|
|
/**
|
|
|
|
* Current disabled state of menuitem as a boolean.
|
|
|
|
* @defaultValue false
|
|
|
|
*/
|
|
|
|
disabled: boolean;
|
|
|
|
}
|
|
|
|
|
2023-09-04 09:16:03 +00:00
|
|
|
/**
|
|
|
|
* Defines valid router binding props in Steps component.
|
|
|
|
*/
|
|
|
|
export interface StepsRouterBindProps {
|
|
|
|
/**
|
|
|
|
* Action element binding
|
|
|
|
*/
|
|
|
|
action: object;
|
|
|
|
/**
|
|
|
|
* Icon element binding
|
|
|
|
*/
|
2023-10-31 14:26:05 +00:00
|
|
|
step: object;
|
2023-09-04 09:16:03 +00:00
|
|
|
/**
|
|
|
|
* Label element binding
|
|
|
|
*/
|
|
|
|
label: object;
|
|
|
|
}
|
|
|
|
|
2023-03-01 13:04:38 +00:00
|
|
|
/**
|
|
|
|
* Defines valid properties in Steps component.
|
|
|
|
*/
|
2022-09-06 12:03:37 +00:00
|
|
|
export interface StepsProps {
|
|
|
|
/**
|
|
|
|
* Unique identifier of the element.
|
|
|
|
*/
|
|
|
|
id?: string | undefined;
|
|
|
|
/**
|
|
|
|
* An array of menuitems.
|
|
|
|
*/
|
|
|
|
model?: MenuItem[] | undefined;
|
|
|
|
/**
|
|
|
|
* Whether the items are clickable or not.
|
2023-03-01 13:04:38 +00:00
|
|
|
* @defaultValue true
|
2022-09-06 12:03:37 +00:00
|
|
|
*/
|
|
|
|
readonly?: boolean | undefined;
|
|
|
|
/**
|
|
|
|
* Whether to apply 'router-link-active-exact' class if route exactly matches the item path.
|
2023-11-08 12:52:43 +00:00
|
|
|
* @deprecated since v3.40.0.
|
2023-03-01 13:04:38 +00:00
|
|
|
* @defaultValue true
|
2022-09-06 12:03:37 +00:00
|
|
|
*/
|
|
|
|
exact?: boolean | undefined;
|
2023-11-08 12:52:43 +00:00
|
|
|
/**
|
|
|
|
* Active step index of menuitem.
|
|
|
|
* @defaultValue 0
|
|
|
|
*/
|
|
|
|
activeStep?: number | undefined;
|
2023-04-26 09:58:46 +00:00
|
|
|
/**
|
2023-08-01 14:01:12 +00:00
|
|
|
* Used to pass attributes to DOM elements inside the component.
|
2023-04-26 09:58:46 +00:00
|
|
|
* @type {StepsPassThroughOptions}
|
|
|
|
*/
|
2023-09-05 11:28:04 +00:00
|
|
|
pt?: PassThrough<StepsPassThroughOptions>;
|
2023-09-05 08:50:46 +00:00
|
|
|
/**
|
|
|
|
* Used to configure passthrough(pt) options of the component.
|
|
|
|
* @type {PassThroughOptions}
|
|
|
|
*/
|
|
|
|
ptOptions?: PassThroughOptions;
|
2023-05-30 11:58:41 +00:00
|
|
|
/**
|
|
|
|
* When enabled, it removes component related styles in the core.
|
|
|
|
* @defaultValue false
|
|
|
|
*/
|
|
|
|
unstyled?: boolean;
|
2022-09-06 12:03:37 +00:00
|
|
|
}
|
|
|
|
|
2023-03-01 13:04:38 +00:00
|
|
|
/**
|
|
|
|
* Defines valid slots in Steps component.
|
|
|
|
*/
|
2022-09-06 12:03:37 +00:00
|
|
|
export interface StepsSlots {
|
|
|
|
/**
|
|
|
|
* Custom item template.
|
|
|
|
* @param {Object} scope - item slot's params.
|
|
|
|
*/
|
2023-03-01 13:04:38 +00:00
|
|
|
item(scope: {
|
2022-09-06 12:03:37 +00:00
|
|
|
/**
|
|
|
|
* Menuitem instance
|
|
|
|
*/
|
|
|
|
item: MenuItem;
|
2023-11-09 08:44:31 +00:00
|
|
|
/**
|
|
|
|
* Current active state of the menuitem
|
|
|
|
*/
|
|
|
|
active: boolean;
|
2023-08-30 14:29:26 +00:00
|
|
|
/**
|
|
|
|
* Label property of the menuitem
|
|
|
|
*/
|
|
|
|
label: string | ((...args: any) => string) | undefined;
|
|
|
|
/**
|
|
|
|
* Order of the menuitem
|
|
|
|
*/
|
|
|
|
index: number;
|
|
|
|
/**
|
|
|
|
* Binding properties of the menuitem
|
|
|
|
*/
|
2023-09-04 09:16:03 +00:00
|
|
|
props: StepsRouterBindProps;
|
2023-03-01 13:04:38 +00:00
|
|
|
}): VNode[];
|
2022-09-06 12:03:37 +00:00
|
|
|
}
|
|
|
|
|
2023-03-01 13:04:38 +00:00
|
|
|
/**
|
|
|
|
* Defines valid emits in Steps component.
|
|
|
|
*/
|
|
|
|
export interface StepsEmits {}
|
2022-09-06 12:03:37 +00:00
|
|
|
|
2023-03-01 13:04:38 +00:00
|
|
|
/**
|
|
|
|
* **PrimeVue - Steps**
|
|
|
|
*
|
|
|
|
* _Steps components is an indicator for the steps in a wizard workflow. Example below uses nested routes with Steps._
|
|
|
|
*
|
|
|
|
* [Live Demo](https://www.primevue.org/steps/)
|
|
|
|
* --- ---
|
2023-03-03 10:55:20 +00:00
|
|
|
* ![PrimeVue](https://primefaces.org/cdn/primevue/images/logo-100.png)
|
2023-03-01 13:04:38 +00:00
|
|
|
*
|
|
|
|
* @group Component
|
|
|
|
*
|
|
|
|
*/
|
2022-09-14 11:26:01 +00:00
|
|
|
declare class Steps extends ClassComponent<StepsProps, StepsSlots, StepsEmits> {}
|
2022-09-06 12:03:37 +00:00
|
|
|
|
|
|
|
declare module '@vue/runtime-core' {
|
|
|
|
interface GlobalComponents {
|
2022-09-14 11:26:01 +00:00
|
|
|
Steps: GlobalComponentConstructor<Steps>;
|
2022-09-06 12:03:37 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default Steps;
|