@po-ui/ng-components 21.31.0 → 21.33.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/fesm2022/{po-ui-ng-components-po-chart-modal-table.component-yOf0a_2R.mjs → po-ui-ng-components-po-chart-modal-table.component-B4RdhBpp.mjs} +4 -4
  2. package/fesm2022/{po-ui-ng-components-po-chart-modal-table.component-yOf0a_2R.mjs.map → po-ui-ng-components-po-chart-modal-table.component-B4RdhBpp.mjs.map} +1 -1
  3. package/fesm2022/po-ui-ng-components.mjs +4177 -2704
  4. package/fesm2022/po-ui-ng-components.mjs.map +1 -1
  5. package/lib/components/po-calendar/po-calendar-base.component.d.ts +3 -1
  6. package/lib/components/po-field/index.d.ts +1 -0
  7. package/lib/components/po-field/po-datepicker/po-datepicker-base.component.d.ts +3 -1
  8. package/lib/components/po-field/po-datetimepicker/po-datetimepicker.component.d.ts +1 -0
  9. package/lib/components/po-field/po-lookup/interfaces/po-lookup-advanced-filter.interface.d.ts +18 -0
  10. package/lib/components/po-field/po-lookup/po-lookup-base.component.d.ts +14 -0
  11. package/lib/components/po-field/po-lookup/po-lookup-modal/po-lookup-modal-base.component.d.ts +1 -0
  12. package/lib/components/po-field/po-lookup/po-lookup-modal/po-lookup-modal.component.d.ts +2 -0
  13. package/lib/components/po-field/po-lookup/po-lookup.component.d.ts +6 -0
  14. package/lib/components/po-list-view/enums/po-list-view-detail-display.enum.d.ts +14 -0
  15. package/lib/components/po-list-view/index.d.ts +2 -0
  16. package/lib/components/po-list-view/interfaces/po-list-view-field-properties.interface.d.ts +71 -0
  17. package/lib/components/po-list-view/interfaces/po-list-view-literals.interface.d.ts +2 -0
  18. package/lib/components/po-list-view/po-list-view-base.component.d.ts +276 -34
  19. package/lib/components/po-list-view/po-list-view-detail-template/po-list-view-detail-template.directive.d.ts +6 -0
  20. package/lib/components/po-list-view/po-list-view.component.d.ts +70 -4
  21. package/lib/components/po-list-view/po-list-view.module.d.ts +0 -37
  22. package/lib/components/po-tree-view/po-tree-view-base.component.d.ts +132 -51
  23. package/lib/components/po-tree-view/po-tree-view-item/po-tree-view-item.component.d.ts +15 -9
  24. package/lib/components/po-tree-view/po-tree-view-item/po-tree-view-item.interface.d.ts +92 -10
  25. package/lib/components/po-tree-view/po-tree-view-item-content/po-tree-view-item-content.component.d.ts +36 -0
  26. package/lib/components/po-tree-view/po-tree-view-item-content/po-tree-view-item-content.literals.d.ts +18 -0
  27. package/lib/components/po-tree-view/po-tree-view.component.d.ts +16 -5
  28. package/lib/components/po-tree-view/po-tree-view.literals.d.ts +26 -0
  29. package/lib/components/po-tree-view/po-tree-view.module.d.ts +0 -38
  30. package/lib/components/po-tree-view/services/po-tree-view-keyboard.service.d.ts +27 -0
  31. package/lib/components/po-tree-view/services/po-tree-view.service.d.ts +3 -0
  32. package/lib/components/po-widget/interfaces/po-widget-selection.interface.d.ts +23 -0
  33. package/lib/components/po-widget/po-widget-base.component.d.ts +28 -0
  34. package/lib/components/po-widget/po-widget.component.d.ts +6 -0
  35. package/lib/services/po-notification/po-notification-base.service.d.ts +1 -0
  36. package/package.json +4 -4
  37. package/po-ui-ng-components-21.33.0.tgz +0 -0
  38. package/schematics/ng-add/index.js +1 -1
  39. package/schematics/ng-update/v14/index.js +1 -1
  40. package/schematics/ng-update/v15/index.js +1 -1
  41. package/schematics/ng-update/v16/index.js +1 -1
  42. package/schematics/ng-update/v17/index.js +1 -1
  43. package/schematics/ng-update/v18/index.js +2 -2
  44. package/schematics/ng-update/v19/index.js +2 -2
  45. package/schematics/ng-update/v2/index.js +1 -1
  46. package/schematics/ng-update/v20/index.js +2 -2
  47. package/schematics/ng-update/v21/index.js +1 -1
  48. package/schematics/ng-update/v3/index.js +1 -1
  49. package/schematics/ng-update/v4/index.js +1 -1
  50. package/schematics/ng-update/v5/index.js +1 -1
  51. package/schematics/ng-update/v6/index.js +1 -1
  52. package/types/po-ui-ng-components.d.ts +1408 -785
  53. package/lib/components/po-tree-view/po-tree-view-item-header/po-tree-view-item-header.component.d.ts +0 -14
  54. package/po-ui-ng-components-21.31.0.tgz +0 -0
