Skip to content

Commit 7be0942

Browse files
arthur-polidoriopedrodominguesp
authored andcommitted
feat(page-default): implementa suporte a subníveis no dropdown
Implementa suporte a utilização de subníveis no dropdown. Fixes: DTHFUI-12194
1 parent d124f81 commit 7be0942

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed
Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
1-
import { PoPopupAction } from '../../po-popup/po-popup-action.interface';
1+
import { PoDropdownAction } from '../../po-dropdown';
22

33
/**
44
* @description
55
* Interface para as ações dos componentes po-page-default e po-page-list.
66
*
7-
* > As propriedades `selected`, `separator` e `type` serão vistas a partir da terceira ação e somente quando
8-
* definir quatro ações ou mais.
7+
* > Quando o array de actions possui quatro ou mais registros, os dois últimos e os seguintes são automaticamente agrupados no po-dropdown.
8+
* A partir desse ponto, as propriedades `selected`, `separator`, `type` e `subItems` passam a ter efeito apenas nas ações exibidas dentro do dropdown, ou seja, a partir da terceira ação.
9+
* Dessa forma, o uso de subItems (agrupadores dentro do dropdown) só terá efeito quando houver pelo menos quatro ações definidas.
910
*
10-
* @docsExtends PoPopupAction
11+
* @docsExtends PoDropdownAction
1112
*
1213
* @ignoreExtendedDescription
1314
*
1415
* @usedBy PoPageDefaultComponent, PoPageListComponent
1516
*/
16-
export interface PoPageAction extends PoPopupAction {}
17+
export interface PoPageAction extends PoDropdownAction {}

projects/ui/src/lib/components/po-page/po-page-default/samples/sample-po-page-default-dashboard/sample-po-page-default-dashboard.component.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,15 @@ export class SamplePoPageDefaultDashboardComponent implements OnInit {
4040
public readonly actions: Array<PoPageAction> = [
4141
{ label: 'Share', action: this.modalOpen.bind(this), icon: 'an an-share' },
4242
{ label: 'GitHub', url: 'https://github.com/po-ui/po-angular' },
43+
{
44+
label: 'More info',
45+
subItems: [
46+
{
47+
label: 'po-dropdown documentation',
48+
url: 'https://po-ui.io/documentation/po-dropdown'
49+
}
50+
]
51+
},
4352
{ label: 'Components', url: '/documentation' },
4453
{ label: 'Disable notification', action: this.disableNotification.bind(this), disabled: () => this.isSubscribed }
4554
];

0 commit comments

Comments
 (0)