@po-ui/ng-components 20.7.0 → 20.8.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 (30) hide show
  1. package/fesm2022/po-ui-ng-components.mjs +195 -59
  2. package/fesm2022/po-ui-ng-components.mjs.map +1 -1
  3. package/index.d.ts +200 -128
  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 +1 -0
  8. package/lib/components/po-listbox/po-listbox-base.component.d.ts +8 -7
  9. package/lib/components/po-listbox/po-listbox.component.d.ts +14 -3
  10. package/lib/components/po-page/interfaces/po-page-action.interface.d.ts +6 -5
  11. package/lib/components/po-popup/po-popup-action.interface.d.ts +36 -4
  12. package/lib/components/po-popup/po-popup-base.component.d.ts +1 -0
  13. package/lib/services/po-theme/helpers/types/po-theme-dark-defaults-AA.constant.d.ts +4 -0
  14. package/lib/services/po-theme/helpers/types/po-theme-dark-defaults.constant.d.ts +5 -0
  15. package/package.json +4 -4
  16. package/po-ui-ng-components-20.8.0.tgz +0 -0
  17. package/schematics/ng-add/index.js +1 -1
  18. package/schematics/ng-update/v14/index.js +1 -1
  19. package/schematics/ng-update/v15/index.js +1 -1
  20. package/schematics/ng-update/v16/index.js +1 -1
  21. package/schematics/ng-update/v17/index.js +1 -1
  22. package/schematics/ng-update/v18/index.js +2 -2
  23. package/schematics/ng-update/v19/index.js +2 -2
  24. package/schematics/ng-update/v2/index.js +1 -1
  25. package/schematics/ng-update/v20/index.js +2 -2
  26. package/schematics/ng-update/v3/index.js +1 -1
  27. package/schematics/ng-update/v4/index.js +1 -1
  28. package/schematics/ng-update/v5/index.js +1 -1
  29. package/schematics/ng-update/v6/index.js +1 -1
  30. package/po-ui-ng-components-20.7.0.tgz +0 -0
package/index.d.ts CHANGED
@@ -10,7 +10,7 @@ import { Router } from '@angular/router';
10
10
  import * as i3$1 from '@angular/forms';
11
11
  import { ControlValueAccessor, AbstractControl, Validator, ValidationErrors, NgForm } from '@angular/forms';
12
12
  import * as i3 from '@angular/cdk/overlay';
13
- import * as i8 from '@angular/cdk/listbox';
13
+ import * as i9 from '@angular/cdk/listbox';
14
14
  import * as _po_ui_ng_components from '@po-ui/ng-components';
15
15
  import { HttpHeaders, HttpClient, HttpInterceptor, HttpRequest, HttpHandler, HttpEvent, HttpResponse, HttpErrorResponse } from '@angular/common/http';
16
16
  import * as i19 from '@angular/cdk/drag-drop';