@@ -1,5 +1,7 @@
1
- import { AfterContentInit, DoCheck } from '@angular/core';
1
+ import { AfterContentInit, AfterViewChecked, AnimationCallbackEvent, DoCheck } from '@angular/core';
2
+ import { PoModalComponent } from '../po-modal/po-modal.component';
2
3
  import { PoPopupComponent } from '../po-popup/po-popup.component';
4
+ import { PoWidgetSelection } from '../po-widget/interfaces/po-widget-selection.interface';
3
5
  import { PoListViewAction } from './interfaces/po-list-view-action.interface';
4
6
  import { PoListViewBaseComponent } from './po-list-view-base.component';
5
7
  import { PoListViewContentTemplateDirective } from './po-list-view-content-template/po-list-view-content-template.directive';
@@ -14,6 +16,11 @@ import { PoListViewDetailTemplateDirective } from './po-list-view-detail-templat
14
16
  * <file name="sample-po-list-view-basic/sample-po-list-view-basic.component.ts"> </file>
15
17
  * </example>
16
18
  *
19
+ * <example name="po-list-view-field-properties" title="PO List View - Field Properties">
20
+ * <file name="sample-po-list-view-field-properties/sample-po-list-view-field-properties.component.html"> </file>
21
+ * <file name="sample-po-list-view-field-properties/sample-po-list-view-field-properties.component.ts"> </file>
22
+ * </example>
23
+ *
17
24
  * <example name="po-list-view-labs" title="PO List View Labs">
18
25
  * <file name="sample-po-list-view-labs/sample-po-list-view-labs.component.html"> </file>
19
26
  * <file name="sample-po-list-view-labs/sample-po-list-view-labs.component.ts"> </file>
@@ -25,27 +32,86 @@ import { PoListViewDetailTemplateDirective } from './po-list-view-detail-templat
25
32
  * <file name="sample-po-list-view-hiring-processes/sample-po-list-view-hiring-processes.service.ts"> </file>
26
33
  * </example>
27
34
  */
