Refactor #4739 - For Steps & Fixed #4778 - Steps: new activeStep property

This commit is contained in:
tugcekucukoglu 2023-11-08 15:52:43 +03:00
parent ba8f58d1ac
commit ca572864cf
4 changed files with 52 additions and 44 deletions

View file

@ -27,6 +27,7 @@ const css = `
align-items: center;
overflow: hidden;
text-decoration: none;
cursor: pointer;
}
.p-steps.p-steps-readonly .p-steps-item {
@ -59,20 +60,14 @@ const css = `
const classes = {
root: ({ props }) => ['p-steps p-component', { 'p-readonly': props.readonly }],
menu: 'p-steps-list',
menuitem: ({ instance, item }) => [
menuitem: ({ instance, item, index }) => [
'p-steps-item',
{
'p-highlight p-steps-current': instance.isActive(item),
'p-disabled': instance.isItemDisabled(item)
}
],
action: ({ props, isActive, isExactActive }) => [
'p-menuitem-link',
{
'router-link-active': isActive,
'router-link-active-exact': props.exact && isExactActive
'p-highlight p-steps-current': instance.isActive(index),
'p-disabled': instance.isItemDisabled(item, index)
}
],
action: 'p-menuitem-link',
step: 'p-steps-number',
label: 'p-steps-title'
};