@@ -1795,6 +1795,7 @@ declare class PoItemListBaseComponent {
1795
1795
  * Define um ícone que será exibido ao lado esquerdo do rótulo.
1796
1796
  */
1797
1797
  icon: string | TemplateRef<void>;
1798
+ iconPosition: 'left' | 'right';
1798
1799
  /**
1799
1800
  * @optional
1800
1801
  *
@@ -1825,7 +1826,7 @@ declare class PoItemListBaseComponent {
1825
1826
  keysLabel?: Array<string>;
1826
1827
  protected emitActiveTabs(tab: any): void;
1827
1828
  static ɵfac: i0.ɵɵFactoryDeclaration<PoItemListBaseComponent, never>;
1828
- 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>;
1829
+ 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>;
1829
1830
  static ngAcceptInputType_danger: any;
1830
1831
  static ngAcceptInputType_selected: any;
1831
1832
  static ngAcceptInputType_separator: any;
@@ -1859,6 +1860,8 @@ declare class PoItemListComponent extends PoItemListBaseComponent implements OnC
1859
1860
  * Interface para definição de literais utilizadas no `po-listbox`
1860
1861
  */
1861
1862
  interface PoListBoxLiterals {
1863
+ /** Texto do botão para voltar ao agrupador anterior. */
1864
+ backToPreviousGroup?: string;
1862
1865
  /** Texto exibido quando não houver itens na lista */
1863
1866
  noItems?: string;
1864
1867
  /** Texto do *placeholder* do campo de busca. */
@@ -1922,6 +1925,7 @@ declare class PoListBoxBaseComponent {
1922
1925
  private _literals;
1923
1926
  private language;
1924
1927
  private _size?;
1928
+ listboxSubitems: boolean;
1925
1929
  visible: boolean;
1926
1930
  set type(value: string);
1927
1931
  get type(): PoItemListType;
@@ -1932,18 +1936,11 @@ declare class PoListBoxBaseComponent {
1932
1936
  get isItemListGroup(): boolean;
1933
1937
  isTabs: boolean;
1934
1938
  param?: any;
1935
- selectItem: EventEmitter<any>;
1936
- closeEvent: EventEmitter<any>;
1937
- change: EventEmitter<any>;
1938
- selectCombo: EventEmitter<any>;
1939
- changeAll: EventEmitter<any>;
1940
- UpdateInfiniteScroll: EventEmitter<any>;
1941
1939
  checkboxAllValue: any;
1942
1940
  selectedOptions: Array<any>;
1943
1941
  selectedOption?: any;
1944
1942
  fieldValue: string;
1945
1943
  fieldLabel: string;
1946
- changeSearch: EventEmitter<any>;
1947
1944
  literalSearch?: any;
1948
1945
  fieldValueSearch: string;
1949
1946
  hideSearch?: boolean;
@@ -1969,6 +1966,13 @@ declare class PoListBoxBaseComponent {
1969
1966
  footerActionListbox: boolean;
1970
1967
  placeholderListbox: string;
1971
1968
  separator: boolean;
1969
+ changeSearch: EventEmitter<any>;
1970
+ selectItem: EventEmitter<any>;
1971
+ closeEvent: EventEmitter<any>;
1972
+ change: EventEmitter<any>;
1973
+ selectCombo: EventEmitter<any>;
1974
+ changeAll: EventEmitter<any>;
1975
+ UpdateInfiniteScroll: EventEmitter<any>;
1972
1976
  activatedTab: EventEmitter<any>;
1973
1977
  clickTab: EventEmitter<any>;
1974
1978
  changeStateTabs: EventEmitter<any>;
@@ -1976,7 +1980,7 @@ declare class PoListBoxBaseComponent {
1976
1980
  footerActionListboxEvent: EventEmitter<any>;
1977
1981
  constructor(languageService: PoLanguageService);
1978
1982
  static ɵfac: i0.ɵɵFactoryDeclaration<PoListBoxBaseComponent, never>;
1979
- 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>;
1983
+ 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>;
1980
1984
  static ngAcceptInputType_visible: any;
1981
1985
  static ngAcceptInputType_isTabs: any;
1982
1986
  static ngAcceptInputType_isServerSearching: any;
@@ -1985,22 +1989,183 @@ declare class PoListBoxBaseComponent {
1985
1989
  static ngAcceptInputType_cache: any;
1986
1990
  }
1987
1991
 
1988
- declare class PoListBoxComponent extends PoListBoxBaseComponent implements AfterViewInit, OnChanges, OnDestroy {
1992
+ /**
1993
+ * @usedBy PoPopupComponent, PoWidgetComponent
1994
+ *
1995
+ * @description
1996
+ *
1997
+ * Interface para lista de ações do componente.
1998
+ */
1999
+ interface PoPopupAction {
2000
+ /**
2001
+ * @description
2002
+ *
2003
+ * Rótulo da ação.
2004
+ *
2005
+ * No componente `po-dropdown`, a label também pode representar o agrupador de subitens.
2006
+ */
2007
+ label: string;
2008
+ /**
2009
+ * @description
2010
+ *
2011
+ * Ação que será executada, sendo possível passar o nome ou a referência da função.
2012
+ *
2013
+ * No componente `po-dropdown`, a action também pode ser executada para o agrupador de subitens.
2014
+ *
2015
+ * > Para que a função seja executada no contexto do elemento filho o mesmo deve ser passado utilizando *bind*.
2016
+ *
2017
+ * Exemplo: `action: this.myFunction.bind(this)`
2018
+ */
2019
+ action?: Function;
2020
+ /**
2021
+ * @description
2022
+ *
2023
+ * Define um ícone que será exibido ao lado esquerdo do rótulo.
2024
+ *
2025
+ * É possível usar qualquer um dos ícones da [Biblioteca de ícones](https://po-ui.io/icons). conforme exemplo abaixo:
2026
+ * ```
2027
+ * <po-component
2028
+ * [p-property]="[{ label: 'PHOSPHOR ICON', icon: 'an an-newspaper' }]">
2029
+ * </po-component>
2030
+ * ```
2031
+ *
2032
+ * Também é possível utilizar outras fontes de ícones, por exemplo a biblioteca Font Awesome, da seguinte forma:
2033
+ * ```
2034
+ * <po-component
2035
+ * [p-property]="[{ label: 'FA ICON', icon: 'fa fa-icon-podcast' }]">
2036
+ * </po-component>
2037
+ * ```
2038
+ *
2039
+ * Outra opção seria a customização do ícone através do `TemplateRef`, conforme exemplo abaixo:
2040
+ * component.html:
2041
+ * ```
2042
+ * <ng-template #iconTemplate>
2043
+ * <ion-icon name="heart"></ion-icon>
2044
+ * </ng-template>
2045
+ *
2046
+ * <po-component [p-property]="myProperty"></po-component>
2047
+ * ```
2048
+ * component.ts:
2049
+ * ```
2050
+ * @ViewChild('iconTemplate', { static: true } ) iconTemplate : TemplateRef<void>;
2051
+ *
2052
+ * myProperty = [
2053
+ * {
2054
+ * label: 'FA ICON',
2055
+ * icon: this.iconTemplate
2056
+ * }
2057
+ * ];
2058
+ * ```
2059
+ */
2060
+ icon?: string | TemplateRef<void>;
2061
+ /**
2062
+ * @description
2063
+ *
2064
+ * Atribui uma linha separadora acima do item.
2065
+ *
2066
+ * */
2067
+ separator?: boolean;
2068
+ /**
2069
+ * @description
2070
+ *
2071
+ * Função que deve retornar um booleano para habilitar ou desabilitar a ação para o registro selecionado.
2072
+ *
2073
+ * Também é possível informar diretamente um valor booleano que vai habilitar ou desabilitar a ação para todos os registros.
2074
+ *
2075
+ */
2076
+ disabled?: boolean | Function;
2077
+ /**
2078
+ * @description
2079
+ *
2080
+ * Define a cor do item, sendo `default` o padrão.
2081
+ *
2082
+ * Valores válidos:
2083
+ * - `default`
2084
+ * - `danger` - indicado para ações exclusivas (excluir, sair).
2085
+ */
2086
+ type?: string;
2087
+ /**
2088
+ * @description
2089
+ *
2090
+ * URL utilizada para redirecionamento das páginas.
2091
+ *
2092
+ * No componente `po-dropdown`, a url também pode ser configurada para o agrupador de subitens.
2093
+ * Entretanto, quando a `url` é informada em um agrupador, o clique **não abrirá os subitens**, pois o item será
2094
+ * tratado como um link e o redirecionamento terá prioridade sobre a exibição da lista.
2095
+ *
2096
+ */
2097
+ url?: string;
2098
+ /**
2099
+ * @description
2100
+ *
2101
+ * Define se a ação está selecionada.
2102
+ *
2103
+ */
2104
+ selected?: boolean;
2105
+ /**
2106
+ * @description
2107
+ *
2108
+ * Define se a ação será visível.
2109
+ *
2110
+ * > Caso o valor não seja especificado a ação será visível.
2111
+ *
2112
+ * Opções para tornar a ação visível ou não:
2113
+ *
2114
+ * - Função que deve retornar um booleano.
2115
+ *
2116
+ * - Informar diretamente um valor booleano.
2117
+ *
2118
+ */
2119
+ visible?: boolean | Function;
2120
+ $id?: string;
2121
+ }
2122
+
2123
+ /**
2124
+ * @description
2125
+ * Interface do componente po-dropdown
2126
+ *
2127
+ * @docsExtends PoPopupAction
2128
+ *
2129
+ * @usedBy PoDropdownComponent
2130
+ */
2131
+ interface PoDropdownAction extends PoPopupAction {
2132
+ /**
2133
+ * Array de ações (`PoDropdownAction`) usado para criar agrupadores de subitens.
2134
+ *
2135
+ * - Permite a criação de menus aninhados (submenus).
2136
+ *
2137
+ * > Boas práticas de desenvolvimento:
2138
+ * Recomenda-se limitar a navegação a, no máximo, três níveis hierárquicos.
2139
+ * Isso evita sobrecarga cognitiva, facilita a memorização da estrutura e garante uma melhor experiência de uso.
2140
+ */
2141
+ subItems?: Array<PoDropdownAction>;
2142
+ }
2143
+
2144
+ declare class PoListBoxComponent extends PoListBoxBaseComponent implements OnInit, AfterViewInit, OnChanges, OnDestroy {
1989
2145
  element: ElementRef<any>;
2146
+ currentItems: Array<PoDropdownAction>;
2147
+ currentGroup: PoDropdownAction | null;
2148
+ private readonly navigationStack;
1990
2149
  private readonly renderer;
1991
2150
  private readonly router;
1992
2151
  private readonly changeDetector;
1993
2152
  listbox: ElementRef;
1994
2153
  listboxItemList: ElementRef;
2154
+ listboxGroupHeader: ElementRef;
1995
2155
  searchElement: PoSearchListComponent;
1996
2156
  popupHeaderContainer: ElementRef;
2157
+ listboxItems: QueryList<ElementRef>;
1997
2158
  private scrollEvent$;
1998
2159
  private subscriptionScrollEvent;
1999
2160
  constructor();
2161
+ ngOnInit(): void;
2000
2162
  ngAfterViewInit(): void;
2001
2163
  ngOnChanges(changes?: SimpleChanges): void;
2002
2164
  ngOnDestroy(): void;
2003
- onSelectItem(itemListAction: PoItemListOption | PoItemListOptionGroup | any): void | Promise<boolean>;
2165
+ openGroup(group: PoDropdownAction, event?: MouseEvent | KeyboardEvent): void;
2166
+ goBack(event: MouseEvent | KeyboardEvent): void;
2167
+ onKeydownGoBack(event: KeyboardEvent): void;
2168
+ onSelectItem(itemListAction: PoItemListOption | PoItemListOptionGroup | any, event?: MouseEvent | KeyboardEvent): void | Promise<boolean>;
2004
2169
  onSelectAllCheckboxKeyDown(event: KeyboardEvent): void;
2005
2170
  onKeyDown(itemListAction: PoItemListOption | PoItemListOptionGroup | any, event?: KeyboardEvent): void;
2006
2171
  checkboxClicked({ option, selected }: {
@@ -2027,6 +2192,7 @@ declare class PoListBoxComponent extends PoListBoxBaseComponent implements After
2027
2192
  private includeInfiniteScroll;
2028
2193
  protected returnBooleanValue(itemListAction: any, property: string): any;
2029
2194
  private setListBoxMaxHeight;
2195
+ private setListBoxWidth;
2030
2196
  private openUrl;
2031
2197
  onClickTabs(tab: any): void;
2032
2198
  formatItemList(item: any): string;
@@ -3736,109 +3902,10 @@ declare class PoCheckboxModule {
3736
3902
 
3737
3903
  declare class PoListBoxModule {
3738
3904
  static ɵfac: i0.ɵɵFactoryDeclaration<PoListBoxModule, never>;
3739
- static ɵmod: i0.ɵɵNgModuleDeclaration<PoListBoxModule, [typeof PoListBoxComponent, typeof PoItemListComponent, typeof PoSearchListComponent], [typeof i2.CommonModule, typeof PoCheckboxModule, typeof PoIconModule, typeof PoLoadingModule, typeof i8.CdkListboxModule], [typeof PoListBoxComponent]>;
3905
+ static ɵmod: i0.ɵɵNgModuleDeclaration<PoListBoxModule, [typeof PoListBoxComponent, typeof PoItemListComponent, typeof PoSearchListComponent], [typeof i2.CommonModule, typeof PoCheckboxModule, typeof PoIconModule, typeof PoLoadingModule, typeof PoTagModule, typeof i9.CdkListboxModule], [typeof PoListBoxComponent]>;
3740
3906
  static ɵinj: i0.ɵɵInjectorDeclaration<PoListBoxModule>;
3741
3907
  }
3742
3908
 
3743
- /**
3744
- * @usedBy PoPopupComponent, PoWidgetComponent
3745
- *
3746
- * @description
3747
- *
3748
- * Interface para lista de ações do componente.
3749
- */
3750
- interface PoPopupAction {
3751
- /** Rótulo da ação. */
3752
- label: string;
3753
- /**
3754
- * Ação que será executada, sendo possível passar o nome ou a referência da função.
3755
- *
3756
- * > Para que a função seja executada no contexto do elemento filho o mesmo deve ser passado utilizando *bind*.
3757
- *
3758
- * Exemplo: `action: this.myFunction.bind(this)`
3759
- */
3760
- action?: Function;
3761
- /**
3762
- * @description
3763
- *
3764
- * Define um ícone que será exibido ao lado esquerdo do rótulo.
3765
- *
3766
- * É possível usar qualquer um dos ícones da [Biblioteca de ícones](https://po-ui.io/icons). conforme exemplo abaixo:
3767
- * ```
3768
- * <po-component
3769
- * [p-property]="[{ label: 'PHOSPHOR ICON', icon: 'an an-newspaper' }]">
3770
- * </po-component>
3771
- * ```
3772
- *
3773
- * Também é possível utilizar outras fontes de ícones, por exemplo a biblioteca Font Awesome, da seguinte forma:
3774
- * ```
3775
- * <po-component
3776
- * [p-property]="[{ label: 'FA ICON', icon: 'fa fa-icon-podcast' }]">
3777
- * </po-component>
3778
- * ```
3779
- *
3780
- * Outra opção seria a customização do ícone através do `TemplateRef`, conforme exemplo abaixo:
3781
- * component.html:
3782
- * ```
3783
- * <ng-template #iconTemplate>
3784
- * <ion-icon name="heart"></ion-icon>
3785
- * </ng-template>
3786
- *
3787
- * <po-component [p-property]="myProperty"></po-component>
3788
- * ```
3789
- * component.ts:
3790
- * ```
3791
- * @ViewChild('iconTemplate', { static: true } ) iconTemplate : TemplateRef<void>;
3792
- *
3793
- * myProperty = [
3794
- * {
3795
- * label: 'FA ICON',
3796
- * icon: this.iconTemplate
3797
- * }
3798
- * ];
3799
- * ```
3800
- */
3801
- icon?: string | TemplateRef<void>;
3802
- /** Atribui uma linha separadora acima do item. */
3803
- separator?: boolean;
3804
- /**
3805
- * Função que deve retornar um booleano para habilitar ou desabilitar a ação para o registro selecionado.
3806
- *
3807
- * Também é possível informar diretamente um valor booleano que vai habilitar ou desabilitar a ação para todos os registros.
3808
- */
3809
- disabled?: boolean | Function;
3810
- /**
3811
- * @description
3812
- *
3813
- * Define a cor do item, sendo `default` o padrão.
3814
- *
3815
- * Valores válidos:
3816
- * - `default`
3817
- * - `danger` - indicado para ações exclusivas (excluir, sair).
3818
- */
3819
- type?: string;
3820
- /** URL utilizada no redirecionamento das páginas. */
3821
- url?: string;
3822
- /** Define se a ação está selecionada. */
3823
- selected?: boolean;
3824
- /**
3825
- * @description
3826
- *
3827
- * Define se a ação será visível.
3828
- *
3829
- * > Caso o valor não seja especificado a ação será visível.
3830
- *
3831
- * Opções para tornar a ação visível ou não:
3832
- *
3833
- * - Função que deve retornar um booleano.
3834
- *
3835
- * - Informar diretamente um valor booleano.
3836
- *
3837
- */
3838
- visible?: boolean | Function;
3839
- $id?: string;
3840
- }
3841
-
3842
3909
  /**
3843
3910
  * @description
3844
3911
  *
@@ -3914,6 +3981,7 @@ declare class PoPopupBaseComponent {
3914
3981
  private _position?;
3915
3982
  private _size?;
3916
3983
  private _target;
3984
+ listboxSubitems: boolean;
3917
3985
  /** Lista de ações que serão exibidas no componente. */
3918
3986
  set actions(value: Array<PoPopupAction>);
3919
3987
  get actions(): Array<PoPopupAction>;
@@ -4045,7 +4113,7 @@ declare class PoPopupBaseComponent {
4045
4113
  closeEvent: EventEmitter<any>;
4046
4114
  clickItem: EventEmitter<any>;
4047
4115
  static ɵfac: i0.ɵɵFactoryDeclaration<PoPopupBaseComponent, never>;
4048
- 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>;
4116
+ 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>;
4049
4117
  }
4050
4118
 
4051
4119
  /**
@@ -9504,17 +9572,6 @@ declare class PoSwitchModule {
9504
9572
  static ɵinj: i0.ɵɵInjectorDeclaration<PoSwitchModule>;
9505
9573
  }
9506
9574
 
9507
- /**
9508
- * @description
9509
- * Interface do componente po-dropdown
9510
- *
9511
- * @docsExtends PoPopupAction
9512
- *
9513
- * @usedBy PoDropdownComponent
9514
- */
9515
- interface PoDropdownAction extends PoPopupAction {
9516
- }
9517
-
9518
9575
  /**
9519
9576
  * @description
9520
9577
  *
@@ -9626,6 +9683,11 @@ declare class PoDropdownBaseComponent {
9626
9683
  * <file name="sample-po-dropdown-basic/sample-po-dropdown-basic.component.ts"> </file>
9627
9684
  * </example>
9628
9685
  *
9686
+ * <example name="po-dropdown-subitems" title="PO Dropdown Subitems" >
9687
+ * <file name="sample-po-dropdown-subitems/sample-po-dropdown-subitems.component.html"> </file>
9688
+ * <file name="sample-po-dropdown-subitems/sample-po-dropdown-subitems.component.ts"> </file>
9689
+ * </example>
9690
+ *
9629
9691
  * <example name="po-dropdown-labs" title="PO Dropdown Labs" >
9630
9692
  * <file name="sample-po-dropdown-labs/sample-po-dropdown-labs.component.html"> </file>
9631
9693
  * <file name="sample-po-dropdown-labs/sample-po-dropdown-labs.component.ts"> </file>
@@ -26171,16 +26233,17 @@ declare class PoPageContentComponent extends PoPageContentBaseComponent implemen
26171
26233
  * @description
26172
26234
  * Interface para as ações dos componentes po-page-default e po-page-list.
26173
26235
  *
26174
- * > As propriedades `selected`, `separator` e `type` serão vistas a partir da terceira ação e somente quando
26175
- * definir quatro ações ou mais.
26236
+ * > Quando o array de actions possui quatro ou mais registros, os dois últimos e os seguintes são automaticamente agrupados no po-dropdown.
26237
+ * 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.
26238
+ * Dessa forma, o uso de subItems (agrupadores dentro do dropdown) só terá efeito quando houver pelo menos quatro ações definidas.
26176
26239
  *
26177
- * @docsExtends PoPopupAction
26240
+ * @docsExtends PoDropdownAction
26178
26241
  *
26179
26242
  * @ignoreExtendedDescription
26180
26243
  *
26181
26244
  * @usedBy PoPageDefaultComponent, PoPageListComponent
26182
26245
  */
26183
- interface PoPageAction extends PoPopupAction {
26246
+ interface PoPageAction extends PoDropdownAction {
26184
26247
  }
26185
26248
 
26186
26249
  /**
@@ -31042,6 +31105,11 @@ declare const poThemeDefaultDarkValues: {
31042
31105
  'po-select': {
31043
31106
  '--color-hover': string;
31044
31107
  };
31108
+ /** DROPDOWN */
31109
+ '.po-listbox-group-header .po-tag': {
31110
+ color: string;
31111
+ 'background-color': string;
31112
+ };
31045
31113
  };
31046
31114
  onRoot: {
31047
31115
  '--color-neutral': string;
@@ -31142,6 +31210,10 @@ declare const poThemeDefaultDarkValuesAA: {
31142
31210
  'po-select': {
31143
31211
  '--color-hover': string;
31144
31212
  };
31213
+ '.po-listbox-group-header .po-tag': {
31214
+ color: string;
31215
+ 'background-color': string;
31216
+ };
31145
31217
  };
31146
31218
  onRoot: {
31147
31219
  '--color-caption-categorical-01': string;
@@ -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
  }
@@ -10,6 +10,11 @@ import { PoDropdownBaseComponent } from './po-dropdown-base.component';
10
10
  * <file name="sample-po-dropdown-basic/sample-po-dropdown-basic.component.ts"> </file>
11
11
  * </example>
12
12
  *
13
+ * <example name="po-dropdown-subitems" title="PO Dropdown Subitems" >
14
+ * <file name="sample-po-dropdown-subitems/sample-po-dropdown-subitems.component.html"> </file>
15
+ * <file name="sample-po-dropdown-subitems/sample-po-dropdown-subitems.component.ts"> </file>
16
+ * </example>
17
+ *
13
18
  * <example name="po-dropdown-labs" title="PO Dropdown Labs" >
14
19
  * <file name="sample-po-dropdown-labs/sample-po-dropdown-labs.component.html"> </file>
15
20
  * <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. */
@@ -76,6 +76,7 @@ export declare class PoItemListBaseComponent {
76
76
  * Define um ícone que será exibido ao lado esquerdo do rótulo.
77
77
  */
78
78
  icon: string | TemplateRef<void>;
79
+ iconPosition: 'left' | 'right';
79
80
  /**
80
81
  * @optional
81
82
  *
@@ -22,6 +22,7 @@ export declare class PoListBoxBaseComponent {
22
22
  private _literals;
23
23
  private language;
24
24
  private _size?;
25
+ listboxSubitems: boolean;
25
26
  visible: boolean;
26
27
  set type(value: string);
27
28
  get type(): PoItemListType;
@@ -32,18 +33,11 @@ export declare class PoListBoxBaseComponent {
32
33
  get isItemListGroup(): boolean;
33
34
  isTabs: boolean;
34
35
  param?: any;
35
- selectItem: EventEmitter<any>;
36
- closeEvent: EventEmitter<any>;
37
- change: EventEmitter<any>;
38
- selectCombo: EventEmitter<any>;
39
- changeAll: EventEmitter<any>;
40
- UpdateInfiniteScroll: EventEmitter<any>;
41
36
  checkboxAllValue: any;
42
37
  selectedOptions: Array<any>;
43
38
  selectedOption?: any;
44
39
  fieldValue: string;
45
40
  fieldLabel: string;
46
- changeSearch: EventEmitter<any>;
47
41
  literalSearch?: any;
48
42
  fieldValueSearch: string;
49
43
  hideSearch?: boolean;
@@ -69,6 +63,13 @@ export declare class PoListBoxBaseComponent {
69
63
  footerActionListbox: boolean;
70
64
  placeholderListbox: string;
71
65
  separator: boolean;
66
+ changeSearch: EventEmitter<any>;
67
+ selectItem: EventEmitter<any>;
68
+ closeEvent: EventEmitter<any>;
69
+ change: EventEmitter<any>;
70
+ selectCombo: EventEmitter<any>;
71
+ changeAll: EventEmitter<any>;
72
+ UpdateInfiniteScroll: EventEmitter<any>;
72
73
  activatedTab: EventEmitter<any>;
73
74
  clickTab: EventEmitter<any>;
74
75
  changeStateTabs: EventEmitter<any>;
@@ -1,25 +1,35 @@
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
- export declare class PoListBoxComponent extends PoListBoxBaseComponent implements AfterViewInit, OnChanges, OnDestroy {
8
+ export declare class PoListBoxComponent extends PoListBoxBaseComponent implements OnInit, AfterViewInit, OnChanges, OnDestroy {
8
9
  element: ElementRef<any>;
10
+ currentItems: Array<PoDropdownAction>;
11
+ currentGroup: PoDropdownAction | null;
12
+ private readonly navigationStack;
9
13
  private readonly renderer;
10
14
  private readonly router;
11
15
  private readonly changeDetector;
12
16
  listbox: ElementRef;
13
17
  listboxItemList: ElementRef;
18
+ listboxGroupHeader: ElementRef;
14
19
  searchElement: PoSearchListComponent;
15
20
  popupHeaderContainer: ElementRef;
21
+ listboxItems: QueryList<ElementRef>;
16
22
  private scrollEvent$;
17
23
  private subscriptionScrollEvent;
18
24
  constructor();
25
+ ngOnInit(): void;
19
26
  ngAfterViewInit(): void;
20
27
  ngOnChanges(changes?: SimpleChanges): void;
21
28
  ngOnDestroy(): void;
22
- onSelectItem(itemListAction: PoItemListOption | PoItemListOptionGroup | any): void | Promise<boolean>;
29
+ openGroup(group: PoDropdownAction, event?: MouseEvent | KeyboardEvent): void;
30
+ goBack(event: MouseEvent | KeyboardEvent): void;
31
+ onKeydownGoBack(event: KeyboardEvent): void;
32
+ onSelectItem(itemListAction: PoItemListOption | PoItemListOptionGroup | any, event?: MouseEvent | KeyboardEvent): void | Promise<boolean>;
23
33
  onSelectAllCheckboxKeyDown(event: KeyboardEvent): void;
24
34
  onKeyDown(itemListAction: PoItemListOption | PoItemListOptionGroup | any, event?: KeyboardEvent): void;
25
35
  checkboxClicked({ option, selected }: {
@@ -46,6 +56,7 @@ export declare class PoListBoxComponent extends PoListBoxBaseComponent implement
46
56
  private includeInfiniteScroll;
47
57
  protected returnBooleanValue(itemListAction: any, property: string): any;
48
58
  private setListBoxMaxHeight;
59
+ private setListBoxWidth;
49
60
  private openUrl;
50
61
  onClickTabs(tab: any): void;
51
62
  formatItemList(item: any): string;
@@ -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
  }