28
- export declare class PoListViewComponent extends PoListViewBaseComponent implements AfterContentInit, DoCheck {
35
+ export declare class PoListViewComponent extends PoListViewBaseComponent implements AfterContentInit, DoCheck, AfterViewChecked {
29
36
  private readonly changeDetector;
37
+ private readonly router;
38
+ private readonly elementRef;
39
+ private readonly renderer;
30
40
  listViewContentTemplate: PoListViewContentTemplateDirective;
31
41
  listViewDetailTemplate: PoListViewDetailTemplateDirective;
42
+ private readonly avatarProgressTemplate;
43
+ private readonly avatarIconTemplate;
44
+ private readonly avatarImageTemplate;
32
45
  poPopupComponent: PoPopupComponent;
46
+ protected detailModal: PoModalComponent;
33
47
  popupActions: Array<PoListViewAction>;
48
+ protected detailModalItem: any;
49
+ protected detailModalIndex: number;
34
50
  private readonly differ;
51
+ private readonly widgetActionsCache;
52
+ private cachedActionsRef;
35
53
  constructor();
36
54
  get hasContentTemplate(): boolean;
37
55
  get hasDetailTemplate(): boolean;
38
56
  get displayShowMoreButton(): boolean;
39
57
  get titleHasAction(): boolean;
58
+ protected isTitleClickable(item: any): boolean;
59
+ protected isItemClickable(item: any): boolean;
60
+ protected isCardFocusable(item: any): boolean;
61
+ private isSelectionControlClick;
62
+ protected onItemClick(item: any, event: MouseEvent): void;
63
+ protected onItemKeyDown(item: any, event: KeyboardEvent): void;
64
+ protected onTitleKeyDown(item: any, event: KeyboardEvent): void;
65
+ private updateTitleFocusableElements;
66
+ private updateTitleAccessibility;
67
+ private bindTitleFocus;
68
+ private unbindTitleFocus;
69
+ private updateSelectionControlsBinding;
70
+ private updateSelectionControlTabindex;
71
+ private updateRadioSelectionBinding;
72
+ private handleSingleSelectionEvent;
73
+ private updateCheckboxSelectionBinding;
74
+ private handleCheckboxSelectionEvent;
75
+ private isConfirmKey;
76
+ private unbindControlHandler;
77
+ protected stopPropagation(event?: Event | null): void;
78
+ protected onAdvancedArrowClick(item: any): void;
79
+ protected onTitleClick(item: any): void;
40
80
  ngAfterContentInit(): void;
41
81
  ngDoCheck(): void;
82
+ ngAfterViewChecked(): void;
42
83
  checkTitleType(item: any): "externalLink" | "internalLink" | "noLink";
43
84
  getItemTitle(item: any): any;
44
85
  hasItems(): boolean;
45
86
  returnBooleanValue(listViewAction: PoListViewAction, item: any, property: string): any;
46
- trackBy(index: any): any;
87
+ trackBy(item: any, index: number): any;
88
+ selectListItem(row: any): void;
89
+ protected onMultipleSelectionChange(item: any, value: boolean): void;
90
+ private syncSingleSelectionVisualState;
91
+ private ensureSingleSelectionConsistency;
92
+ protected onMultipleSelectionKeydown(item: any, event: KeyboardEvent): void;
93
+ protected getSelectionConfig(item: any): PoWidgetSelection | undefined;
94
+ onClickAction(listViewAction: PoListViewAction, item: any): void;
95
+ protected getItemActionType(item: any): 'advanced' | 'multiple' | 'none';
96
+ protected getItemTag(item: any): string | undefined;
97
+ protected getItemTagType(item: any): string;
98
+ protected getItemSubtitle(item: any): string | undefined;
99
+ protected getItemHighlighted(item: any): boolean;
100
+ protected getItemAvatar(item: any): any;
101
+ protected getAvatarType(item: any): string;
102
+ protected onAvatarImageError(wrapper?: HTMLElement): void;
103
+ protected onAvatarImageLoad(event: Event, wrapper?: HTMLElement): void;
104
+ private hideInvalidAvatarIcons;
105
+ private collapseAvatarContainer;
106
+ private restoreAvatarContainer;
107
+ private isIconGlyphEmpty;
108
+ protected getAvatarData(item: any): any;
109
+ protected getWidgetActions(item: any): Array<any>;
47
110
  togglePopup(item: any, targetRef: HTMLElement): void;
48
- onAnimationEvent(event: AnimationEvent, detail: any): void;
111
+ protected animateDetailEnter(event: AnimationCallbackEvent, item: any): void;
112
+ protected animateDetailLeave(event: AnimationCallbackEvent): void;
113
+ protected openDetailModal(item: any, index: number): void;
114
+ protected onCloseDetailModal(): void;
49
115
  protected getVisibleActions(item: any): Array<PoListViewAction>;
50
116
  private checkItemsChange;
51
117
  private initShowDetail;
@@ -3,43 +3,6 @@
3
3
  *
4
4
  * Módulo do componente `po-list-view`.
5
5
  *
6
- * > Para o correto funcionamento do componente `po-list-view`, deve ser importado o módulo `BrowserAnimationsModule` no
7
- * > módulo principal da sua aplicação.
8
- *
9
- * Módulo da aplicação:
10
- * ```
11
- * import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
12
- * import { PoModule } from '@po-ui/ng-components';
13
- * ...
14
- *
15
- * @NgModule({
16
- * imports: [
17
- * BrowserModule,
18
- * BrowserAnimationsModule,
19
- * ...
20
- * PoModule
21
- * ],
22
- * declarations: [
23
- * AppComponent,
24
- * ...
25
- * ],
26
- * providers: [],
27
- * bootstrap: [AppComponent]
28
- * })
29
- * export class AppModule { }
30
- * ```
31
- *
32
- * Em aplicações Standalone, utilize a seguinte configuração para o bootstrap:
33
- *
34
- * ```
35
- * import { bootstrapApplication } from '@angular/platform-browser';
36
- * import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
37
- * import { AppComponent } from './app.component';
38
- *
39
- * bootstrapApplication(AppComponent, {
40
- * providers: [importProvidersFrom(BrowserAnimationsModule)]
41
- * }).catch(err => console.error(err));
42
- * ```
43
6
  */
44
7
  export declare class PoListViewModule {
45
8
  }
@@ -1,17 +1,55 @@
1
- import { EventEmitter } from '@angular/core';
2
1
  import { PoTreeViewItem } from './po-tree-view-item/po-tree-view-item.interface';
3
2
  /**
4
3
  * @description
5
4
  *
6
- * O componente fornece um modelo de visualização em árvore, possibilitando a visualização das informações de maneira
7
- * hierárquica, desta forma sendo possível utilizar até 4 níveis.
5
+ * O componente fornece um modelo de visualização em árvore, possibilitando a exibição de informações de maneira
6
+ * hierárquica com suporte a múltiplos níveis (configurável via `p-max-level`).
8
7
  *
9
- * Nele é possível navegar entre os itens através da tecla *tab*, permitindo expandir ou colapsar o item em foco
10
- * por meio das teclas *enter* e *space*.
8
+ * O componente permite:
9
+ * - Navegação completa por teclado seguindo o padrão WAI-ARIA TreeView;
10
+ * - Expansão e recolhimento de itens agrupadores;
11
+ * - Seleção múltipla (checkbox) ou única (radio) dos itens;
12
+ * - Exibição de ícones automáticos para agrupadores e itens finais;
13
+ * - Estado desabilitado global ou individual por item;
14
+ * - Execução de itens finais via clique ou teclado.
11
15
  *
12
- * Além da navegação, o componente possibilita também a seleção dos itens do primeiro ao último nível, tanto de forma parcial como completa.
16
+ * #### Navegação por teclado
13
17
  *
14
- * O componente também possui eventos disparados ao marcar/desmarcar e expandir/colapsar os itens.
18
+ * | Tecla | Descrição |
19
+ * |-----------------------|-----------------------------------------------------------------------------------------------------------|
20
+ * | **Tab** | Entra no componente posicionando o foco no primeiro nó ativo. Ao pressionar novamente, sai do componente. |
21
+ * | **ArrowDown** | Move o foco para o próximo nó visível. |
22
+ * | **ArrowUp** | Move o foco para o nó visível anterior. |
23
+ * | **ArrowRight** | Se colapsado, expande o nó. Se expandido, move o foco para o nó filho. |
24
+ * | **ArrowLeft** | Se expandido, recolhe o nó. Se filho, move o foco para o nó pai. |
25
+ * | **Home** | Move o foco para o primeiro nó visível. |
26
+ * | **End** | Move o foco para o último nó visível. |
27
+ * | **Enter / Space** | Com `p-selectable`: alterna a seleção do item. Sem `p-selectable`: executa o item final. |
28
+ * | **Caractere** | Move o foco para o próximo nó cujo label inicia com o caractere pressionado (busca cíclica). |
29
+ *
30
+ * #### Tokens customizáveis
31
+ *
32
+ * É possível alterar o estilo do componente usando os seguintes tokens (CSS):
33
+ *
34
+ * > Para maiores informações, acesse o guia [Personalizando o Tema Padrão com Tokens CSS](https://po-ui.io/guides/theme-customization).
35
+ *
36
+ * | Propriedade | Descrição | Valor Padrão |
37
+ * |----------------------------------------|-------------------------------------------------------|-------------------------------------------------|
38
+ * | **Default** | | |
39
+ * | `--background-color` | Cor de background do item | `var(--color-neutral-light-00)` |
40
+ * | `--divider-color` | Cor do divider dos agrupadores de nível 0 | `var(--color-neutral-mid-40)` |
41
+ * | `--font-family` | Família tipográfica | `var(--font-family-theme)` |
42
+ * | `--font-size` | Tamanho da fonte | `var(--font-size-default)` |
43
+ * | `--line-height` | Altura da linha | `var(--line-height-md)` |
44
+ * | `--color` | Cor padrão do item | `var(--color-action-default)` |
45
+ * | **Hover** | | |
46
+ * | `--color-hover` | Cor do item em hover | `var(--color-action-hover)` |
47
+ * | **Pressed** | | |
48
+ * | `--color-pressed` | Cor do item em pressed | `var(--color-action-pressed)` |
49
+ * | **Disabled** | | |
50
+ * | `--color-disabled` | Cor do item desabilitado | `var(--color-action-disabled)` |
51
+ * | **Selected** | | |
52
+ * | `--title-color` | Cor do label quando selecionado | `var(--color-action-focus)` |
15
53
  */
16
54
  export declare class PoTreeViewBaseComponent {
17
55
  /**
@@ -19,112 +57,155 @@ export declare class PoTreeViewBaseComponent {
19
57
  *
20
58
  * @description
21
59
  *
22
- * Ação que será disparada ao colapsar um item.
60
+ * Define o tamanho dos componentes de formulário:
61
+ * - `small`: aplica a medida small de cada componente (disponível apenas para acessibilidade AA).
62
+ * - `medium`: aplica a medida medium de cada componente.
23
63
  *
24
- * > Como parâmetro o componente envia o item colapsado.
64
+ * > Caso a acessibilidade AA não esteja configurada, o tamanho `medium` será mantido.
65
+ * Para mais detalhes, consulte a documentação do [po-theme](https://po-ui.io/documentation/po-theme).
66
+ *
67
+ * @default `medium`
25
68
  */
26
- collapsed: EventEmitter<PoTreeViewItem>;
69
+ readonly componentsSizeInput: import("@angular/core").InputSignal<string>;
27
70
  /**
28
71
  * @optional
29
72
  *
30
73
  * @description
31
74
  *
32
- * Ação que será disparada ao expandir um item.
75
+ * Desabilita o componente inteiro.
33
76
  *
34
- * > Como parâmetro o componente envia o item expandido.
77
+ * Quando `true`, todos os itens do tree-view serão exibidos no estado desabilitado,
78
+ * independentemente do valor individual da propriedade `disabled` de cada item.
79
+ *
80
+ * > O botão de expansão/recolhimento (arrow) permanece interativo mesmo quando o componente está desabilitado.
81
+ *
82
+ * @default `false`
83
+ */
84
+ readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, boolean>;
85
+ /**
86
+ * Lista de itens do tipo `PoTreeViewItem` que será renderizada pelo componente.
87
+ *
88
+ * > Consulte a documentação de `PoTreeViewItem` para detalhes sobre as propriedades disponíveis em cada item.
35
89
  */
36
- expanded: EventEmitter<PoTreeViewItem>;
90
+ readonly inputedItems: import("@angular/core").InputSignal<PoTreeViewItem[]>;
37
91
  /**
38
92
  * @optional
39
93
  *
40
94
  * @description
41
95
  *
42
- * Ação que será disparada ao selecionar um item.
96
+ * Define o máximo de níveis para o tree-view.
43
97
  *
44
- * > Como parâmetro o componente envia o item selecionado.
98
+ * > O valor padrão é 4
99
+ *
100
+ * @default 4
45
101
  */
46
- selected: EventEmitter<PoTreeViewItem>;
102
+ readonly maxLevel: import("@angular/core").InputSignalWithTransform<number, number>;
47
103
  /**
48
104
  * @optional
49
105
  *
50
106
  * @description
51
107
  *
52
- * Ação que será disparada ao desfazer a seleção de um item.
108
+ * Remove a borda do container do componente.
53
109
  *
54
- * > Como parâmetro o componente envia o item que foi desmarcado.
110
+ * @default false
55
111
  */
56
- unselected: EventEmitter<PoTreeViewItem>;
57
- private _componentsSize;
58
- private _initialComponentsSize;
59
- private _items;
60
- private _selectable;
61
- private _maxLevel;
62
- private _singleSelect;
63
- selectedValue: string | number;
112
+ readonly noBorder: import("@angular/core").InputSignalWithTransform<boolean, boolean>;
64
113
  /**
65
114
  * @optional
66
115
  *
67
116
  * @description
68
117
  *
69
- * Define o tamanho dos componentes de formulário:
70
- * - `small`: aplica a medida small de cada componente (disponível apenas para acessibilidade AA).
71
- * - `medium`: aplica a medida medium de cada componente.
118
+ * Habilita uma caixa de seleção para selecionar e/ou desmarcar um item da lista.
72
119
  *
73
- * > Caso a acessibilidade AA não esteja configurada, o tamanho `medium` será mantido.
74
- * Para mais detalhes, consulte a documentação do [po-theme](https://po-ui.io/documentation/po-theme).
120
+ * > Quando habilitado, a propriedade `showIcon` dos itens não será aplicada.
75
121
  *
76
- * @default `medium`
122
+ * @default false
77
123
  */
78
- set componentsSize(value: string);
79
- get componentsSize(): string;
124
+ readonly selectable: import("@angular/core").InputSignalWithTransform<boolean, boolean>;
80
125
  /**
81
- * Lista de itens do tipo `PoTreeViewItem` que será renderizada pelo componente.
126
+ * @optional
127
+ *
128
+ * @description
129
+ *
130
+ * Habilita a seleção para item único atráves de po-radio.
131
+ *
132
+ * @default false
82
133
  */
83
- inputedItems: Array<PoTreeViewItem>;
84
- set items(value: Array<PoTreeViewItem>);
85
- get items(): Array<PoTreeViewItem>;
134
+ readonly singleSelect: import("@angular/core").InputSignalWithTransform<boolean, boolean>;
86
135
  /**
87
136
  * @optional
88
137
  *
89
138
  * @description
90
139
  *
91
- * Habilita uma caixa de seleção para selecionar e/ou desmarcar um item da lista.
140
+ * Ação que será disparada ao colapsar um item.
92
141
  *
93
- * @default false
142
+ * > Como parâmetro o componente envia o item colapsado.
94
143
  */
95
- set selectable(value: boolean);
96
- get selectable(): boolean;
144
+ readonly collapsed: import("@angular/core").OutputEmitterRef<PoTreeViewItem>;
97
145
  /**
98
146
  * @optional
99
147
  *
100
148
  * @description
101
149
  *
102
- * Habilita a seleção para item único atráves de po-radio.
150
+ * Ação que será disparada ao expandir um item.
103
151
  *
104
- * @default false
152
+ * > Como parâmetro o componente envia o item expandido.
105
153
  */
106
- set singleSelect(value: boolean);
107
- get singleSelect(): boolean;
154
+ readonly expanded: import("@angular/core").OutputEmitterRef<PoTreeViewItem>;
108
155
  /**
109
156
  * @optional
110
157
  *
111
158
  * @description
112
159
  *
113
- * Define o máximo de níveis para o tree-view.
160
+ * Ação que será disparada ao selecionar um item.
114
161
  *
115
- * > O valor padrão é 4
162
+ * > Como parâmetro o componente envia o item selecionado.
163
+ */
164
+ readonly selected: import("@angular/core").OutputEmitterRef<PoTreeViewItem>;
165
+ /**
166
+ * @optional
116
167
  *
117
- * @default 4
168
+ * @description
169
+ *
170
+ * Ação que será disparada ao desfazer a seleção de um item.
171
+ *
172
+ * > Como parâmetro o componente envia o item que foi desmarcado.
118
173
  */
119
- set maxLevel(value: number);
120
- get maxLevel(): number;
174
+ readonly unselected: import("@angular/core").OutputEmitterRef<PoTreeViewItem>;
175
+ /**
176
+ * @optional
177
+ *
178
+ * @description
179
+ *
180
+ * Ação que será disparada ao executar um item final (sem `subItems`).
181
+ *
182
+ * > Como parâmetro o componente envia o item executado.
183
+ */
184
+ readonly activated: import("@angular/core").OutputEmitterRef<PoTreeViewItem>;
185
+ private _componentsSize;
186
+ private _items;
187
+ selectedValue: string | number;
188
+ protected get componentsSize(): string;
189
+ protected set items(value: Array<PoTreeViewItem>);
190
+ protected get items(): Array<PoTreeViewItem>;
191
+ constructor();
121
192
  protected onThemeChange(): void;
122
193
  protected emitExpanded(treeViewItem: PoTreeViewItem): void;
123
194
  protected emitSelected(treeViewItem: PoTreeViewItem): void;
195
+ protected emitActivated(treeViewItem: PoTreeViewItem): void;
196
+ private selectSingleFinalItem;
197
+ private setSingleFinalSelection;
198
+ private setSingleSelectionByValue;
199
+ private getExpandedState;
200
+ private applyExpandedState;
201
+ private getSelectedState;
202
+ private applySelectedState;
203
+ private getLastSelectedFinalItemValue;
124
204
  private addChildItemInParent;
125
205
  private addItem;
126
206
  private selectAllItems;
127
207
  private selectItemBySubItems;
208
+ private getSelectableSubItems;
128
209
  private everyItemSelected;
129
210
  private expandParentItem;
130
211
  private getItemsByMaxLevel;
@@ -1,13 +1,19 @@
1
+ import { AnimationCallbackEvent } from '@angular/core';
1
2
  import { PoTreeViewItem } from './po-tree-view-item.interface';
2
3
  export declare class PoTreeViewItemComponent {
3
4
  private readonly treeViewService;
4
- componentsSize: string;
5
- item: PoTreeViewItem;
6
- selectable: boolean;
7
- singleSelect: boolean;
8
- selectedValue: string | number;
9
- get hasSubItems(): boolean;
10
- onClick(event: MouseEvent): void;
11
- onSelect(selectedItem: PoTreeViewItem): void;
12
- trackByFunction(index: number): number;
5
+ readonly componentsSize: import("@angular/core").InputSignal<string>;
6
+ readonly item: import("@angular/core").InputSignal<PoTreeViewItem>;
7
+ readonly level: import("@angular/core").InputSignal<number>;
8
+ readonly selectable: import("@angular/core").InputSignal<boolean>;
9
+ readonly selectedValue: import("@angular/core").InputSignal<string | number>;
10
+ readonly singleSelect: import("@angular/core").InputSignal<boolean>;
11
+ protected animateEnter(event: AnimationCallbackEvent): void;
12
+ protected animateLeave(event: AnimationCallbackEvent): void;
13
+ protected get hasSubItems(): boolean;
14
+ protected onClick(): void;
15
+ protected onSelect(selectedItem: PoTreeViewItem): void;
16
+ protected onActivate(activatedItem: PoTreeViewItem): void;
17
+ protected trackByFunction(index: number): number;
18
+ private animateToggle;
13
19
  }
@@ -6,23 +6,105 @@
6
6
  * Interface para definição dos itens do componente `po-tree-view`.
7
7
  */
8
8
  export interface PoTreeViewItem {
9
- /** Desabilita a selecão do item. */
10
- /** Texto de exibição do item. */
11
- label: string;
12
- /** Valor do item que poderá ser utilizado como referência para sua identificação. */
13
- value: string | number;
14
- /** Expande o item. */
9
+ /**
10
+ * @optional
11
+ *
12
+ * @description
13
+ *
14
+ * Desabilita a interação com o item.
15
+ *
16
+ * O estado é aplicado somente ao item em que a propriedade está configurada
17
+ * e não é propagado para seus `subItems`.
18
+ *
19
+ * > Itens disabled que não possuem `subItems` são ignorados na navegação por teclado.
20
+ * Itens disabled que possuem `subItems` continuam participando da navegação, permitindo expandir/recolher.
21
+ *
22
+ * @default `false`
23
+ */
24
+ disabled?: boolean;
25
+ /**
26
+ * @optional
27
+ *
28
+ * @description
29
+ *
30
+ * Expande o item, exibindo seus `subItems`.
31
+ *
32
+ * Quando `true`, o item será renderizado no estado expandido.
33
+ *
34
+ * > Sem efeito em itens que não possuem `subItems`.
35
+ *
36
+ * @default `false`
37
+ */
15
38
  expanded?: boolean;
16
39
  /**
40
+ * @optional
41
+ *
42
+ * @description
43
+ *
44
+ * Permite ativar ou desativar a seleção do item.
45
+ *
46
+ * Quando `false`, o item não poderá ser selecionado pelo usuário.
47
+ *
48
+ * @deprecated v23.x.x use `disabled`
49
+ */
50
+ isSelectable?: boolean | null;
51
+ /**
52
+ * @description
53
+ *
54
+ * Texto de exibição do item.
55
+ *
56
+ * O valor é utilizado como `aria-label` do nó e como referência na navegação por caractere do teclado.
57
+ */
58
+ label: string;
59
+ /**
60
+ * @optional
61
+ *
62
+ * @description
63
+ *
17
64
  * Marca o item como selecionado.
18
65
  *
19
- * > Caso o item que conter `subItems` for selecionado, os seus itens filhos serão também selecionados.
66
+ * > Caso o item que possuir `subItems` for selecionado, os seus itens filhos serão também selecionados.
67
+ *
68
+ * Quando utilizado com `p-single-select`, apenas um item pode estar selecionado por vez.
69
+ * Ao selecionar outro item, o anteriormente selecionado perde o estado.
70
+ *
71
+ * @default `false`
20
72
  */
21
73
  selected?: boolean | null;
22
74
  /**
23
- * Permite ativar/desativar a seleção do item
75
+ * @optional
76
+ *
77
+ * @description
78
+ *
79
+ * Habilita a exibição de ícone no item.
80
+ *
81
+ * Quando `true`, exibe automaticamente:
82
+ * - `an-folder-simple` para itens agrupadores (que possuem `subItems`).
83
+ * - `an-file` para itens finais (sem `subItems`).
84
+ *
85
+ * > Não funciona em conjunto com `p-selectable`.
86
+ * Quando `p-selectable` e `showIcon` estiverem configurados como `true`,
87
+ * `p-selectable` terá precedência.
88
+ *
89
+ * @default `false`
90
+ */
91
+ showIcon?: boolean;
92
+ /**
93
+ * @optional
94
+ *
95
+ * @description
96
+ *
97
+ * Lista de itens do próximo nível, permitindo a construção hierárquica da árvore.
98
+ *
99
+ * A estrutura pode ser aninhada recursivamente até o limite definido pela propriedade `p-max-level` do componente.
24
100
  */
25
- isSelectable?: boolean | null;
26
- /** Lista de itens do próximo nível, e assim consecutivamente até que se atinja o quarto nível. */
27
101
  subItems?: Array<PoTreeViewItem>;
102
+ /**
103
+ * @description
104
+ *
105
+ * Valor do item utilizado como referência para sua identificação.
106
+ *
107
+ * Em modo `p-single-select`, este valor é utilizado para determinar qual item está atualmente selecionado.
108
+ */
109
+ value: string | number;
28
110
  }
@@ -0,0 +1,36 @@
1
+ import { ElementRef } from '@angular/core';
2
+ import { PoTreeViewItem } from '../po-tree-view-item/po-tree-view-item.interface';
3
+ export declare class PoTreeViewItemContentComponent {
4
+ private readonly keyboardService;
5
+ private readonly languageService;
6
+ protected readonly literals: any;
7
+ protected inputCheckbox: any;
8
+ protected lineElement: ElementRef<HTMLElement>;
9
+ readonly componentsSize: import("@angular/core").InputSignal<string>;
10
+ readonly item: import("@angular/core").InputSignal<PoTreeViewItem>;
11
+ readonly level: import("@angular/core").InputSignal<number>;
12
+ readonly selectable: import("@angular/core").InputSignal<boolean>;
13
+ readonly selectedValue: import("@angular/core").InputSignal<string | number>;
14
+ readonly singleSelect: import("@angular/core").InputSignal<boolean>;
15
+ readonly expanded: import("@angular/core").OutputEmitterRef<void>;
16
+ readonly selected: import("@angular/core").OutputEmitterRef<PoTreeViewItem>;
17
+ readonly activated: import("@angular/core").OutputEmitterRef<PoTreeViewItem>;
18
+ protected idRadio: string;
19
+ protected isLabelTruncated: boolean;
20
+ protected get hasSubItems(): boolean;
21
+ protected get expandIcon(): string;
22
+ protected get isDisabled(): boolean;
23
+ protected get isExpanded(): boolean;
24
+ protected get isSelected(): boolean;
25
+ protected get itemIcon(): string | undefined;
26
+ protected onLineFocus(event: FocusEvent): void;
27
+ protected onLineMouseEnter(event: MouseEvent): void;
28
+ private updateLabelTruncation;
29
+ protected onLineClick(event: MouseEvent): void;
30
+ protected onKeydown(event: KeyboardEvent): void;
31
+ private handleArrowRight;
32
+ private handleArrowLeft;
33
+ private handleSelect;
34
+ private applyPressedState;
35
+ private handleCharacterNavigation;
36
+ }
@@ -0,0 +1,18 @@
1
+ export declare const poTreeViewItemContentLiterals: {
2
+ en: {
3
+ collapse: string;
4
+ expand: string;
5
+ };
6
+ es: {
7
+ collapse: string;
8
+ expand: string;
9
+ };
10
+ pt: {
11
+ collapse: string;
12
+ expand: string;
13
+ };
14
+ ru: {
15
+ collapse: string;
16
+ expand: string;
17
+ };
18
+ };
@@ -1,4 +1,4 @@
1
- import { OnChanges, OnInit, SimpleChanges } from '@angular/core';
1
+ import { OnInit, AfterViewInit } from '@angular/core';
2
2
  import { PoTreeViewBaseComponent } from './po-tree-view-base.component';
3
3
  /**
4
4
  * @docsExtends PoTreeViewBaseComponent
@@ -25,10 +25,21 @@ import { PoTreeViewBaseComponent } from './po-tree-view-base.component';
25
25
  * <file name="sample-po-tree-view-supermarket/sample-po-tree-view-supermarket.component.ts"> </file>
26
26
  * </example>
27
27
  */
28
- export declare class PoTreeViewComponent extends PoTreeViewBaseComponent implements OnInit, OnChanges {
28
+ export declare class PoTreeViewComponent extends PoTreeViewBaseComponent implements OnInit, AfterViewInit {
29
+ private readonly elementRef;
30
+ private readonly destroyRef;
29
31
  private readonly treeViewService;
30
- get hasItems(): boolean;
32
+ private readonly keyboardService;
33
+ private readonly languageService;
34
+ private readonly changeDetector;
35
+ protected readonly literals: any;
36
+ protected ariaLiveMessage: string;
37
+ protected get hasItems(): boolean;
38
+ constructor();
31
39
  ngOnInit(): void;
32
- ngOnChanges(changes?: SimpleChanges): void;
33
- trackByFunction(index: number): number;
40
+ ngAfterViewInit(): void;
41
+ protected onTreeFocus(event: FocusEvent): void;
42
+ protected onTreeKeydown(event: KeyboardEvent): void;
43
+ protected trackByFunction(index: number): number;
44
+ private announce;
34
45
  }