@po-ui/ng-components 19.33.0 → 19.35.0-beta.1

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 (31) hide show
  1. package/fesm2022/po-ui-ng-components.mjs +199 -63
  2. package/fesm2022/po-ui-ng-components.mjs.map +1 -1
  3. package/lib/components/po-button/po-button-base.component.d.ts +3 -2
  4. package/lib/components/po-dropdown/po-dropdown-action.interface.d.ts +10 -0
  5. package/lib/components/po-dropdown/po-dropdown.component.d.ts +5 -0
  6. package/lib/components/po-listbox/interfaces/po-listbox-literals.interface.d.ts +2 -0
  7. package/lib/components/po-listbox/po-item-list/po-item-list-base.component.d.ts +2 -1
  8. package/lib/components/po-listbox/po-listbox-base.component.d.ts +9 -8
  9. package/lib/components/po-listbox/po-listbox.component.d.ts +14 -3
  10. package/lib/components/po-listbox/po-listbox.module.d.ts +3 -2
  11. package/lib/components/po-modal/po-modal-action.interface.d.ts +44 -0
  12. package/lib/components/po-page/interfaces/po-page-action.interface.d.ts +6 -5
  13. package/lib/components/po-popup/po-popup-action.interface.d.ts +36 -4
  14. package/lib/components/po-popup/po-popup-base.component.d.ts +2 -1
  15. package/lib/services/po-theme/helpers/types/po-theme-dark-defaults-AA.constant.d.ts +4 -0
  16. package/lib/services/po-theme/helpers/types/po-theme-dark-defaults.constant.d.ts +5 -0
  17. package/package.json +4 -4
  18. package/po-ui-ng-components-19.35.0-beta.1.tgz +0 -0
  19. package/schematics/ng-add/index.js +1 -1
  20. package/schematics/ng-update/v14/index.js +1 -1
  21. package/schematics/ng-update/v15/index.js +1 -1
  22. package/schematics/ng-update/v16/index.js +1 -1
  23. package/schematics/ng-update/v17/index.js +1 -1
  24. package/schematics/ng-update/v18/index.js +2 -2
  25. package/schematics/ng-update/v19/index.js +2 -2
  26. package/schematics/ng-update/v2/index.js +1 -1
  27. package/schematics/ng-update/v3/index.js +1 -1
  28. package/schematics/ng-update/v4/index.js +1 -1
  29. package/schematics/ng-update/v5/index.js +1 -1
  30. package/schematics/ng-update/v6/index.js +1 -1
  31. package/po-ui-ng-components-19.33.0.tgz +0 -0
