feat(context-menu): implementa componente po-context-menu e melhorias em po-menu/po-tabs#2782
feat(context-menu): implementa componente po-context-menu e melhorias em po-menu/po-tabs#2782anderson-gregorio-totvs wants to merge 4 commits intomasterfrom
Conversation
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
d3eebb2 to
d91503d
Compare
projects/ui/src/lib/components/po-context-menu/po-context-menu-base.component.ts
Outdated
Show resolved
Hide resolved
projects/ui/src/lib/components/po-context-menu/po-context-menu-base.component.ts
Outdated
Show resolved
Hide resolved
projects/ui/src/lib/components/po-context-menu/po-context-menu-base.component.ts
Outdated
Show resolved
Hide resolved
projects/ui/src/lib/components/po-context-menu/po-context-menu-item.interface.ts
Outdated
Show resolved
Hide resolved
projects/ui/src/lib/components/po-context-menu/po-context-menu-item.interface.ts
Outdated
Show resolved
Hide resolved
projects/ui/src/lib/components/po-context-menu/po-context-menu.module.ts
Outdated
Show resolved
Hide resolved
projects/ui/src/lib/components/po-context-menu/po-context-menu.component.ts
Show resolved
Hide resolved
projects/ui/src/lib/components/po-context-menu/po-context-menu.component.ts
Outdated
Show resolved
Hide resolved
projects/ui/src/lib/components/po-context-menu/po-context-menu.component.ts
Outdated
Show resolved
Hide resolved
projects/ui/src/lib/components/po-context-menu/po-context-menu.component.ts
Show resolved
Hide resolved
d91503d to
0ece150
Compare
0ece150 to
a120cd1
Compare
| public activateTab(id: string) { | ||
| const tab = this.tabsChildrenArray.find(x => x.id === id); | ||
|
|
||
| if (tab) { | ||
| this.selectedTab(tab); | ||
| } | ||
| } |
There was a problem hiding this comment.
🔴 activateTab does not deactivate the previously active tab for non-dropdown tabs
The new activateTab method calls selectedTab, which only invokes onTabActive (responsible for deactivating the previous tab and emitting activatedTab) when the target tab is in the overflow dropdown (po-tabs.component.ts:259-261). For tabs that are already visible (not in the dropdown), onTabActive is never called. This means:
- The previously active tab is never deactivated, resulting in two simultaneously active tabs.
- The
activatedTaboutput event is never emitted (po-tabs.component.ts:219).
This directly breaks the bidirectional sync in sample-po-context-menu-user, where onItemSelected calls this.tab().activateTab(value.label) and onActivatedTab listens for (p-activated-tab) to sync the context menu selection back.
| public activateTab(id: string) { | |
| const tab = this.tabsChildrenArray.find(x => x.id === id); | |
| if (tab) { | |
| this.selectedTab(tab); | |
| } | |
| } | |
| public activateTab(id: string) { | |
| const tab = this.tabsChildrenArray.find(x => x.id === id); | |
| if (tab) { | |
| this.onTabActive(tab); | |
| this.selectedTab(tab); | |
| } | |
| } |
Was this helpful? React with 👍 or 👎 to provide feedback.
Summary
Implementa o novo componente
po-context-menue adiciona melhorias nos componentespo-menuepo-tabs. Também refatora o processador de documentação para inferir automaticamente inputs/outputs baseados em signals (input(),output(),model()), removendo a necessidade das tags JSDoc@Input/@Outputmanuais.po-context-menu (novo)
contextTitle,title,items,expanded(model),itemSelected(output)PoContextMenuItemcomlabel,iconeactionpo-menu
p-expandedvia signal (expanded = output<boolean>)p-togglevia signal (toggleChange = output<boolean>)setCollapsed()centraliza mudanças decollapsede emitetoggleChange@Directivepara@Componentcom TestBedpo-tabs
activateTab(id)para ativar aba programaticamentep-activated-tabvia signal noPoTabBaseComponentidpromovido de propriedade interna para@Input('id')@Directivepara@Componentcom TestBedDocumentação (portal)
functions.jsagora infereinput(),input.required(),output()emodel()automaticamente@Input/@Outputmanuais de ~15 componentes (po-button, po-skeleton, po-popover, po-widget, po-field/*, etc.)Input/Outputdeconfiguration.jsReview & Testing Checklist for Human
@Input('id')nopo-tab-base: Faz shadow do atributo HTML nativoid. Verificar se isso causa efeitos colaterais em templates existentes que já usamidno elemento<po-tab>. Possível breaking change.@Input/@Output. Rodarnpm run build:portale inspecionar a saída. Signal outputs são tipados comoEventEmitterno processador — confirmar que o portal renderiza corretamente.Plano de teste sugerido:
npm run test:ui— confirmar que todos os ~8688 testes passamnpm run buildseguido denpm run build:portal— verificar a geração da documentaçãopo-context-menunos samples do portal (basic, labs, user)activateTab()programaticamente em uma página compo-tabsLink to Devin session: https://totvs.devinenterprise.com/sessions/6e6fa3fa93d844ebaa94c48a73edfc14
Requested by: @anderson-gregorio-totvs
App de Exemplo:
DTHFUI-12510.zip