@@ -85,11 +85,12 @@ export declare class PoButtonBaseComponent {
85
85
  * @description
86
86
  * Ícone exibido ao lado esquerdo do label do botão.
87
87
  *
88
- * É possível usar qualquer um dos ícones da [Biblioteca de ícones](https://po-ui.io/icons). conforme exemplo abaixo:
88
+ * É possível usar qualquer um dos ícones da [Biblioteca de ícones](https://po-ui.io/icons), conforme exemplo:
89
89
  * ```
90
90
  * <po-button p-icon="an an-user" p-label="PO button"></po-button>
91
91
  * ```
92
- * Também é possível utilizar outras fontes de ícones, por exemplo a biblioteca *Font Awesome*, da seguinte forma:
92
+ * Também é possível utilizar outras fontes de ícones, por exemplo a biblioteca *Font Awesome*, desde que a biblioteca
93
+ * esteja carregada no projeto:
93
94
  * ```
94
95
  * <po-button p-icon="fa fa-podcast" p-label="PO button"></po-button>
95
96
  * ```
@@ -8,4 +8,14 @@ import { PoPopupAction } from '../po-popup/po-popup-action.interface';
8
8
  * @usedBy PoDropdownComponent
9
9
  */
10
10
  export interface PoDropdownAction extends PoPopupAction {
11
+ /**
12
+ * Array de ações (`PoDropdownAction`) usado para criar agrupadores de subitens.
13
+ *
14
+ * - Permite a criação de menus aninhados (submenus).
15
+ *
16
+ * > Boas práticas de desenvolvimento:
17
+ * Recomenda-se limitar a navegação a, no máximo, três níveis hierárquicos.
18
+ * Isso evita sobrecarga cognitiva, facilita a memorização da estrutura e garante uma melhor experiência de uso.
19
+ */
20
+ subItems?: Array<PoDropdownAction>;
11
21
  }
@@ -11,6 +11,11 @@ import * as i0 from "@angular/core";
11
11
  * <file name="sample-po-dropdown-basic/sample-po-dropdown-basic.component.ts"> </file>
12
12
  * </example>
13
13
  *
14
+ * <example name="po-dropdown-subitems" title="PO Dropdown Subitems" >
15
+ * <file name="sample-po-dropdown-subitems/sample-po-dropdown-subitems.component.html"> </file>
16
+ * <file name="sample-po-dropdown-subitems/sample-po-dropdown-subitems.component.ts"> </file>
17
+ * </example>
18
+ *
14
19
  * <example name="po-dropdown-labs" title="PO Dropdown Labs" >
15
20
  * <file name="sample-po-dropdown-labs/sample-po-dropdown-labs.component.html"> </file>
16
21
  * <file name="sample-po-dropdown-labs/sample-po-dropdown-labs.component.ts"> </file>
@@ -6,6 +6,8 @@
6
6
  * Interface para definição de literais utilizadas no `po-listbox`
7
7
  */
8
8
  export interface PoListBoxLiterals {
9
+ /** Texto do botão para voltar ao agrupador anterior. */
10
+ backToPreviousGroup?: string;
9
11
  /** Texto exibido quando não houver itens na lista */
10
12
  noItems?: string;
11
13
  /** Texto do *placeholder* do campo de busca. */
@@ -77,6 +77,7 @@ export declare class PoItemListBaseComponent {
77
77
  * Define um ícone que será exibido ao lado esquerdo do rótulo.
78
78
  */
79
79
  icon: string | TemplateRef<void>;
80
+ iconPosition: 'left' | 'right';
80
81
  /**
81
82
  * @optional
82
83
  *
@@ -107,7 +108,7 @@ export declare class PoItemListBaseComponent {
107
108
  keysLabel?: Array<string>;
108
109
  protected emitActiveTabs(tab: any): void;
109
110
  static ɵfac: i0.ɵɵFactoryDeclaration<PoItemListBaseComponent, never>;
110
- static ɵdir: i0.ɵɵDirectiveDeclaration<PoItemListBaseComponent, never, never, { "type": { "alias": "p-type"; "required": false; }; "visible": { "alias": "p-visible"; "required": false; }; "item": { "alias": "p-item"; "required": false; }; "label": { "alias": "p-label"; "required": false; }; "size": { "alias": "p-size"; "required": false; }; "value": { "alias": "p-value"; "required": false; }; "danger": { "alias": "p-danger"; "required": false; }; "disabled": { "alias": "p-disabled"; "required": false; }; "selected": { "alias": "p-selected"; "required": false; }; "separator": { "alias": "p-separator"; "required": false; }; "icon": { "alias": "p-icon"; "required": false; }; "checkboxValue": { "alias": "p-checkbox-value"; "required": false; }; "fieldValue": { "alias": "p-field-value"; "required": false; }; "fieldLabel": { "alias": "p-field-label"; "required": false; }; "template": { "alias": "p-template"; "required": false; }; "templateContext": { "alias": "p-template-context"; "required": false; }; "searchValue": { "alias": "p-search-value"; "required": false; }; "filterMode": { "alias": "p-filter-mode"; "required": false; }; "isFiltering": { "alias": "p-filtering"; "required": false; }; "shouldMarkLetters": { "alias": "p-should-mark-letter"; "required": false; }; "compareCache": { "alias": "p-compare-cache"; "required": false; }; "comboService": { "alias": "p-combo-service"; "required": false; }; "isTabs": { "alias": "p-is-tabs"; "required": false; }; "tabHide": { "alias": "p-tab-hide"; "required": false; }; "activeTabs": { "alias": "p-active-tabs"; "required": false; }; "keysLabel": { "alias": "p-keys-label"; "required": false; }; }, { "clickItem": "p-click-item"; "checkboxItem": "p-selectcheckbox-item"; "comboItem": "p-selectcombo-item"; "tabsItem": "p-emit-item-tabs"; "activatedTab": "p-activated-tabs"; }, never, never, true, never>;
111
+ static ɵdir: i0.ɵɵDirectiveDeclaration<PoItemListBaseComponent, never, never, { "type": { "alias": "p-type"; "required": false; }; "visible": { "alias": "p-visible"; "required": false; }; "item": { "alias": "p-item"; "required": false; }; "label": { "alias": "p-label"; "required": false; }; "size": { "alias": "p-size"; "required": false; }; "value": { "alias": "p-value"; "required": false; }; "danger": { "alias": "p-danger"; "required": false; }; "disabled": { "alias": "p-disabled"; "required": false; }; "selected": { "alias": "p-selected"; "required": false; }; "separator": { "alias": "p-separator"; "required": false; }; "icon": { "alias": "p-icon"; "required": false; }; "iconPosition": { "alias": "p-icon-position"; "required": false; }; "checkboxValue": { "alias": "p-checkbox-value"; "required": false; }; "fieldValue": { "alias": "p-field-value"; "required": false; }; "fieldLabel": { "alias": "p-field-label"; "required": false; }; "template": { "alias": "p-template"; "required": false; }; "templateContext": { "alias": "p-template-context"; "required": false; }; "searchValue": { "alias": "p-search-value"; "required": false; }; "filterMode": { "alias": "p-filter-mode"; "required": false; }; "isFiltering": { "alias": "p-filtering"; "required": false; }; "shouldMarkLetters": { "alias": "p-should-mark-letter"; "required": false; }; "compareCache": { "alias": "p-compare-cache"; "required": false; }; "comboService": { "alias": "p-combo-service"; "required": false; }; "isTabs": { "alias": "p-is-tabs"; "required": false; }; "tabHide": { "alias": "p-tab-hide"; "required": false; }; "activeTabs": { "alias": "p-active-tabs"; "required": false; }; "keysLabel": { "alias": "p-keys-label"; "required": false; }; }, { "clickItem": "p-click-item"; "checkboxItem": "p-selectcheckbox-item"; "comboItem": "p-selectcombo-item"; "tabsItem": "p-emit-item-tabs"; "activatedTab": "p-activated-tabs"; }, never, never, true, never>;
111
112
  static ngAcceptInputType_danger: any;
112
113
  static ngAcceptInputType_selected: any;
113
114
  static ngAcceptInputType_separator: any;
@@ -23,6 +23,7 @@ export declare class PoListBoxBaseComponent {
23
23
  private _literals;
24
24
  private language;
25
25
  private _size?;
26
+ listboxSubitems: boolean;
26
27
  visible: boolean;
27
28
  set type(value: string);
28
29
  get type(): PoItemListType;
@@ -33,18 +34,11 @@ export declare class PoListBoxBaseComponent {
33
34
  get isItemListGroup(): boolean;
34
35
  isTabs: boolean;
35
36
  param?: any;
36
- selectItem: EventEmitter<any>;
37
- closeEvent: EventEmitter<any>;
38
- change: EventEmitter<any>;
39
- selectCombo: EventEmitter<any>;
40
- changeAll: EventEmitter<any>;
41
- UpdateInfiniteScroll: EventEmitter<any>;
42
37
  checkboxAllValue: any;
43
38
  selectedOptions: Array<any>;
44
39
  selectedOption?: any;
45
40
  fieldValue: string;
46
41
  fieldLabel: string;
47
- changeSearch: EventEmitter<any>;
48
42
  literalSearch?: any;
49
43
  fieldValueSearch: string;
50
44
  hideSearch?: boolean;
@@ -70,6 +64,13 @@ export declare class PoListBoxBaseComponent {
70
64
  footerActionListbox: boolean;
71
65
  placeholderListbox: string;
72
66
  separator: boolean;
67
+ changeSearch: EventEmitter<any>;
68
+ selectItem: EventEmitter<any>;
69
+ closeEvent: EventEmitter<any>;
70
+ change: EventEmitter<any>;
71
+ selectCombo: EventEmitter<any>;
72
+ changeAll: EventEmitter<any>;
73
+ UpdateInfiniteScroll: EventEmitter<any>;
73
74
  activatedTab: EventEmitter<any>;
74
75
  clickTab: EventEmitter<any>;
75
76
  changeStateTabs: EventEmitter<any>;
@@ -77,7 +78,7 @@ export declare class PoListBoxBaseComponent {
77
78
  footerActionListboxEvent: EventEmitter<any>;
78
79
  constructor(languageService: PoLanguageService);
79
80
  static ɵfac: i0.ɵɵFactoryDeclaration<PoListBoxBaseComponent, never>;
80
- static ɵdir: i0.ɵɵDirectiveDeclaration<PoListBoxBaseComponent, never, never, { "visible": { "alias": "p-visible"; "required": false; }; "type": { "alias": "p-type"; "required": false; }; "items": { "alias": "p-items"; "required": false; }; "literals": { "alias": "p-literals"; "required": false; }; "isTabs": { "alias": "p-is-tabs"; "required": false; }; "param": { "alias": "p-param"; "required": false; }; "checkboxAllValue": { "alias": "p-checkboxAllValue"; "required": false; }; "selectedOptions": { "alias": "p-selected-options"; "required": false; }; "selectedOption": { "alias": "p-selected-option"; "required": false; }; "fieldValue": { "alias": "p-field-value"; "required": false; }; "fieldLabel": { "alias": "p-field-label"; "required": false; }; "literalSearch": { "alias": "p-literal-search"; "required": false; }; "fieldValueSearch": { "alias": "p-field-value-search"; "required": false; }; "hideSearch": { "alias": "p-hide-search"; "required": false; }; "hideSelectAll": { "alias": "p-hide-select-all"; "required": false; }; "multiselectTemplate": { "alias": "p-multiselect-template"; "required": false; }; "template": { "alias": "p-template"; "required": false; }; "placeholderSearch": { "alias": "p-placeholder-search"; "required": false; }; "searchValue": { "alias": "p-search-value"; "required": false; }; "isServerSearching": { "alias": "p-is-searching"; "required": false; }; "infiniteLoading": { "alias": "p-infinite-loading"; "required": false; }; "infiniteScroll": { "alias": "p-infinite-scroll"; "required": false; }; "cache": { "alias": "p-cache"; "required": false; }; "infiniteScrollDistance": { "alias": "p-infinite-scroll-distance"; "required": false; }; "filterMode": { "alias": "p-filter-mode"; "required": false; }; "isFiltering": { "alias": "p-filtering"; "required": false; }; "shouldMarkLetters": { "alias": "p-should-mark-letter"; "required": false; }; "size": { "alias": "p-size"; "required": false; }; "compareCache": { "alias": "p-compare-cache"; "required": false; }; "comboService": { "alias": "p-combo-service"; "required": false; }; "containerWidth": { "alias": "p-container-width"; "required": false; }; "keysLabel": { "alias": "p-keys-label"; "required": false; }; "footerActionListbox": { "alias": "p-footer-action-listbox"; "required": false; }; "placeholderListbox": { "alias": "p-placeholder-listbox"; "required": false; }; "separator": { "alias": "p-separator"; "required": false; }; }, { "selectItem": "p-select-item"; "closeEvent": "p-close"; "change": "p-change"; "selectCombo": "p-selectcombo-item"; "changeAll": "p-change-all"; "UpdateInfiniteScroll": "p-update-infinite-scroll"; "changeSearch": "p-change-search"; "activatedTab": "p-activated-tabs"; "clickTab": "p-click-tabs"; "changeStateTabs": "p-change-state-tabs"; "clickItem": "p-click-item"; "footerActionListboxEvent": "p-footer-action-listbox-event"; }, never, never, true, never>;
81
+ static ɵdir: i0.ɵɵDirectiveDeclaration<PoListBoxBaseComponent, never, never, { "listboxSubitems": { "alias": "p-listbox-subitems"; "required": false; }; "visible": { "alias": "p-visible"; "required": false; }; "type": { "alias": "p-type"; "required": false; }; "items": { "alias": "p-items"; "required": false; }; "literals": { "alias": "p-literals"; "required": false; }; "isTabs": { "alias": "p-is-tabs"; "required": false; }; "param": { "alias": "p-param"; "required": false; }; "checkboxAllValue": { "alias": "p-checkboxAllValue"; "required": false; }; "selectedOptions": { "alias": "p-selected-options"; "required": false; }; "selectedOption": { "alias": "p-selected-option"; "required": false; }; "fieldValue": { "alias": "p-field-value"; "required": false; }; "fieldLabel": { "alias": "p-field-label"; "required": false; }; "literalSearch": { "alias": "p-literal-search"; "required": false; }; "fieldValueSearch": { "alias": "p-field-value-search"; "required": false; }; "hideSearch": { "alias": "p-hide-search"; "required": false; }; "hideSelectAll": { "alias": "p-hide-select-all"; "required": false; }; "multiselectTemplate": { "alias": "p-multiselect-template"; "required": false; }; "template": { "alias": "p-template"; "required": false; }; "placeholderSearch": { "alias": "p-placeholder-search"; "required": false; }; "searchValue": { "alias": "p-search-value"; "required": false; }; "isServerSearching": { "alias": "p-is-searching"; "required": false; }; "infiniteLoading": { "alias": "p-infinite-loading"; "required": false; }; "infiniteScroll": { "alias": "p-infinite-scroll"; "required": false; }; "cache": { "alias": "p-cache"; "required": false; }; "infiniteScrollDistance": { "alias": "p-infinite-scroll-distance"; "required": false; }; "filterMode": { "alias": "p-filter-mode"; "required": false; }; "isFiltering": { "alias": "p-filtering"; "required": false; }; "shouldMarkLetters": { "alias": "p-should-mark-letter"; "required": false; }; "size": { "alias": "p-size"; "required": false; }; "compareCache": { "alias": "p-compare-cache"; "required": false; }; "comboService": { "alias": "p-combo-service"; "required": false; }; "containerWidth": { "alias": "p-container-width"; "required": false; }; "keysLabel": { "alias": "p-keys-label"; "required": false; }; "footerActionListbox": { "alias": "p-footer-action-listbox"; "required": false; }; "placeholderListbox": { "alias": "p-placeholder-listbox"; "required": false; }; "separator": { "alias": "p-separator"; "required": false; }; }, { "changeSearch": "p-change-search"; "selectItem": "p-select-item"; "closeEvent": "p-close"; "change": "p-change"; "selectCombo": "p-selectcombo-item"; "changeAll": "p-change-all"; "UpdateInfiniteScroll": "p-update-infinite-scroll"; "activatedTab": "p-activated-tabs"; "clickTab": "p-click-tabs"; "changeStateTabs": "p-change-state-tabs"; "clickItem": "p-click-item"; "footerActionListboxEvent": "p-footer-action-listbox-event"; }, never, never, true, never>;
81
82
  static ngAcceptInputType_visible: any;
82
83
  static ngAcceptInputType_isTabs: any;
83
84
  static ngAcceptInputType_isServerSearching: any;
@@ -1,26 +1,36 @@
1
- import { AfterViewInit, ElementRef, OnChanges, OnDestroy, SimpleChanges } from '@angular/core';
1
+ import { AfterViewInit, ElementRef, OnChanges, OnDestroy, OnInit, QueryList, SimpleChanges } from '@angular/core';
2
2
  import { PoListBoxBaseComponent } from './po-listbox-base.component';
3
3
  import { PoItemListOptionGroup } from './po-item-list/interfaces/po-item-list-option-group.interface';
4
4
  import { PoItemListOption } from './po-item-list/interfaces/po-item-list-option.interface';
5
5
  import { PoSearchListComponent } from './po-search-list/po-search-list.component';
6
+ import { PoDropdownAction } from '../po-dropdown/po-dropdown-action.interface';
6
7
  import { Observable } from 'rxjs';
7
8
  import * as i0 from "@angular/core";
8
- export declare class PoListBoxComponent extends PoListBoxBaseComponent implements AfterViewInit, OnChanges, OnDestroy {
9
+ export declare class PoListBoxComponent extends PoListBoxBaseComponent implements OnInit, AfterViewInit, OnChanges, OnDestroy {
9
10
  element: ElementRef<any>;
11
+ currentItems: Array<PoDropdownAction>;
12
+ currentGroup: PoDropdownAction | null;
13
+ private readonly navigationStack;
10
14
  private readonly renderer;
11
15
  private readonly router;
12
16
  private readonly changeDetector;
13
17
  listbox: ElementRef;
14
18
  listboxItemList: ElementRef;
19
+ listboxGroupHeader: ElementRef;
15
20
  searchElement: PoSearchListComponent;
16
21
  popupHeaderContainer: ElementRef;
22
+ listboxItems: QueryList<ElementRef>;
17
23
  private scrollEvent$;
18
24
  private subscriptionScrollEvent;
19
25
  constructor();
26
+ ngOnInit(): void;
20
27
  ngAfterViewInit(): void;
21
28
  ngOnChanges(changes?: SimpleChanges): void;
22
29
  ngOnDestroy(): void;
23
- onSelectItem(itemListAction: PoItemListOption | PoItemListOptionGroup | any): void | Promise<boolean>;
30
+ openGroup(group: PoDropdownAction, event?: MouseEvent | KeyboardEvent): void;
31
+ goBack(event: MouseEvent | KeyboardEvent): void;
32
+ onKeydownGoBack(event: KeyboardEvent): void;
33
+ onSelectItem(itemListAction: PoItemListOption | PoItemListOptionGroup | any, event?: MouseEvent | KeyboardEvent): void | Promise<boolean>;
24
34
  onSelectAllCheckboxKeyDown(event: KeyboardEvent): void;
25
35
  onKeyDown(itemListAction: PoItemListOption | PoItemListOptionGroup | any, event?: KeyboardEvent): void;
26
36
  checkboxClicked({ option, selected }: {
@@ -47,6 +57,7 @@ export declare class PoListBoxComponent extends PoListBoxBaseComponent implement
47
57
  private includeInfiniteScroll;
48
58
  protected returnBooleanValue(itemListAction: any, property: string): any;
49
59
  private setListBoxMaxHeight;
60
+ private setListBoxWidth;
50
61
  private openUrl;
51
62
  onClickTabs(tab: any): void;
52
63
  formatItemList(item: any): string;
@@ -6,9 +6,10 @@ import * as i4 from "@angular/common";
6
6
  import * as i5 from "../po-field/po-checkbox/po-checkbox.module";
7
7
  import * as i6 from "../po-icon/po-icon.module";
8
8
  import * as i7 from "../po-loading/po-loading.module";
9
- import * as i8 from "@angular/cdk/listbox";
9
+ import * as i8 from "../po-tag/po-tag.module";
10
+ import * as i9 from "@angular/cdk/listbox";
10
11
  export declare class PoListBoxModule {
11
12
  static ɵfac: i0.ɵɵFactoryDeclaration<PoListBoxModule, never>;
12
- static ɵmod: i0.ɵɵNgModuleDeclaration<PoListBoxModule, [typeof i1.PoListBoxComponent, typeof i2.PoItemListComponent, typeof i3.PoSearchListComponent], [typeof i4.CommonModule, typeof i5.PoCheckboxModule, typeof i6.PoIconModule, typeof i7.PoLoadingModule, typeof i8.CdkListboxModule], [typeof i1.PoListBoxComponent]>;
13
+ static ɵmod: i0.ɵɵNgModuleDeclaration<PoListBoxModule, [typeof i1.PoListBoxComponent, typeof i2.PoItemListComponent, typeof i3.PoSearchListComponent], [typeof i4.CommonModule, typeof i5.PoCheckboxModule, typeof i6.PoIconModule, typeof i7.PoLoadingModule, typeof i8.PoTagModule, typeof i9.CdkListboxModule], [typeof i1.PoListBoxComponent]>;
13
14
  static ɵinj: i0.ɵɵInjectorDeclaration<PoListBoxModule>;
14
15
  }
@@ -1,3 +1,4 @@
1
+ import { TemplateRef } from '@angular/core';
1
2
  /**
2
3
  * @usedBy PoModalComponent
3
4
  *
@@ -16,6 +17,49 @@ export interface PoModalAction {
16
17
  danger?: boolean;
17
18
  /** Desabilita o botão impossibilitando que sua ação seja executada. */
18
19
  disabled?: boolean;
20
+ /**
21
+ * Ícone exibido ao lado esquerdo do label do botão.
22
+ *
23
+ * É possível usar qualquer um dos ícones da [Biblioteca de ícones](https://po-ui.io/icons), conforme exemplo:
24
+ * ```
25
+ * modalAction: PoModalAction = {
26
+ * action: () => {},
27
+ * label: 'Botão com ícone PO',
28
+ * icon: 'an an-user'
29
+ * };
30
+ * ```
31
+ * Também é possível utilizar outras fontes de ícones, por exemplo a biblioteca *Font Awesome*, desde que a biblioteca
32
+ * esteja carregada no projeto:
33
+ * ```
34
+ * modalAction: PoModalAction = {
35
+ * action: () => {},
36
+ * label: 'Botão com ícone Font Awesome',
37
+ * icon: 'fa fa-user'
38
+ * };
39
+ * ```
40
+ * Outra opção seria a customização do ícone através do `TemplateRef`, conforme exemplo abaixo:
41
+ * ```
42
+ * // Template HTML
43
+ * <ng-template #customIcon>
44
+ * <span class="fa fa-user"></span>
45
+ * </ng-template>
46
+ *
47
+ * // Componente TypeScript
48
+ * @ViewChild('customIcon', { static: true }) customIcon: TemplateRef<void>;
49
+ *
50
+ * modalAction: PoModalAction = {
51
+ * action: () => {},
52
+ * label: 'Botão com ícone customizado',
53
+ * };
54
+ *
55
+ * // Atribuição do TemplateRef à propriedade icon após a inicialização da view
56
+ * ngAfterViewInit() {
57
+ * this.modalAction.icon = this.customIcon;
58
+ * }
59
+ * ```
60
+ * > Para o ícone enquadrar corretamente, deve-se utilizar `font-size: inherit` caso o ícone utilizado não aplique-o.
61
+ */
62
+ icon?: string | TemplateRef<void>;
19
63
  /** Rótulo do botão. */
20
64
  label: string;
21
65
  /** Habilita um estado de carregamento ao botão, desabilitando-o e exibindo um ícone de carregamento à esquerda de seu rótulo. */
@@ -1,16 +1,17 @@
1
- import { PoPopupAction } from '../../po-popup/po-popup-action.interface';
1
+ import { PoDropdownAction } from '../../po-dropdown';
2
2
  /**
3
3
  * @description
4
4
  * Interface para as ações dos componentes po-page-default e po-page-list.
5
5
  *
6
- * > As propriedades `selected`, `separator` e `type` serão vistas a partir da terceira ação e somente quando
7
- * definir quatro ações ou mais.
6
+ * > Quando o array de actions possui quatro ou mais registros, os dois últimos e os seguintes são automaticamente agrupados no po-dropdown.
7
+ * 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.
8
+ * Dessa forma, o uso de subItems (agrupadores dentro do dropdown) só terá efeito quando houver pelo menos quatro ações definidas.
8
9
  *
9
- * @docsExtends PoPopupAction
10
+ * @docsExtends PoDropdownAction
10
11
  *
11
12
  * @ignoreExtendedDescription
12
13
  *
13
14
  * @usedBy PoPageDefaultComponent, PoPageListComponent
14
15
  */
15
- export interface PoPageAction extends PoPopupAction {
16
+ export interface PoPageAction extends PoDropdownAction {
16
17
  }
@@ -7,11 +7,21 @@ import { TemplateRef } from '@angular/core';
7
7
  * Interface para lista de ações do componente.
8
8
  */
9
9
  export interface PoPopupAction {
10
- /** Rótulo da ação. */
10
+ /**
11
+ * @description
12
+ *
13
+ * Rótulo da ação.
14
+ *
15
+ * No componente `po-dropdown`, a label também pode representar o agrupador de subitens.
16
+ */
11
17
  label: string;
12
18
  /**
19
+ * @description
20
+ *
13
21
  * Ação que será executada, sendo possível passar o nome ou a referência da função.
14
22
  *
23
+ * No componente `po-dropdown`, a action também pode ser executada para o agrupador de subitens.
24
+ *
15
25
  * > Para que a função seja executada no contexto do elemento filho o mesmo deve ser passado utilizando *bind*.
16
26
  *
17
27
  * Exemplo: `action: this.myFunction.bind(this)`
@@ -58,12 +68,20 @@ export interface PoPopupAction {
58
68
  * ```
59
69
  */
60
70
  icon?: string | TemplateRef<void>;
61
- /** Atribui uma linha separadora acima do item. */
71
+ /**
72
+ * @description
73
+ *
74
+ * Atribui uma linha separadora acima do item.
75
+ *
76
+ * */
62
77
  separator?: boolean;
63
78
  /**
79
+ * @description
80
+ *
64
81
  * Função que deve retornar um booleano para habilitar ou desabilitar a ação para o registro selecionado.
65
82
  *
66
83
  * Também é possível informar diretamente um valor booleano que vai habilitar ou desabilitar a ação para todos os registros.
84
+ *
67
85
  */
68
86
  disabled?: boolean | Function;
69
87
  /**
@@ -76,9 +94,23 @@ export interface PoPopupAction {
76
94
  * - `danger` - indicado para ações exclusivas (excluir, sair).
77
95
  */
78
96
  type?: string;
79
- /** URL utilizada no redirecionamento das páginas. */
97
+ /**
98
+ * @description
99
+ *
100
+ * URL utilizada para redirecionamento das páginas.
101
+ *
102
+ * No componente `po-dropdown`, a url também pode ser configurada para o agrupador de subitens.
103
+ * Entretanto, quando a `url` é informada em um agrupador, o clique **não abrirá os subitens**, pois o item será
104
+ * tratado como um link e o redirecionamento terá prioridade sobre a exibição da lista.
105
+ *
106
+ */
80
107
  url?: string;
81
- /** Define se a ação está selecionada. */
108
+ /**
109
+ * @description
110
+ *
111
+ * Define se a ação está selecionada.
112
+ *
113
+ */
82
114
  selected?: boolean;
83
115
  /**
84
116
  * @description
@@ -76,6 +76,7 @@ export declare class PoPopupBaseComponent {
76
76
  private _position?;
77
77
  private _size?;
78
78
  private _target;
79
+ listboxSubitems: boolean;
79
80
  /** Lista de ações que serão exibidas no componente. */
80
81
  set actions(value: Array<PoPopupAction>);
81
82
  get actions(): Array<PoPopupAction>;
@@ -207,5 +208,5 @@ export declare class PoPopupBaseComponent {
207
208
  closeEvent: EventEmitter<any>;
208
209
  clickItem: EventEmitter<any>;
209
210
  static ɵfac: i0.ɵɵFactoryDeclaration<PoPopupBaseComponent, never>;
210
- static ɵdir: i0.ɵɵDirectiveDeclaration<PoPopupBaseComponent, never, never, { "actions": { "alias": "p-actions"; "required": false; }; "hideArrow": { "alias": "p-hide-arrow"; "required": false; }; "isCornerAlign": { "alias": "p-is-corner-align"; "required": false; }; "position": { "alias": "p-position"; "required": false; }; "customPositions": { "alias": "p-custom-positions"; "required": false; }; "size": { "alias": "p-size"; "required": false; }; "target": { "alias": "p-target"; "required": false; }; }, { "closeEvent": "p-close"; "clickItem": "p-click-item"; }, never, never, true, never>;
211
+ static ɵdir: i0.ɵɵDirectiveDeclaration<PoPopupBaseComponent, never, never, { "listboxSubitems": { "alias": "p-listbox-subitems"; "required": false; }; "actions": { "alias": "p-actions"; "required": false; }; "hideArrow": { "alias": "p-hide-arrow"; "required": false; }; "isCornerAlign": { "alias": "p-is-corner-align"; "required": false; }; "position": { "alias": "p-position"; "required": false; }; "customPositions": { "alias": "p-custom-positions"; "required": false; }; "size": { "alias": "p-size"; "required": false; }; "target": { "alias": "p-target"; "required": false; }; }, { "closeEvent": "p-close"; "clickItem": "p-click-item"; }, never, never, true, never>;
211
212
  }
@@ -53,6 +53,10 @@ declare const poThemeDefaultDarkValuesAA: {
53
53
  'po-select': {
54
54
  '--color-hover': string;
55
55
  };
56
+ '.po-listbox-group-header .po-tag': {
57
+ color: string;
58
+ 'background-color': string;
59
+ };
56
60
  };
57
61
  onRoot: {
58
62
  '--color-caption-categorical-01': string;
@@ -72,6 +72,11 @@ declare const poThemeDefaultDarkValues: {
72
72
  'po-select': {
73
73
  '--color-hover': string;
74
74
  };
75
+ /** DROPDOWN */
76
+ '.po-listbox-group-header .po-tag': {
77
+ color: string;
78
+ 'background-color': string;
79
+ };
75
80
  };
76
81
  onRoot: {
77
82
  '--color-neutral': string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@po-ui/ng-components",
3
- "version": "19.33.0",
3
+ "version": "19.35.0-beta.1",
4
4
  "description": "PO UI - Components",
5
5
  "author": "PO UI",
6
6
  "license": "MIT",
@@ -22,8 +22,8 @@
22
22
  },
23
23
  "dependencies": {
24
24
  "@angular/cdk": "~19.0.3",
25
- "@po-ui/style": "19.33.0",
26
- "@po-ui/ng-schematics": "19.33.0",
25
+ "@po-ui/style": "19.35.0-beta.1",
26
+ "@po-ui/ng-schematics": "19.35.0-beta.1",
27
27
  "echarts": "^5.6.0",
28
28
  "tslib": "^2.6.2"
29
29
  },
@@ -38,7 +38,7 @@
38
38
  "@angular/platform-browser-dynamic": "^19",
39
39
  "@angular/router": "^19",
40
40
  "@angular-devkit/schematics": "^19",
41
- "@po-ui/style": "19.33.0",
41
+ "@po-ui/style": "19.35.0-beta.1",
42
42
  "rxjs": "~7.8.1",
43
43
  "zone.js": "~0.15.0"
44
44
  },
@@ -18,7 +18,7 @@ function default_1(options) {
18
18
  }
19
19
  function addPoPackageAndInstall() {
20
20
  return (tree, context) => {
21
- (0, package_config_1.addPackageToPackageJson)(tree, '@po-ui/ng-components', '19.33.0');
21
+ (0, package_config_1.addPackageToPackageJson)(tree, '@po-ui/ng-components', '19.35.0-beta.1');
22
22
  // install packages
23
23
  context.addTask(new tasks_1.NodePackageInstallTask());
24
24
  };
@@ -6,7 +6,7 @@ const tasks_1 = require("@angular-devkit/schematics/tasks");
6
6
  const package_config_1 = require("@po-ui/ng-schematics/package-config");
7
7
  const changes_1 = require("./changes");
8
8
  function default_1() {
9
- return (0, schematics_1.chain)([(0, package_config_1.updatePackageJson)('19.33.0', changes_1.updateDepedenciesVersion), postUpdate()]);
9
+ return (0, schematics_1.chain)([(0, package_config_1.updatePackageJson)('19.35.0-beta.1', changes_1.updateDepedenciesVersion), postUpdate()]);
10
10
  }
11
11
  function postUpdate() {
12
12
  return (_, context) => {
@@ -11,7 +11,7 @@ const changes_1 = require("./changes");
11
11
  const httpClientModuleName = 'HttpClientModule';
12
12
  const httpClientModuleSourcePath = '@angular/common/http';
13
13
  function default_1() {
14
- return (0, schematics_1.chain)([(0, package_config_1.updatePackageJson)('19.33.0', changes_1.updateDepedenciesVersion), createUpgradeRule(), postUpdate()]);
14
+ return (0, schematics_1.chain)([(0, package_config_1.updatePackageJson)('19.35.0-beta.1', changes_1.updateDepedenciesVersion), createUpgradeRule(), postUpdate()]);
15
15
  }
16
16
  function postUpdate() {
17
17
  return (_, context) => {
@@ -6,7 +6,7 @@ const tasks_1 = require("@angular-devkit/schematics/tasks");
6
6
  const package_config_1 = require("@po-ui/ng-schematics/package-config");
7
7
  const changes_1 = require("./changes");
8
8
  function default_1() {
9
- return (0, schematics_1.chain)([(0, package_config_1.updatePackageJson)('19.33.0', changes_1.updateDepedenciesVersion), postUpdate()]);
9
+ return (0, schematics_1.chain)([(0, package_config_1.updatePackageJson)('19.35.0-beta.1', changes_1.updateDepedenciesVersion), postUpdate()]);
10
10
  }
11
11
  function postUpdate() {
12
12
  return (_, context) => {
@@ -6,7 +6,7 @@ const tasks_1 = require("@angular-devkit/schematics/tasks");
6
6
  const package_config_1 = require("@po-ui/ng-schematics/package-config");
7
7
  const changes_1 = require("./changes");
8
8
  function default_1() {
9
- return (0, schematics_1.chain)([(0, package_config_1.updatePackageJson)('19.33.0', changes_1.updateDepedenciesVersion), postUpdate()]);
9
+ return (0, schematics_1.chain)([(0, package_config_1.updatePackageJson)('19.35.0-beta.1', changes_1.updateDepedenciesVersion), postUpdate()]);
10
10
  }
11
11
  function postUpdate() {
12
12
  return (_, context) => {
@@ -40,11 +40,11 @@ function main(options) {
40
40
  configureNewIcon.toLowerCase() === 'y' ||
41
41
  configureNewIcon.toLowerCase() === 'sim' ||
42
42
  configureNewIcon.toLowerCase() === '') {
43
- return (0, schematics_1.chain)([(0, package_config_1.updatePackageJson)('19.33.0', changes_1.updateDepedenciesVersion), createUpgradeRule(), postUpdate()]);
43
+ return (0, schematics_1.chain)([(0, package_config_1.updatePackageJson)('19.35.0-beta.1', changes_1.updateDepedenciesVersion), createUpgradeRule(), postUpdate()]);
44
44
  }
45
45
  else {
46
46
  return (0, schematics_1.chain)([
47
- (0, package_config_1.updatePackageJson)('19.33.0', changes_1.updateDepedenciesVersion),
47
+ (0, package_config_1.updatePackageJson)('19.35.0-beta.1', changes_1.updateDepedenciesVersion),
48
48
  addImportOnly(options, [IconsDictionaryName, poIconDictionary], poModuleSourcePath),
49
49
  addProviderToAppModule(options, newProviderDictionary),
50
50
  updateAppConfigFileRule(),
@@ -40,11 +40,11 @@ function main(options) {
40
40
  configureNewIcon.toLowerCase() === 'y' ||
41
41
  configureNewIcon.toLowerCase() === 'sim' ||
42
42
  configureNewIcon.toLowerCase() === '') {
43
- return (0, schematics_1.chain)([(0, package_config_1.updatePackageJson)('19.33.0', changes_1.updateDepedenciesVersion), createUpgradeRule(), postUpdate()]);
43
+ return (0, schematics_1.chain)([(0, package_config_1.updatePackageJson)('19.35.0-beta.1', changes_1.updateDepedenciesVersion), createUpgradeRule(), postUpdate()]);
44
44
  }
45
45
  else {
46
46
  return (0, schematics_1.chain)([
47
- (0, package_config_1.updatePackageJson)('19.33.0', changes_1.updateDepedenciesVersion),
47
+ (0, package_config_1.updatePackageJson)('19.35.0-beta.1', changes_1.updateDepedenciesVersion),
48
48
  addImportOnly(options, [IconsDictionaryName, poIconDictionary], poModuleSourcePath),
49
49
  addProviderToAppModule(options, newProviderDictionary),
50
50
  updateAppConfigFileRule(),
@@ -10,7 +10,7 @@ const package_config_1 = require("@po-ui/ng-schematics/package-config");
10
10
  const changes_1 = require("./changes");
11
11
  function updateToV2() {
12
12
  return (0, schematics_1.chain)([
13
- updatePackageJson('19.33.0', changes_1.dependeciesChanges),
13
+ updatePackageJson('19.35.0-beta.1', changes_1.dependeciesChanges),
14
14
  (0, replace_1.replaceInFile)('tslint.json', changes_1.tsLintReplaces),
15
15
  (0, replace_1.replaceInFile)('angular.json', changes_1.angularJsonReplaces),
16
16
  createUpgradeRule(),
@@ -7,7 +7,7 @@ const project_1 = require("@po-ui/ng-schematics/project");
7
7
  const package_config_1 = require("@po-ui/ng-schematics/package-config");
8
8
  const changes_1 = require("./changes");
9
9
  function updateToV3() {
10
- return (0, schematics_1.chain)([(0, package_config_1.updatePackageJson)('19.33.0', changes_1.updateDepedenciesVersion), createUpgradeRule(), postUpdate()]);
10
+ return (0, schematics_1.chain)([(0, package_config_1.updatePackageJson)('19.35.0-beta.1', changes_1.updateDepedenciesVersion), createUpgradeRule(), postUpdate()]);
11
11
  }
12
12
  function postUpdate() {
13
13
  return (_, context) => {
@@ -7,7 +7,7 @@ const project_1 = require("@po-ui/ng-schematics/project");
7
7
  const package_config_1 = require("@po-ui/ng-schematics/package-config");
8
8
  const changes_1 = require("./changes");
9
9
  function default_1() {
10
- return (0, schematics_1.chain)([(0, package_config_1.updatePackageJson)('19.33.0', changes_1.updateDepedenciesVersion), createUpgradeRule(), postUpdate()]);
10
+ return (0, schematics_1.chain)([(0, package_config_1.updatePackageJson)('19.35.0-beta.1', changes_1.updateDepedenciesVersion), createUpgradeRule(), postUpdate()]);
11
11
  }
12
12
  function postUpdate() {
13
13
  return (_, context) => {
@@ -7,7 +7,7 @@ const project_1 = require("@po-ui/ng-schematics/project");
7
7
  const package_config_1 = require("@po-ui/ng-schematics/package-config");
8
8
  const changes_1 = require("./changes");
9
9
  function default_1() {
10
- return (0, schematics_1.chain)([(0, package_config_1.updatePackageJson)('19.33.0', changes_1.updateDepedenciesVersion), createUpgradeRule(), postUpdate()]);
10
+ return (0, schematics_1.chain)([(0, package_config_1.updatePackageJson)('19.35.0-beta.1', changes_1.updateDepedenciesVersion), createUpgradeRule(), postUpdate()]);
11
11
  }
12
12
  function postUpdate() {
13
13
  return (_, context) => {
@@ -6,7 +6,7 @@ const tasks_1 = require("@angular-devkit/schematics/tasks");
6
6
  const package_config_1 = require("@po-ui/ng-schematics/package-config");
7
7
  const changes_1 = require("./changes");
8
8
  function default_1() {
9
- return (0, schematics_1.chain)([(0, package_config_1.updatePackageJson)('19.33.0', changes_1.updateDepedenciesVersion), postUpdate()]);
9
+ return (0, schematics_1.chain)([(0, package_config_1.updatePackageJson)('19.35.0-beta.1', changes_1.updateDepedenciesVersion), postUpdate()]);
10
10
  }
11
11
  function postUpdate() {
12
12
  return (_, context) => {
Binary file