@po-ui/ng-components 19.23.0 → 19.24.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 (32) hide show
  1. package/fesm2022/po-ui-ng-components.mjs +685 -258
  2. package/fesm2022/po-ui-ng-components.mjs.map +1 -1
  3. package/lib/components/components.module.d.ts +14 -13
  4. package/lib/components/index.d.ts +1 -0
  5. package/lib/components/po-context-tabs/index.d.ts +3 -0
  6. package/lib/components/po-context-tabs/po-context-tab-button/po-context-tab-button.component.d.ts +26 -0
  7. package/lib/components/po-context-tabs/po-context-tabs.component.d.ts +81 -0
  8. package/lib/components/po-context-tabs/po-context-tabs.module.d.ts +16 -0
  9. package/lib/components/po-tabs/index.d.ts +2 -0
  10. package/lib/components/po-tabs/po-tab/po-tab-base.component.d.ts +28 -2
  11. package/lib/components/po-tabs/po-tab/po-tab.component.d.ts +3 -1
  12. package/lib/components/po-tabs/po-tab/po-tab.interface.d.ts +23 -0
  13. package/lib/components/po-tabs/po-tab-button/po-tab-button.component.d.ts +2 -2
  14. package/lib/components/po-tabs/po-tabs-base.component.d.ts +1 -16
  15. package/lib/components/po-tabs/po-tabs.component.d.ts +25 -4
  16. package/lib/components/po-tabs/po-tabs.module.d.ts +1 -1
  17. package/lib/components/po-tabs/po-tabs.service.d.ts +2 -2
  18. package/package.json +4 -4
  19. package/po-ui-ng-components-19.24.0.tgz +0 -0
  20. package/schematics/ng-add/index.js +1 -1
  21. package/schematics/ng-update/v14/index.js +1 -1
  22. package/schematics/ng-update/v15/index.js +1 -1
  23. package/schematics/ng-update/v16/index.js +1 -1
  24. package/schematics/ng-update/v17/index.js +1 -1
  25. package/schematics/ng-update/v18/index.js +2 -2
  26. package/schematics/ng-update/v19/index.js +2 -2
  27. package/schematics/ng-update/v2/index.js +1 -1
  28. package/schematics/ng-update/v3/index.js +1 -1
  29. package/schematics/ng-update/v4/index.js +1 -1
  30. package/schematics/ng-update/v5/index.js +1 -1
  31. package/schematics/ng-update/v6/index.js +1 -1
  32. package/po-ui-ng-components-19.23.0.tgz +0 -0
@@ -50130,109 +50130,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.7", ngImpor
50130
50130
  }]
50131
50131
  }] });
50132
50132
 
50133
- /**
50134
- * @docsPrivate
50135
- *
50136
- * @description
50137
- *
50138
- * Componente responsável por manipular os botões de aba.
50139
- */
50140
- class PoTabButtonComponent {
50141
- elementRef;
50142
- changeDetector;
50143
- tabButtom;
50144
- // Desabilita o botão
50145
- disabled;
50146
- // Identificador do componente
50147
- id;
50148
- // Rótulo do botão
50149
- label;
50150
- // Função sera emitida quando a tab ficar ativada
50151
- activated = new EventEmitter();
50152
- // Função sera emitida quando a tab ficar desabilitada ou escondida
50153
- changeState = new EventEmitter();
50154
- // Método recebido do usuário para ser disparado quando clicar na aba
50155
- click = new EventEmitter();
50156
- _active;
50157
- _hide;
50158
- widthButton;
50159
- // Ativa o botão
50160
- set active(value) {
50161
- this._active = value;
50162
- this.emitActivated();
50163
- }
50164
- get active() {
50165
- return this._active;
50166
- }
50167
- // Oculta o botão
50168
- set hide(value) {
50169
- this._hide = convertToBoolean(value);
50170
- this.setDisplayOnHide();
50171
- }
50172
- get hide() {
50173
- return this._hide;
50174
- }
50175
- constructor(elementRef, changeDetector) {
50176
- this.elementRef = elementRef;
50177
- this.changeDetector = changeDetector;
50178
- }
50179
- ngAfterViewInit() {
50180
- this.widthButton = this.tabButtom.nativeElement.offsetWidth;
50181
- this.changeDetector.detectChanges();
50182
- }
50183
- ngOnChanges(changes) {
50184
- if ((changes.hide && changes.hide.currentValue) || (changes.disabled && changes.disabled.currentValue)) {
50185
- this.changeState.emit(this);
50186
- }
50187
- }
50188
- onClick() {
50189
- if (!this.disabled) {
50190
- this.click.emit(this.id);
50191
- }
50192
- }
50193
- emitActivated() {
50194
- if (this.active) {
50195
- this.activated.emit(this);
50196
- }
50197
- }
50198
- setDisplayOnHide() {
50199
- this.elementRef.nativeElement.style.display = this.hide ? 'none' : '';
50200
- }
50201
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: PoTabButtonComponent, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
50202
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.7", type: PoTabButtonComponent, isStandalone: false, selector: "po-tab-button", inputs: { disabled: ["p-disabled", "disabled"], id: ["p-id", "id"], label: ["p-label", "label"], active: ["p-active", "active"], hide: ["p-hide", "hide"] }, outputs: { activated: "p-activated", changeState: "p-change-state", click: "p-click" }, viewQueries: [{ propertyName: "tabButtom", first: true, predicate: ["tabButtom"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0, template: "<div\n #tabButtom\n role=\"tab\"\n [p-tooltip]=\"widthButton > 239 ? label : ''\"\n p-tooltip-position=\"top\"\n class=\"po-tab-button-default\"\n [id]=\"id\"\n [ngClass]=\"{ 'po-tab-focusable': !disabled && !hide }\"\n [attr.tabindex]=\"disabled ? null : 0\"\n [attr.aria-selected]=\"active\"\n [class.po-tab-button-active]=\"active\"\n [class.po-tab-button-disabled]=\"disabled\"\n (click)=\"onClick()\"\n (keyup.enter)=\"onClick()\"\n>\n <span class=\"po-tab-button-label po-text-ellipsis\">\n {{ label }}\n </span>\n</div>\n<div [ngClass]=\"{ 'po-tab-border-active': active, 'po-tab-border-disabled': !active }\"></div>\n", dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: PoTooltipDirective, selector: "[p-tooltip]" }] });
50203
- }
50204
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: PoTabButtonComponent, decorators: [{
50205
- type: Component,
50206
- args: [{ selector: 'po-tab-button', standalone: false, template: "<div\n #tabButtom\n role=\"tab\"\n [p-tooltip]=\"widthButton > 239 ? label : ''\"\n p-tooltip-position=\"top\"\n class=\"po-tab-button-default\"\n [id]=\"id\"\n [ngClass]=\"{ 'po-tab-focusable': !disabled && !hide }\"\n [attr.tabindex]=\"disabled ? null : 0\"\n [attr.aria-selected]=\"active\"\n [class.po-tab-button-active]=\"active\"\n [class.po-tab-button-disabled]=\"disabled\"\n (click)=\"onClick()\"\n (keyup.enter)=\"onClick()\"\n>\n <span class=\"po-tab-button-label po-text-ellipsis\">\n {{ label }}\n </span>\n</div>\n<div [ngClass]=\"{ 'po-tab-border-active': active, 'po-tab-border-disabled': !active }\"></div>\n" }]
50207
- }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }], propDecorators: { tabButtom: [{
50208
- type: ViewChild,
50209
- args: ['tabButtom', { static: true }]
50210
- }], disabled: [{
50211
- type: Input,
50212
- args: ['p-disabled']
50213
- }], id: [{
50214
- type: Input,
50215
- args: ['p-id']
50216
- }], label: [{
50217
- type: Input,
50218
- args: ['p-label']
50219
- }], activated: [{
50220
- type: Output,
50221
- args: ['p-activated']
50222
- }], changeState: [{
50223
- type: Output,
50224
- args: ['p-change-state']
50225
- }], click: [{
50226
- type: Output,
50227
- args: ['p-click']
50228
- }], active: [{
50229
- type: Input,
50230
- args: ['p-active']
50231
- }], hide: [{
50232
- type: Input,
50233
- args: ['p-hide']
50234
- }] } });
50235
-
50236
50133
  /**
50237
50134
  * @description
50238
50135
  *
@@ -50241,13 +50138,36 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.7", ngImpor
50241
50138
  * Com este componente é possível atribuir um rótulo para auxiliar na identificação do conteúdo, ativar para que o mesmo seja exibido,
50242
50139
  * desabilitar para impossibilitar o acesso, bem como ocultar para indisponibilizar a aba.
50243
50140
  *
50244
- * > Para controlar a navegação entre diversas abas, utilizar o componente [`po-tabs`](/documentation/po-tabs).
50141
+ * > Para controlar a navegação entre diversas abas, utilizar o componente [`po-tabs`](/documentation/po-tabs) ou [`po-context-tabs`](/documentation/po-context-tabs).
50245
50142
  */
50246
50143
  class PoTabBaseComponent {
50247
50144
  /** Rótulo da aba. */
50248
50145
  label;
50146
+ /**
50147
+ * @optional
50148
+ *
50149
+ * @description
50150
+ *
50151
+ * Esconde o botão de fechar a aba.
50152
+ *
50153
+ * > Atenção: Propriedade disponível somente no `po-context-tabs`.
50154
+ *
50155
+ * @default `false`
50156
+ */
50157
+ hideClose = false;
50249
50158
  /** Método disparado ao clicar na aba. */
50250
50159
  click = new EventEmitter();
50160
+ /**
50161
+ * @optional
50162
+ *
50163
+ * @description
50164
+ *
50165
+ * Evento disparado ao clicar no botão de fechar a aba.
50166
+ *
50167
+ * > Atenção: Propriedade disponível somente no `po-context-tabs`.
50168
+ *
50169
+ */
50170
+ closeTab = new EventEmitter();
50251
50171
  // ID da aba
50252
50172
  id = uuid();
50253
50173
  _active = false;
@@ -50294,6 +50214,8 @@ class PoTabBaseComponent {
50294
50214
  *
50295
50215
  * Oculta a aba.
50296
50216
  *
50217
+ * > Atenção: Para correto funcionamento do componente, indicamos essa propriedade para esconder e exibir e não *ngIf.
50218
+ *
50297
50219
  * @default `false`
50298
50220
  */
50299
50221
  set hide(hide) {
@@ -50303,16 +50225,22 @@ class PoTabBaseComponent {
50303
50225
  return this._hide;
50304
50226
  }
50305
50227
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: PoTabBaseComponent, deps: [], target: i0.ɵɵFactoryTarget.Directive });
50306
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.7", type: PoTabBaseComponent, isStandalone: true, inputs: { label: ["p-label", "label"], active: ["p-active", "active"], disabled: ["p-disabled", "disabled"], hide: ["p-hide", "hide"] }, outputs: { click: "p-click" }, ngImport: i0 });
50228
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "19.0.7", type: PoTabBaseComponent, isStandalone: true, inputs: { label: ["p-label", "label"], hideClose: ["p-hide-close", "hideClose", convertToBoolean], active: ["p-active", "active"], disabled: ["p-disabled", "disabled"], hide: ["p-hide", "hide"] }, outputs: { click: "p-click", closeTab: "p-close-tab" }, ngImport: i0 });
50307
50229
  }
50308
50230
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: PoTabBaseComponent, decorators: [{
50309
50231
  type: Directive
50310
50232
  }], propDecorators: { label: [{
50311
50233
  type: Input,
50312
50234
  args: ['p-label']
50235
+ }], hideClose: [{
50236
+ type: Input,
50237
+ args: [{ alias: 'p-hide-close', transform: convertToBoolean }]
50313
50238
  }], click: [{
50314
50239
  type: Output,
50315
50240
  args: ['p-click']
50241
+ }], closeTab: [{
50242
+ type: Output,
50243
+ args: ['p-close-tab']
50316
50244
  }], active: [{
50317
50245
  type: Input,
50318
50246
  args: ['p-active']
@@ -50329,8 +50257,8 @@ class PoTabsService {
50329
50257
  onChangesTriggeredActiveSource = new Subject();
50330
50258
  onChangesTriggered$ = this.onChangesTriggeredSource.asObservable();
50331
50259
  triggerActiveOnChanges$ = this.onChangesTriggeredActiveSource.asObservable();
50332
- triggerOnChanges() {
50333
- this.onChangesTriggeredSource.next();
50260
+ triggerOnChanges(tab) {
50261
+ this.onChangesTriggeredSource.next(tab);
50334
50262
  }
50335
50263
  triggerActiveOnChanges(tab) {
50336
50264
  this.onChangesTriggeredActiveSource.next(tab);
@@ -50351,6 +50279,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.7", ngImpor
50351
50279
  class PoTabComponent extends PoTabBaseComponent {
50352
50280
  elementRef;
50353
50281
  tabsService;
50282
+ // Propriedade interna utilizada no po-context-tabs
50283
+ removed = false;
50284
+ // Propriedade interna utilizada no po-context-tabs
50285
+ showTooltip = false;
50354
50286
  constructor(elementRef, tabsService) {
50355
50287
  super();
50356
50288
  this.elementRef = elementRef;
@@ -50361,7 +50293,7 @@ class PoTabComponent extends PoTabBaseComponent {
50361
50293
  }
50362
50294
  ngOnChanges(changes) {
50363
50295
  setTimeout(() => {
50364
- this.tabsService.triggerOnChanges();
50296
+ this.tabsService.triggerOnChanges(this);
50365
50297
  if (changes?.active?.currentValue) {
50366
50298
  this.tabsService.triggerActiveOnChanges(this);
50367
50299
  }
@@ -50379,134 +50311,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.7", ngImpor
50379
50311
  }], ctorParameters: () => [{ type: i0.ElementRef }, { type: PoTabsService }] });
50380
50312
 
50381
50313
  /**
50382
- * @docsPrivate
50383
- *
50384
50314
  * @description
50385
50315
  *
50386
- * Componente para agrupamento de componentes `po-tab-button` que os rendereiza em uma um caixa de diálogo
50387
- * no formato de lista.
50388
- */
50389
- class PoTabDropdownComponent {
50390
- elementRef;
50391
- popover;
50392
- button;
50393
- // Rótulo do `po-tab-button`
50394
- label;
50395
- // Lista de abas
50396
- tabs = [];
50397
- size;
50398
- // Evento que será emitido ao ativar uma aba
50399
- activated = new EventEmitter();
50400
- // Evento que será emitido a aba for desabilitada ou ocultada
50401
- changeState = new EventEmitter();
50402
- // Evento de click
50403
- click = new EventEmitter();
50404
- isDropdownOpen = false;
50405
- dropdownStyles = {};
50406
- constructor(elementRef) {
50407
- this.elementRef = elementRef;
50408
- }
50409
- ngAfterViewInit() {
50410
- this.setDropdownPosition();
50411
- }
50412
- toggleDropdown() {
50413
- this.isDropdownOpen = !this.isDropdownOpen;
50414
- if (this.isDropdownOpen) {
50415
- this.setDropdownPosition();
50416
- }
50417
- }
50418
- closeAndReturnToButtom() {
50419
- this.closeDropdown();
50420
- this.button.focus();
50421
- }
50422
- closeDropdown() {
50423
- this.isDropdownOpen = false;
50424
- }
50425
- get buttonElement() {
50426
- return this.button.buttonElement;
50427
- }
50428
- setDropdownPosition() {
50429
- const buttonRect = this.buttonElement.nativeElement.getBoundingClientRect();
50430
- const tabsContainerRect = this.buttonElement.nativeElement.closest('.po-tabs-container').getBoundingClientRect();
50431
- const dropdownWidth = 300;
50432
- const isInsidePage = this.elementRef.nativeElement.closest('.po-page-content');
50433
- this.dropdownStyles = this.calculateDropdownStyles(buttonRect, tabsContainerRect, dropdownWidth, isInsidePage);
50434
- }
50435
- calculateDropdownStyles(buttonRect, tabsContainerRect, dropdownWidth, isInsidePage) {
50436
- if (isInsidePage) {
50437
- return {
50438
- top: `${tabsContainerRect.height + 4 + window.scrollY}px`,
50439
- maxWidth: `${dropdownWidth}px`,
50440
- right: `${tabsContainerRect.right - buttonRect.right}px`
50441
- };
50442
- }
50443
- let rightPosition = tabsContainerRect.width - buttonRect.right;
50444
- rightPosition = Math.max(0, rightPosition);
50445
- return {
50446
- top: `${tabsContainerRect.bottom + 4 + window.scrollY}px`,
50447
- maxWidth: `${dropdownWidth}px`,
50448
- right: `${rightPosition}px`
50449
- };
50450
- }
50451
- onClickOutside(event) {
50452
- if (this.isDropdownOpen && !this.elementRef.nativeElement.contains(event.target)) {
50453
- this.closeDropdown();
50454
- }
50455
- }
50456
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: PoTabDropdownComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
50457
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.7", type: PoTabDropdownComponent, isStandalone: false, selector: "po-tab-dropdown", inputs: { label: ["p-label", "label"], tabs: ["p-tabs", "tabs"], size: ["p-size", "size"] }, outputs: { activated: "p-activated", changeState: "p-change-state", click: "p-click" }, host: { listeners: { "document:click": "onClickOutside($event)" } }, viewQueries: [{ propertyName: "popover", first: true, predicate: ["popover"], descendants: true, static: true }, { propertyName: "button", first: true, predicate: PoButtonComponent, descendants: true, static: true }], ngImport: i0, template: "<div class=\"po-tab-dropdown-content po-tab-button-default\">\n <po-button\n #button\n p-kind=\"tertiary\"\n [p-aria-label]=\"label\"\n p-icon=\"ICON_ARROW_DOWN\"\n [p-size]=\"size\"\n (p-click)=\"toggleDropdown()\"\n >\n </po-button>\n</div>\n\n<div class=\"po-tab-dropdown-container\" *ngIf=\"isDropdownOpen\" [ngStyle]=\"dropdownStyles\">\n <po-listbox\n #listbox\n #poListBoxRef\n p-type=\"action\"\n [p-items]=\"tabs\"\n [p-is-tabs]=\"true\"\n [p-size]=\"size\"\n (p-activated-tabs)=\"activated.emit($event)\"\n (p-change-state-tabs)=\"changeState.emit($event)\"\n (p-click-tabs)=\"closeDropdown(); click.emit($event)\"\n (p-close)=\"closeAndReturnToButtom()\"\n >\n </po-listbox>\n</div>\n", dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: PoButtonComponent, selector: "po-button" }, { kind: "component", type: PoListBoxComponent, selector: "po-listbox" }] });
50458
- }
50459
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: PoTabDropdownComponent, decorators: [{
50460
- type: Component,
50461
- args: [{ selector: 'po-tab-dropdown', standalone: false, template: "<div class=\"po-tab-dropdown-content po-tab-button-default\">\n <po-button\n #button\n p-kind=\"tertiary\"\n [p-aria-label]=\"label\"\n p-icon=\"ICON_ARROW_DOWN\"\n [p-size]=\"size\"\n (p-click)=\"toggleDropdown()\"\n >\n </po-button>\n</div>\n\n<div class=\"po-tab-dropdown-container\" *ngIf=\"isDropdownOpen\" [ngStyle]=\"dropdownStyles\">\n <po-listbox\n #listbox\n #poListBoxRef\n p-type=\"action\"\n [p-items]=\"tabs\"\n [p-is-tabs]=\"true\"\n [p-size]=\"size\"\n (p-activated-tabs)=\"activated.emit($event)\"\n (p-change-state-tabs)=\"changeState.emit($event)\"\n (p-click-tabs)=\"closeDropdown(); click.emit($event)\"\n (p-close)=\"closeAndReturnToButtom()\"\n >\n </po-listbox>\n</div>\n" }]
50462
- }], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { popover: [{
50463
- type: ViewChild,
50464
- args: ['popover', { static: true }]
50465
- }], button: [{
50466
- type: ViewChild,
50467
- args: [PoButtonComponent, { static: true }]
50468
- }], label: [{
50469
- type: Input,
50470
- args: ['p-label']
50471
- }], tabs: [{
50472
- type: Input,
50473
- args: ['p-tabs']
50474
- }], size: [{
50475
- type: Input,
50476
- args: ['p-size']
50477
- }], activated: [{
50478
- type: Output,
50479
- args: ['p-activated']
50480
- }], changeState: [{
50481
- type: Output,
50482
- args: ['p-change-state']
50483
- }], click: [{
50484
- type: Output,
50485
- args: ['p-click']
50486
- }], onClickOutside: [{
50487
- type: HostListener,
50488
- args: ['document:click', ['$event']]
50489
- }] } });
50490
-
50491
- /**
50492
- * @description
50493
- *
50494
- * O componente `po-tabs` é responsável por agrupar [abas](/documentation/po-tab) dispostas numa linha horizontal,
50495
- * ideal para facilitar a organização de conteúdos.
50496
- *
50497
- * O componente exibirá as abas enquanto houver espaço na tela, caso a aba ultrapasse o limite da tela a mesma será agrupada em um dropdown.
50498
- *
50499
- * > As abas que estiverem agrupadas serão dispostas numa cascata suspensa que será exibida ao clicar no botão.
50500
- *
50501
- * É possível realizar a navegação entre as abas através da tecla SETAS(direita e esquerda) do teclado.
50502
- * Caso uma aba estiver desabilitada, não receberá foco de navegação.
50503
- *
50504
- * #### Boas práticas
50505
- *
50506
- * - Evite utilizar um `po-tabs` dentro de outro `po-tabs`;
50507
- * - Evite utilizar uma quantidade excessiva de abas, pois irá gerar um *scroll* muito longo no `dropdown`;
50508
- * - Evite `labels` extensos para as `tabs` pois podem quebrar seu *layout*, use `labels` diretas, curtas e intuitivas.
50509
- *
50510
50316
  * #### Tokens customizáveis
50511
50317
  *
50512
50318
  * É possível alterar o estilo do componente usando os seguintes tokens (CSS):
@@ -50540,6 +50346,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.7", ngImpor
50540
50346
  * | **Selected** | | |
50541
50347
  * | `--background-item-selected` | Cor de background do item selecionado | `var(--color-brand-01-lightest)` |
50542
50348
  *
50349
+ * <br>
50543
50350
  */
50544
50351
  class PoTabsBaseComponent {
50545
50352
  poThemeService;
@@ -50564,37 +50371,273 @@ class PoTabsBaseComponent {
50564
50371
  get size() {
50565
50372
  return this._size ?? getDefaultSize(this.poThemeService, PoFieldSize);
50566
50373
  }
50567
- constructor(poThemeService) {
50568
- this.poThemeService = poThemeService;
50374
+ constructor(poThemeService) {
50375
+ this.poThemeService = poThemeService;
50376
+ }
50377
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: PoTabsBaseComponent, deps: [{ token: PoThemeService }], target: i0.ɵɵFactoryTarget.Directive });
50378
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.7", type: PoTabsBaseComponent, isStandalone: true, inputs: { size: ["p-size", "size"] }, ngImport: i0 });
50379
+ }
50380
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: PoTabsBaseComponent, decorators: [{
50381
+ type: Directive
50382
+ }], ctorParameters: () => [{ type: PoThemeService }], propDecorators: { size: [{
50383
+ type: Input,
50384
+ args: ['p-size']
50385
+ }] } });
50386
+
50387
+ /**
50388
+ * @docsPrivate
50389
+ *
50390
+ * @description
50391
+ *
50392
+ * Componente responsável por manipular os botões de aba.
50393
+ */
50394
+ class PoTabButtonComponent {
50395
+ changeDetector;
50396
+ elementRef;
50397
+ tabButtom;
50398
+ // Desabilita o botão
50399
+ disabled;
50400
+ // Identificador do componente
50401
+ id;
50402
+ // Rótulo do botão
50403
+ label;
50404
+ // Função sera emitida quando a tab ficar ativada
50405
+ activated = new EventEmitter();
50406
+ // Função sera emitida quando a tab ficar desabilitada ou escondida
50407
+ changeState = new EventEmitter();
50408
+ // Método recebido do usuário para ser disparado quando clicar na aba
50409
+ click = new EventEmitter();
50410
+ _active;
50411
+ _hide;
50412
+ widthButton;
50413
+ // Ativa o botão
50414
+ set active(value) {
50415
+ this._active = value;
50416
+ this.emitActivated();
50417
+ }
50418
+ get active() {
50419
+ return this._active;
50420
+ }
50421
+ // Oculta o botão
50422
+ set hide(value) {
50423
+ this._hide = convertToBoolean(value);
50424
+ this.setDisplayOnHide();
50425
+ }
50426
+ get hide() {
50427
+ return this._hide;
50428
+ }
50429
+ constructor(changeDetector, elementRef) {
50430
+ this.changeDetector = changeDetector;
50431
+ this.elementRef = elementRef;
50432
+ }
50433
+ ngAfterViewInit() {
50434
+ this.widthButton = this.tabButtom.nativeElement.offsetWidth;
50435
+ this.changeDetector.detectChanges();
50436
+ }
50437
+ ngOnChanges(changes) {
50438
+ if ((changes.hide && changes.hide.currentValue) || (changes.disabled && changes.disabled.currentValue)) {
50439
+ this.changeState.emit(this);
50440
+ }
50441
+ }
50442
+ onClick() {
50443
+ if (!this.disabled) {
50444
+ this.click.emit(this.id);
50445
+ }
50446
+ }
50447
+ emitActivated() {
50448
+ if (this.active) {
50449
+ this.activated.emit(this);
50450
+ }
50451
+ }
50452
+ setDisplayOnHide() {
50453
+ this.elementRef.nativeElement.style.display = this.hide ? 'none' : '';
50454
+ }
50455
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: PoTabButtonComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
50456
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.7", type: PoTabButtonComponent, isStandalone: false, selector: "po-tab-button", inputs: { disabled: ["p-disabled", "disabled"], id: ["p-id", "id"], label: ["p-label", "label"], active: ["p-active", "active"], hide: ["p-hide", "hide"] }, outputs: { activated: "p-activated", changeState: "p-change-state", click: "p-click" }, viewQueries: [{ propertyName: "tabButtom", first: true, predicate: ["tabButtom"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0, template: "<div\n #tabButtom\n role=\"tab\"\n [p-tooltip]=\"widthButton > 239 ? label : ''\"\n p-tooltip-position=\"top\"\n class=\"po-tab-button-default\"\n [id]=\"id\"\n [ngClass]=\"{ 'po-tab-focusable': !disabled && !hide }\"\n [attr.tabindex]=\"disabled ? null : 0\"\n [attr.aria-selected]=\"active\"\n [class.po-tab-button-active]=\"active\"\n [class.po-tab-button-disabled]=\"disabled\"\n (click)=\"onClick()\"\n (keyup.enter)=\"onClick()\"\n>\n <span class=\"po-tab-button-label po-text-ellipsis\">\n {{ label }}\n </span>\n</div>\n<div [ngClass]=\"{ 'po-tab-border-active': active, 'po-tab-border-disabled': !active }\"></div>\n", dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: PoTooltipDirective, selector: "[p-tooltip]" }] });
50457
+ }
50458
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: PoTabButtonComponent, decorators: [{
50459
+ type: Component,
50460
+ args: [{ selector: 'po-tab-button', standalone: false, template: "<div\n #tabButtom\n role=\"tab\"\n [p-tooltip]=\"widthButton > 239 ? label : ''\"\n p-tooltip-position=\"top\"\n class=\"po-tab-button-default\"\n [id]=\"id\"\n [ngClass]=\"{ 'po-tab-focusable': !disabled && !hide }\"\n [attr.tabindex]=\"disabled ? null : 0\"\n [attr.aria-selected]=\"active\"\n [class.po-tab-button-active]=\"active\"\n [class.po-tab-button-disabled]=\"disabled\"\n (click)=\"onClick()\"\n (keyup.enter)=\"onClick()\"\n>\n <span class=\"po-tab-button-label po-text-ellipsis\">\n {{ label }}\n </span>\n</div>\n<div [ngClass]=\"{ 'po-tab-border-active': active, 'po-tab-border-disabled': !active }\"></div>\n" }]
50461
+ }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }], propDecorators: { tabButtom: [{
50462
+ type: ViewChild,
50463
+ args: ['tabButtom', { static: true }]
50464
+ }], disabled: [{
50465
+ type: Input,
50466
+ args: ['p-disabled']
50467
+ }], id: [{
50468
+ type: Input,
50469
+ args: ['p-id']
50470
+ }], label: [{
50471
+ type: Input,
50472
+ args: ['p-label']
50473
+ }], activated: [{
50474
+ type: Output,
50475
+ args: ['p-activated']
50476
+ }], changeState: [{
50477
+ type: Output,
50478
+ args: ['p-change-state']
50479
+ }], click: [{
50480
+ type: Output,
50481
+ args: ['p-click']
50482
+ }], active: [{
50483
+ type: Input,
50484
+ args: ['p-active']
50485
+ }], hide: [{
50486
+ type: Input,
50487
+ args: ['p-hide']
50488
+ }] } });
50489
+
50490
+ /**
50491
+ * @docsPrivate
50492
+ *
50493
+ * @description
50494
+ *
50495
+ * Componente para agrupamento de componentes `po-tab-button` que os rendereiza em uma um caixa de diálogo
50496
+ * no formato de lista.
50497
+ */
50498
+ class PoTabDropdownComponent {
50499
+ elementRef;
50500
+ popover;
50501
+ button;
50502
+ // Rótulo do `po-tab-button`
50503
+ label;
50504
+ // Lista de abas
50505
+ tabs = [];
50506
+ size;
50507
+ // Evento que será emitido ao ativar uma aba
50508
+ activated = new EventEmitter();
50509
+ // Evento que será emitido a aba for desabilitada ou ocultada
50510
+ changeState = new EventEmitter();
50511
+ // Evento de click
50512
+ click = new EventEmitter();
50513
+ isDropdownOpen = false;
50514
+ dropdownStyles = {};
50515
+ constructor(elementRef) {
50516
+ this.elementRef = elementRef;
50517
+ }
50518
+ ngAfterViewInit() {
50519
+ this.setDropdownPosition();
50520
+ }
50521
+ toggleDropdown() {
50522
+ this.isDropdownOpen = !this.isDropdownOpen;
50523
+ if (this.isDropdownOpen) {
50524
+ this.setDropdownPosition();
50525
+ }
50526
+ }
50527
+ closeAndReturnToButtom() {
50528
+ this.closeDropdown();
50529
+ this.button.focus();
50530
+ }
50531
+ closeDropdown() {
50532
+ this.isDropdownOpen = false;
50533
+ }
50534
+ get buttonElement() {
50535
+ return this.button.buttonElement;
50536
+ }
50537
+ setDropdownPosition() {
50538
+ const buttonRect = this.buttonElement.nativeElement.getBoundingClientRect();
50539
+ const tabsContainerRect = this.buttonElement.nativeElement.closest('.po-tabs-container').getBoundingClientRect();
50540
+ const dropdownWidth = 300;
50541
+ const isInsidePage = this.elementRef.nativeElement.closest('.po-page-content');
50542
+ this.dropdownStyles = this.calculateDropdownStyles(buttonRect, tabsContainerRect, dropdownWidth, isInsidePage);
50543
+ }
50544
+ calculateDropdownStyles(buttonRect, tabsContainerRect, dropdownWidth, isInsidePage) {
50545
+ if (isInsidePage) {
50546
+ return {
50547
+ top: `${tabsContainerRect.height + 4 + window.scrollY}px`,
50548
+ maxWidth: `${dropdownWidth}px`,
50549
+ right: `${tabsContainerRect.right - buttonRect.right}px`
50550
+ };
50551
+ }
50552
+ let rightPosition = tabsContainerRect.width - buttonRect.right;
50553
+ rightPosition = Math.max(0, rightPosition);
50554
+ return {
50555
+ top: `${tabsContainerRect.bottom + 4 + window.scrollY}px`,
50556
+ maxWidth: `${dropdownWidth}px`,
50557
+ right: `${rightPosition}px`
50558
+ };
50559
+ }
50560
+ onClickOutside(event) {
50561
+ if (this.isDropdownOpen && !this.elementRef.nativeElement.contains(event.target)) {
50562
+ this.closeDropdown();
50563
+ }
50569
50564
  }
50570
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: PoTabsBaseComponent, deps: [{ token: PoThemeService }], target: i0.ɵɵFactoryTarget.Directive });
50571
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.7", type: PoTabsBaseComponent, isStandalone: true, inputs: { size: ["p-size", "size"] }, ngImport: i0 });
50565
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: PoTabDropdownComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
50566
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.7", type: PoTabDropdownComponent, isStandalone: false, selector: "po-tab-dropdown", inputs: { label: ["p-label", "label"], tabs: ["p-tabs", "tabs"], size: ["p-size", "size"] }, outputs: { activated: "p-activated", changeState: "p-change-state", click: "p-click" }, host: { listeners: { "document:click": "onClickOutside($event)" } }, viewQueries: [{ propertyName: "popover", first: true, predicate: ["popover"], descendants: true, static: true }, { propertyName: "button", first: true, predicate: PoButtonComponent, descendants: true, static: true }], ngImport: i0, template: "<div class=\"po-tab-dropdown-content po-tab-button-default\">\n <po-button\n #button\n p-kind=\"tertiary\"\n [p-aria-label]=\"label\"\n p-icon=\"ICON_ARROW_DOWN\"\n [p-size]=\"size\"\n (p-click)=\"toggleDropdown()\"\n >\n </po-button>\n</div>\n\n<div class=\"po-tab-dropdown-container\" *ngIf=\"isDropdownOpen\" [ngStyle]=\"dropdownStyles\">\n <po-listbox\n #listbox\n #poListBoxRef\n p-type=\"action\"\n [p-items]=\"tabs\"\n [p-is-tabs]=\"true\"\n [p-size]=\"size\"\n (p-activated-tabs)=\"activated.emit($event)\"\n (p-change-state-tabs)=\"changeState.emit($event)\"\n (p-click-tabs)=\"closeDropdown(); click.emit($event)\"\n (p-close)=\"closeAndReturnToButtom()\"\n >\n </po-listbox>\n</div>\n", dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: PoButtonComponent, selector: "po-button" }, { kind: "component", type: PoListBoxComponent, selector: "po-listbox" }] });
50572
50567
  }
50573
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: PoTabsBaseComponent, decorators: [{
50574
- type: Directive
50575
- }], ctorParameters: () => [{ type: PoThemeService }], propDecorators: { size: [{
50568
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: PoTabDropdownComponent, decorators: [{
50569
+ type: Component,
50570
+ args: [{ selector: 'po-tab-dropdown', standalone: false, template: "<div class=\"po-tab-dropdown-content po-tab-button-default\">\n <po-button\n #button\n p-kind=\"tertiary\"\n [p-aria-label]=\"label\"\n p-icon=\"ICON_ARROW_DOWN\"\n [p-size]=\"size\"\n (p-click)=\"toggleDropdown()\"\n >\n </po-button>\n</div>\n\n<div class=\"po-tab-dropdown-container\" *ngIf=\"isDropdownOpen\" [ngStyle]=\"dropdownStyles\">\n <po-listbox\n #listbox\n #poListBoxRef\n p-type=\"action\"\n [p-items]=\"tabs\"\n [p-is-tabs]=\"true\"\n [p-size]=\"size\"\n (p-activated-tabs)=\"activated.emit($event)\"\n (p-change-state-tabs)=\"changeState.emit($event)\"\n (p-click-tabs)=\"closeDropdown(); click.emit($event)\"\n (p-close)=\"closeAndReturnToButtom()\"\n >\n </po-listbox>\n</div>\n" }]
50571
+ }], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { popover: [{
50572
+ type: ViewChild,
50573
+ args: ['popover', { static: true }]
50574
+ }], button: [{
50575
+ type: ViewChild,
50576
+ args: [PoButtonComponent, { static: true }]
50577
+ }], label: [{
50578
+ type: Input,
50579
+ args: ['p-label']
50580
+ }], tabs: [{
50581
+ type: Input,
50582
+ args: ['p-tabs']
50583
+ }], size: [{
50576
50584
  type: Input,
50577
50585
  args: ['p-size']
50586
+ }], activated: [{
50587
+ type: Output,
50588
+ args: ['p-activated']
50589
+ }], changeState: [{
50590
+ type: Output,
50591
+ args: ['p-change-state']
50592
+ }], click: [{
50593
+ type: Output,
50594
+ args: ['p-click']
50595
+ }], onClickOutside: [{
50596
+ type: HostListener,
50597
+ args: ['document:click', ['$event']]
50578
50598
  }] } });
50579
50599
 
50580
50600
  const poTabsLiterals = {
50581
50601
  en: {
50582
- moreTabs: 'More'
50602
+ moreTabs: 'More',
50603
+ close: 'Close Tab'
50583
50604
  },
50584
50605
  es: {
50585
- moreTabs: 'Más'
50606
+ moreTabs: 'Más',
50607
+ close: 'Cerrar pestaña'
50586
50608
  },
50587
50609
  pt: {
50588
- moreTabs: 'Mais'
50610
+ moreTabs: 'Mais',
50611
+ close: 'Fechar Aba'
50589
50612
  },
50590
50613
  ru: {
50591
- moreTabs: 'Ещё'
50614
+ moreTabs: 'Ещё',
50615
+ close: 'Закрыть вкладку'
50592
50616
  }
50593
50617
  };
50594
50618
  const poTabsMaxNumberOfTabs = 5;
50595
50619
  /**
50596
50620
  * @docsExtends PoTabsBaseComponent
50597
50621
  *
50622
+ * @description
50623
+ *
50624
+ * O componente `po-tabs` é responsável por agrupar [abas](/documentation/po-tab) dispostas numa linha horizontal,
50625
+ * ideal para facilitar a organização de conteúdos.
50626
+ *
50627
+ * O componente exibirá as abas enquanto houver espaço na tela, caso a aba ultrapasse o limite da tela a mesma será agrupada em um dropdown.
50628
+ *
50629
+ * > As abas que estiverem agrupadas serão dispostas numa cascata suspensa que será exibida ao clicar no botão.
50630
+ *
50631
+ * É possível realizar a navegação entre as abas através da tecla SETAS(direita e esquerda) do teclado.
50632
+ * Caso uma aba estiver desabilitada, não receberá foco de navegação.
50633
+ *
50634
+ * #### Boas práticas
50635
+ *
50636
+ * - Evite utilizar um `po-tabs` dentro de outro `po-tabs`;
50637
+ * - Evite utilizar uma quantidade excessiva de abas, pois irá gerar um *scroll* muito longo no `dropdown`;
50638
+ * - Evite `labels` extensos para as `tabs` pois podem quebrar seu *layout*, use `labels` diretas, curtas e intuitivas.
50639
+ *
50640
+ *
50598
50641
  * @example
50599
50642
  *
50600
50643
  * <example name="po-tabs-basic" title="PO Tabs Basic">
@@ -50633,6 +50676,7 @@ class PoTabsComponent extends PoTabsBaseComponent {
50633
50676
  tabsDropdown = [];
50634
50677
  initializeCalculation = true;
50635
50678
  initializeComponent = false;
50679
+ initCheckChangesTab = false;
50636
50680
  quantityTabsButton;
50637
50681
  defaultLastTabWidth;
50638
50682
  previousActiveTab;
@@ -50651,8 +50695,8 @@ class PoTabsComponent extends PoTabsBaseComponent {
50651
50695
  };
50652
50696
  }
50653
50697
  ngOnInit() {
50654
- this.subscriptionTabsService = this.tabsService.onChangesTriggered$.subscribe(() => {
50655
- this.updateTabsState();
50698
+ this.subscriptionTabsService = this.tabsService.onChangesTriggered$.subscribe((tab) => {
50699
+ this.updateTabsState(false, tab);
50656
50700
  if (this.initializeComponent) {
50657
50701
  this.handleKeyboardNavigationTab();
50658
50702
  }
@@ -50671,6 +50715,9 @@ class PoTabsComponent extends PoTabsBaseComponent {
50671
50715
  this.changeDetector.detectChanges();
50672
50716
  this.handleKeyboardNavigationTab();
50673
50717
  this.initializeComponent = true;
50718
+ setTimeout(() => {
50719
+ this.initCheckChangesTab = true;
50720
+ }, 500);
50674
50721
  }
50675
50722
  ngAfterContentInit() {
50676
50723
  this.updateTabsState(true);
@@ -50727,12 +50774,19 @@ class PoTabsComponent extends PoTabsBaseComponent {
50727
50774
  this.changeDetector.detectChanges();
50728
50775
  }
50729
50776
  }
50730
- reorderTabs(tabToReorder) {
50777
+ reorderTabs(tabToReorder, lastTab) {
50731
50778
  const tabsArray = this.tabsChildrenArray;
50732
50779
  const tabIndex = tabsArray.findIndex(item => item.id === tabToReorder.id);
50733
50780
  if (tabIndex !== -1) {
50734
- const [tab] = tabsArray.splice(tabIndex, 1);
50735
- tabsArray.splice(this.quantityTabsButton - 1, 0, tab);
50781
+ if (lastTab) {
50782
+ const lastTabShowed = tabsArray.findIndex(item => item.id === lastTab.id);
50783
+ const [tab] = tabsArray.splice(tabIndex, 1);
50784
+ tabsArray.splice(lastTabShowed, 0, tab);
50785
+ }
50786
+ else {
50787
+ const [tab] = tabsArray.splice(tabIndex, 1);
50788
+ tabsArray.splice(this.quantityTabsButton - 1, 0, tab);
50789
+ }
50736
50790
  }
50737
50791
  this.tabsChildren.reset(tabsArray);
50738
50792
  this.changeDetector.detectChanges();
@@ -50771,9 +50825,18 @@ class PoTabsComponent extends PoTabsBaseComponent {
50771
50825
  });
50772
50826
  }
50773
50827
  // Movimenta a tab da visão de tabs para o dropdown, e vice-versa.
50774
- changeTabPositionByDropdown(tabToActivate) {
50775
- const lastTab = this.tabsDefault[this.tabsDefault.length - 1];
50776
- this.tabsDefault = this.tabsDefault.filter(tab => tab.id !== lastTab.id);
50828
+ changeTabPositionByDropdown(tabToActivate, byContextsTabs = false) {
50829
+ let lastTab;
50830
+ if (byContextsTabs) {
50831
+ const tabsDefault = this.tabButton.filter(tab => !tab.nativeElement.hidden);
50832
+ lastTab = tabsDefault[tabsDefault.length - 1];
50833
+ this.tabsDefault = this.tabsDefault.filter(tab => tab.id !== lastTab.nativeElement.id);
50834
+ lastTab = { id: lastTab.nativeElement.id };
50835
+ }
50836
+ else {
50837
+ lastTab = this.tabsDefault[this.tabsDefault.length - 1];
50838
+ this.tabsDefault = this.tabsDefault.filter(tab => tab.id !== lastTab.id);
50839
+ }
50777
50840
  this.tabsDefault.push(tabToActivate);
50778
50841
  const _tabsDropdown = this.tabsDropdown.filter(tab => tab.id !== tabToActivate.id);
50779
50842
  _tabsDropdown.unshift(lastTab);
@@ -50788,12 +50851,21 @@ class PoTabsComponent extends PoTabsBaseComponent {
50788
50851
  this.changeDetector.detectChanges();
50789
50852
  }
50790
50853
  }
50791
- updateTabsState(initialState = false) {
50854
+ updateTabsState(initialState = false, tab) {
50792
50855
  this.defaultLastTabWidth = this.tabButton?.last?.nativeElement?.getBoundingClientRect().width;
50793
50856
  if (this.defaultLastTabWidth <= 0) {
50794
50857
  return;
50795
50858
  }
50796
- const lastTabChildren = this.tabsChildrenArray[this.quantityTabsButton - 1];
50859
+ this.executeTabsState(initialState);
50860
+ }
50861
+ executeTabsState(initialState, idByContextTabs) {
50862
+ let lastTabChildren;
50863
+ if (idByContextTabs) {
50864
+ lastTabChildren = this.tabsChildrenArray?.find(tab => tab.id === idByContextTabs);
50865
+ }
50866
+ else {
50867
+ lastTabChildren = this.tabsChildrenArray[this.quantityTabsButton - 1];
50868
+ }
50797
50869
  if (lastTabChildren) {
50798
50870
  lastTabChildren.widthButton = this.defaultLastTabWidth;
50799
50871
  }
@@ -50974,7 +51046,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.7", ngImpor
50974
51046
  */
50975
51047
  class PoTabsModule {
50976
51048
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: PoTabsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
50977
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.7", ngImport: i0, type: PoTabsModule, declarations: [PoTabButtonComponent, PoTabComponent, PoTabDropdownComponent, PoTabsComponent], imports: [CommonModule, PoPopoverModule, PoDropdownModule, PoTooltipModule, PoButtonModule, PoListBoxModule], exports: [PoTabComponent, PoTabsComponent] });
51049
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.7", ngImport: i0, type: PoTabsModule, declarations: [PoTabButtonComponent, PoTabComponent, PoTabDropdownComponent, PoTabsComponent], imports: [CommonModule, PoPopoverModule, PoDropdownModule, PoTooltipModule, PoButtonModule, PoListBoxModule], exports: [PoTabComponent, PoTabsComponent, PoTabButtonComponent, PoTabDropdownComponent] });
50978
51050
  static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: PoTabsModule, providers: [PoTabsService], imports: [CommonModule, PoPopoverModule, PoDropdownModule, PoTooltipModule, PoButtonModule, PoListBoxModule] });
50979
51051
  }
50980
51052
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: PoTabsModule, decorators: [{
@@ -50982,11 +51054,360 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.7", ngImpor
50982
51054
  args: [{
50983
51055
  imports: [CommonModule, PoPopoverModule, PoDropdownModule, PoTooltipModule, PoButtonModule, PoListBoxModule],
50984
51056
  declarations: [PoTabButtonComponent, PoTabComponent, PoTabDropdownComponent, PoTabsComponent],
50985
- exports: [PoTabComponent, PoTabsComponent],
51057
+ exports: [PoTabComponent, PoTabsComponent, PoTabButtonComponent, PoTabDropdownComponent],
50986
51058
  providers: [PoTabsService]
50987
51059
  }]
50988
51060
  }] });
50989
51061
 
51062
+ /**
51063
+ * @docsPrivate
51064
+ *
51065
+ * @description
51066
+ *
51067
+ * Componente responsável por manipular os botões de aba.
51068
+ */
51069
+ class PoContextTabButtonComponent extends PoTabButtonComponent {
51070
+ hideClose = false;
51071
+ showTooltip = false;
51072
+ literals;
51073
+ close = new EventEmitter();
51074
+ // Função sera emitida quando ocorre mudança da visibilidade da tab
51075
+ changeVisible = new EventEmitter();
51076
+ activeCloseIcon = false;
51077
+ afterViewChecked = false;
51078
+ ngAfterViewInit() {
51079
+ this.afterViewChecked = true;
51080
+ this.widthButton = this.tabButtom.nativeElement.offsetWidth;
51081
+ this.changeDetector.detectChanges();
51082
+ }
51083
+ ngOnChanges(changes) {
51084
+ if (changes.hide?.currentValue || changes.disabled?.currentValue) {
51085
+ this.changeState.emit(this);
51086
+ }
51087
+ if (!changes.hide?.firstChange && changes.hide && this.afterViewChecked) {
51088
+ this.changeVisible.emit(this);
51089
+ }
51090
+ }
51091
+ closeTab(event) {
51092
+ if (event.code === 'ArrowLeft' || event.code === 'ArrowRight') {
51093
+ event.preventDefault();
51094
+ event.stopPropagation();
51095
+ }
51096
+ if ((!event.key || event?.key === 'Enter') && !this.disabled) {
51097
+ event.preventDefault();
51098
+ event.stopPropagation();
51099
+ this.close.emit(this.tabButtom);
51100
+ }
51101
+ }
51102
+ onFocusIn() {
51103
+ if (!this.disabled) {
51104
+ this.activeCloseIcon = true;
51105
+ }
51106
+ }
51107
+ onFocusOut() {
51108
+ this.activeCloseIcon = false;
51109
+ }
51110
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: PoContextTabButtonComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
51111
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.7", type: PoContextTabButtonComponent, isStandalone: false, selector: "po-context-tab-button", inputs: { hideClose: ["p-hide-close", "hideClose"], showTooltip: ["p-show-tooltip", "showTooltip"], literals: ["p-literals", "literals"] }, outputs: { close: "p-close", changeVisible: "p-change-visible" }, usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<div\n #tabButtom\n role=\"tab\"\n [p-tooltip]=\"widthButton > 239 || showTooltip ? label : ''\"\n p-tooltip-position=\"top\"\n class=\"po-tab-button-default\"\n [id]=\"id\"\n [ngClass]=\"{ 'po-tab-focusable': !disabled && !hide }\"\n [attr.tabindex]=\"disabled ? null : 0\"\n [attr.aria-selected]=\"active\"\n [class.po-tab-button-active]=\"active\"\n [class.po-tab-button-disabled]=\"disabled\"\n (click)=\"onClick()\"\n (focusin)=\"onFocusIn()\"\n (focusout)=\"onFocusOut()\"\n (keyup.enter)=\"onClick()\"\n>\n <div class=\"po-tab-button-content\">\n <span [ngClass]=\"!hideClose ? 'po-context-tab-button-label' : 'po-tab-button-label'\" class=\"po-text-ellipsis\">\n {{ label }}\n </span>\n <div\n class=\"po-tab-button-content-close-icon\"\n *ngIf=\"!hideClose\"\n (click)=\"closeTab($event)\"\n (keydown)=\"closeTab($event)\"\n >\n <po-icon\n [tabIndex]=\"activeCloseIcon ? 0 : -1\"\n [attr.aria-label]=\"literals.close\"\n p-icon=\"ICON_CLOSE\"\n class=\"po-tab-button-icon-close\"\n ></po-icon>\n </div>\n </div>\n</div>\n<div [ngClass]=\"{ 'po-tab-border-active': active, 'po-tab-border-disabled': !active }\"></div>\n", dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: PoIconComponent, selector: "po-icon", inputs: ["p-icon"] }, { kind: "directive", type: PoTooltipDirective, selector: "[p-tooltip]" }] });
51112
+ }
51113
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: PoContextTabButtonComponent, decorators: [{
51114
+ type: Component,
51115
+ args: [{ selector: 'po-context-tab-button', standalone: false, template: "<div\n #tabButtom\n role=\"tab\"\n [p-tooltip]=\"widthButton > 239 || showTooltip ? label : ''\"\n p-tooltip-position=\"top\"\n class=\"po-tab-button-default\"\n [id]=\"id\"\n [ngClass]=\"{ 'po-tab-focusable': !disabled && !hide }\"\n [attr.tabindex]=\"disabled ? null : 0\"\n [attr.aria-selected]=\"active\"\n [class.po-tab-button-active]=\"active\"\n [class.po-tab-button-disabled]=\"disabled\"\n (click)=\"onClick()\"\n (focusin)=\"onFocusIn()\"\n (focusout)=\"onFocusOut()\"\n (keyup.enter)=\"onClick()\"\n>\n <div class=\"po-tab-button-content\">\n <span [ngClass]=\"!hideClose ? 'po-context-tab-button-label' : 'po-tab-button-label'\" class=\"po-text-ellipsis\">\n {{ label }}\n </span>\n <div\n class=\"po-tab-button-content-close-icon\"\n *ngIf=\"!hideClose\"\n (click)=\"closeTab($event)\"\n (keydown)=\"closeTab($event)\"\n >\n <po-icon\n [tabIndex]=\"activeCloseIcon ? 0 : -1\"\n [attr.aria-label]=\"literals.close\"\n p-icon=\"ICON_CLOSE\"\n class=\"po-tab-button-icon-close\"\n ></po-icon>\n </div>\n </div>\n</div>\n<div [ngClass]=\"{ 'po-tab-border-active': active, 'po-tab-border-disabled': !active }\"></div>\n" }]
51116
+ }], propDecorators: { hideClose: [{
51117
+ type: Input,
51118
+ args: ['p-hide-close']
51119
+ }], showTooltip: [{
51120
+ type: Input,
51121
+ args: ['p-show-tooltip']
51122
+ }], literals: [{
51123
+ type: Input,
51124
+ args: ['p-literals']
51125
+ }], close: [{
51126
+ type: Output,
51127
+ args: ['p-close']
51128
+ }], changeVisible: [{
51129
+ type: Output,
51130
+ args: ['p-change-visible']
51131
+ }] } });
51132
+
51133
+ /**
51134
+ * @docsExtends PoTabsBaseComponent
51135
+ *
51136
+ * @description
51137
+ *
51138
+ * O componente `po-context-tabs` é responsável por agrupar [abas](/documentation/po-tab) dispostas numa linha horizontal,
51139
+ * ideal para facilitar a organização de conteúdos.
51140
+ *
51141
+ * O componente exibirá as abas enquanto houver espaço na tela, caso a aba ultrapasse o limite da tela a mesma será agrupada em um dropdown.
51142
+ *
51143
+ * > As abas que estiverem agrupadas serão dispostas numa cascata suspensa que será exibida ao clicar no botão.
51144
+ *
51145
+ * É possível realizar a navegação entre as abas através da tecla SETAS(direita e esquerda) do teclado.
51146
+ * Caso uma aba estiver desabilitada, não receberá foco de navegação.
51147
+ *
51148
+ * #### Boas práticas
51149
+ *
51150
+ * - Evite utilizar um `po-context-tabs` dentro de outro `po-context-tabs`;
51151
+ * - Evite utilizar uma quantidade excessiva de abas, pois irá gerar um *scroll* muito longo no `dropdown`;
51152
+ * - Evite `labels` extensos para as `tabs` pois podem quebrar seu *layout*, use `labels` diretas, curtas e intuitivas.
51153
+ *
51154
+ *
51155
+ * @example
51156
+ *
51157
+ * <example name="po-context-tabs-basic" title="PO Context Tabs Basic">
51158
+ * <file name="sample-po-context-tabs-basic/sample-po-context-tabs-basic.component.html"> </file>
51159
+ * <file name="sample-po-context-tabs-basic/sample-po-context-tabs-basic.component.ts"> </file>
51160
+ * </example>
51161
+ *
51162
+ * <example name="po-context-tabs-labs" title="PO Context Tabs Labs">
51163
+ * <file name="sample-po-context-tabs-labs/sample-po-context-tabs-labs.component.html"> </file>
51164
+ * <file name="sample-po-context-tabs-labs/sample-po-context-tabs-labs.component.ts"> </file>
51165
+ * </example>
51166
+ *
51167
+ * <example name="po-context-tabs-travel" title="PO Context Tabs - Travel">
51168
+ * <file name="sample-po-context-tabs-travel/sample-po-context-tabs-travel.component.html"> </file>
51169
+ * <file name="sample-po-context-tabs-travel/sample-po-context-tabs-travel.component.ts"> </file>
51170
+ * </example>
51171
+ *
51172
+ * <example name="po-context-tabs-business-conf" title="PO Context Tabs - Business Conference">
51173
+ * <file name="sample-po-context-tabs-business-conf/sample-po-context-tabs-business-conf.component.html"> </file>
51174
+ * <file name="sample-po-context-tabs-business-conf/sample-po-context-tabs-business-conf.component.ts"> </file>
51175
+ * </example>
51176
+ */
51177
+ class PoContextTabsComponent extends PoTabsComponent {
51178
+ byQuantityFunction;
51179
+ initialTabsWidth = [];
51180
+ sumOfWidth = 0;
51181
+ get isShowTabDropdown() {
51182
+ const tabsShowed = this.tabsChildren['_results'].filter(item => !item.hide);
51183
+ if (tabsShowed.length > this.quantityTabsButton) {
51184
+ return true;
51185
+ }
51186
+ return false;
51187
+ }
51188
+ // tabs que serão apresentadas na aba "Mais"
51189
+ get overflowedTabs() {
51190
+ return this.tabsChildren['_results'].filter(item => !item.hide)?.slice(this.quantityTabsButton);
51191
+ }
51192
+ get tabs() {
51193
+ return this.tabsChildren['_results'];
51194
+ }
51195
+ closeTab(tab) {
51196
+ tab.closeTab.emit(tab);
51197
+ const tabWidth = tab.widthButton || this.initialTabsWidth.find(initialTab => initialTab.id === tab.id)?.width;
51198
+ this.tabsChildren['_results'] = this.tabsChildren['_results'].filter(item => item.id !== tab.id);
51199
+ tab.removed = true;
51200
+ tab.hide = true;
51201
+ this.onTabChangeState(tab);
51202
+ tab.elementRef.nativeElement.remove();
51203
+ this.afterRemoveTab(tabWidth);
51204
+ }
51205
+ onChangeVisibilityTab(tab) {
51206
+ if (this.initialTabsWidth?.length) {
51207
+ const currentInitialTab = this.initialTabsWidth.find(t => t.id === tab.id);
51208
+ let tabWidth = tab.widthButton || currentInitialTab.width;
51209
+ if (!tab.hide) {
51210
+ const currentTabElement = this.tabButton.find(t => t.nativeElement.id === tab.id);
51211
+ tabWidth = currentTabElement.nativeElement.offsetWidth;
51212
+ currentInitialTab.width = tabWidth;
51213
+ tab.widthButton = tabWidth;
51214
+ this.changeDetector.detectChanges();
51215
+ this.calculateTabs(true);
51216
+ this.changeDetector.detectChanges();
51217
+ }
51218
+ else {
51219
+ this.afterRemoveTab(tabWidth);
51220
+ }
51221
+ }
51222
+ }
51223
+ afterRemoveTab(widthTab) {
51224
+ this.quantityTabsButton = this.quantityTabsButton - 1;
51225
+ this.changeDetector.detectChanges();
51226
+ const screenSize = this.containerTabs.nativeElement.offsetWidth;
51227
+ this.sumOfWidth = this.sumOfWidth - widthTab;
51228
+ for (const t of this.overflowedTabs) {
51229
+ if (!t.hide) {
51230
+ const firstItemDropdown = this.tabButton.find(tb => tb.nativeElement.id === t.id);
51231
+ const width = this.initialTabsWidth.find(i => i.id === firstItemDropdown.nativeElement.id)?.width;
51232
+ if (this.sumOfWidth + width <= screenSize ||
51233
+ screenSize < 1 ||
51234
+ this.quantityTabsButton < this.byQuantityFunction) {
51235
+ t.showTooltip = false;
51236
+ t.widthButton = undefined;
51237
+ firstItemDropdown.nativeElement.hidden = false;
51238
+ this.sumOfWidth += width;
51239
+ firstItemDropdown.nativeElement.style.width = '';
51240
+ firstItemDropdown.nativeElement.style.display = 'inline-block';
51241
+ this.quantityTabsButton = this.quantityTabsButton + 1;
51242
+ if (this.byQuantityFunction > 0 && this.byQuantityFunction === this.quantityTabsButton) {
51243
+ break;
51244
+ }
51245
+ }
51246
+ else {
51247
+ break;
51248
+ }
51249
+ }
51250
+ }
51251
+ this.changeDetector.detectChanges();
51252
+ this.handleKeyboardNavigationTab();
51253
+ }
51254
+ calculateTabs(initializeCalculation) {
51255
+ if (initializeCalculation) {
51256
+ this.sumOfWidth = 150;
51257
+ const screenSize = this.containerTabs.nativeElement.offsetWidth;
51258
+ const listTabButton = [];
51259
+ const isFirstCalculation = this.initialTabsWidth.length === 0;
51260
+ if (this.tabButton?.length) {
51261
+ let initDropdown = false;
51262
+ let index = 0;
51263
+ this.tabButton.forEach(element => {
51264
+ const width = element.nativeElement.offsetWidth;
51265
+ if (isFirstCalculation) {
51266
+ this.initialTabsWidth.push({ id: element.nativeElement.id, width });
51267
+ }
51268
+ if (this.byQuantityFunction && index > this.byQuantityFunction - 1) {
51269
+ initDropdown = true;
51270
+ }
51271
+ if (!initDropdown &&
51272
+ (this.sumOfWidth + width <= screenSize || screenSize < 1 || index < this.byQuantityFunction)) {
51273
+ if (!element.nativeElement.hidden) {
51274
+ listTabButton.push(element);
51275
+ this.sumOfWidth += width;
51276
+ }
51277
+ }
51278
+ else {
51279
+ initDropdown = true;
51280
+ element.nativeElement.style.display = 'none';
51281
+ element.nativeElement.hidden = true;
51282
+ }
51283
+ if (element.nativeElement.hidden && index <= this.byQuantityFunction - 1)
51284
+ return;
51285
+ index++;
51286
+ });
51287
+ }
51288
+ this.quantityTabsButton = this.byQuantityFunction || listTabButton.length;
51289
+ }
51290
+ }
51291
+ updateTabsState(initialState = false, tabs) {
51292
+ if (tabs && this.initCheckChangesTab) {
51293
+ this.checkChangesTabs();
51294
+ }
51295
+ const allVisibleItems = this.tabButton?.filter(tab => !tab.nativeElement.hidden);
51296
+ this.defaultLastTabWidth = allVisibleItems?.[allVisibleItems.length - 1]?.nativeElement.offsetWidth;
51297
+ if (!this.defaultLastTabWidth) {
51298
+ return;
51299
+ }
51300
+ this.executeTabsState(initialState, allVisibleItems?.[allVisibleItems.length - 1]?.nativeElement.id);
51301
+ }
51302
+ checkChangesTabs() {
51303
+ let index = 0;
51304
+ this.tabButton.forEach((tab, indexTab) => {
51305
+ const currentTab = this.initialTabsWidth.find(t => t.id === tab.nativeElement.id);
51306
+ const quantityTabs = this.byQuantityFunction || this.quantityTabsButton;
51307
+ if (tab.nativeElement.hidden && !this.tabsChildren['_results'][indexTab]?.hide) {
51308
+ tab.nativeElement.style.display = 'inline-block';
51309
+ tab.nativeElement.hidden = false;
51310
+ }
51311
+ if (!currentTab) {
51312
+ this.initialTabsWidth.push({ id: tab.nativeElement.id, width: tab.nativeElement.offsetWidth });
51313
+ if (index > quantityTabs - 1) {
51314
+ tab.nativeElement.style.display = 'none';
51315
+ tab.nativeElement.hidden = true;
51316
+ }
51317
+ this.tabsChildren['_results'] = this.tabsChildren['_results'].filter(item => !item.removed);
51318
+ }
51319
+ if (tab.nativeElement.hidden && index <= quantityTabs - 1)
51320
+ return;
51321
+ index++;
51322
+ });
51323
+ this.calculateTabs(true);
51324
+ }
51325
+ onTabActiveByDropdown(tab, eventEmitter = true) {
51326
+ if (tab.disabled) {
51327
+ this.onTabChangeState(tab);
51328
+ return;
51329
+ }
51330
+ const initialWidth = this.initialTabsWidth.find(t => t.id === tab.id);
51331
+ this.changeTabPositionByDropdown(tab, true);
51332
+ const showedTabs = this.tabButton.toArray().filter(tab => !tab.nativeElement.hidden);
51333
+ const lastTab = showedTabs[showedTabs.length - 1];
51334
+ const lastTabWidth = lastTab.nativeElement.offsetWidth;
51335
+ lastTab.nativeElement.style.display = 'none';
51336
+ lastTab.nativeElement.hidden = true;
51337
+ const currentTabIndex = this.tabButton.toArray().findIndex(t => t.nativeElement.id === tab.id);
51338
+ const currentTab = this.tabButton.toArray()[currentTabIndex].nativeElement;
51339
+ currentTab.hidden = false;
51340
+ currentTab.style.display = 'inline-block';
51341
+ this.reorderTabs(tab, lastTab.nativeElement);
51342
+ tab.widthButton = lastTabWidth;
51343
+ if (initialWidth.width > lastTabWidth) {
51344
+ tab.showTooltip = true;
51345
+ }
51346
+ currentTab.style.width = `${lastTabWidth}px`;
51347
+ this.handleKeyboardNavigationTab();
51348
+ if (eventEmitter) {
51349
+ tab.click.emit(tab);
51350
+ }
51351
+ }
51352
+ /**
51353
+ * Função que atribui o número de tabs fora do dropdown.
51354
+ *
51355
+ * Para utilizá-la é necessário ter a instância do componente no DOM, podendo ser utilizado o ViewChild da seguinte forma:
51356
+ *
51357
+ * ```
51358
+ * import { PoContextTabsComponent } from '@po-ui/ng-components';
51359
+ *
51360
+ * ...
51361
+ *
51362
+ * @ViewChild('poContextTabs', { static: true }) poContextTabs: PoContextTabsComponent;
51363
+ *
51364
+ * changeQuantityTabs() {
51365
+ * this.poContextTabs.setQuantityTabsButton(1); //Número de context-tabs
51366
+ * }
51367
+ * ```
51368
+ */
51369
+ setQuantityTabsButton(number) {
51370
+ let callAfterFunction = false;
51371
+ const currentQuantity = this.byQuantityFunction || this.quantityTabsButton;
51372
+ if (number > currentQuantity) {
51373
+ callAfterFunction = true;
51374
+ }
51375
+ this.byQuantityFunction = number;
51376
+ if (!callAfterFunction) {
51377
+ this.quantityTabsButton = number;
51378
+ this.calculateTabs(true);
51379
+ }
51380
+ else {
51381
+ this.afterRemoveTab(0);
51382
+ this.quantityTabsButton = number;
51383
+ }
51384
+ }
51385
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: PoContextTabsComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
51386
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.7", type: PoContextTabsComponent, isStandalone: false, selector: "po-context-tabs", usesInheritance: true, ngImport: i0, template: "<div class=\"po-tabs-container\">\n <div #containerTabs class=\"po-tabs-header\">\n <div class=\"po-tabs-button-wrapper\" role=\"tablist\">\n <ng-container *ngFor=\"let tab of tabs; trackBy: trackByFn\">\n <po-context-tab-button\n *ngIf=\"!tab.removed\"\n #tabButton\n class=\"po-tab-button\"\n [class.po-tab-button-aa]=\"size === 'small'\"\n [p-active]=\"tab.active\"\n [p-disabled]=\"tab.disabled\"\n [p-show-tooltip]=\"tab.showTooltip\"\n [p-hide]=\"tab.hide\"\n [p-id]=\"tab.id\"\n [hidden]=\"tab.hide\"\n [p-hide-close]=\"tab.hideClose\"\n [attr.disabled]=\"tab.disabled\"\n [p-label]=\"tab.label\"\n [p-literals]=\"literals\"\n [id]=\"tab.id\"\n (keyup.enter)=\"closeListbox()\"\n (p-activated)=\"onTabActive(tab)\"\n (p-change-state)=\"onTabChangeState(tab)\"\n (p-change-visible)=\"onChangeVisibilityTab(tab)\"\n (p-click)=\"selectedTab(tab)\"\n (p-close)=\"closeTab(tab)\"\n >\n </po-context-tab-button>\n </ng-container>\n\n <po-tab-dropdown\n #tabDropdown\n *ngIf=\"isShowTabDropdown\"\n class=\"po-tab-dropdown\"\n [class.po-tab-dropdown-device]=\"!tabsDefault?.length\"\n [p-label]=\"literals.moreTabs\"\n [p-size]=\"size\"\n [p-tabs]=\"overflowedTabs\"\n (p-change-state)=\"onTabChangeState($event)\"\n (p-click)=\"onTabActiveByDropdown($event)\"\n >\n </po-tab-dropdown>\n </div>\n </div>\n</div>\n<div class=\"po-tabs-content\">\n <ng-content></ng-content>\n</div>\n", dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: PoTabDropdownComponent, selector: "po-tab-dropdown", inputs: ["p-label", "p-tabs", "p-size"], outputs: ["p-activated", "p-change-state", "p-click"] }, { kind: "component", type: PoContextTabButtonComponent, selector: "po-context-tab-button", inputs: ["p-hide-close", "p-show-tooltip", "p-literals"], outputs: ["p-close", "p-change-visible"] }] });
51387
+ }
51388
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: PoContextTabsComponent, decorators: [{
51389
+ type: Component,
51390
+ args: [{ selector: 'po-context-tabs', standalone: false, template: "<div class=\"po-tabs-container\">\n <div #containerTabs class=\"po-tabs-header\">\n <div class=\"po-tabs-button-wrapper\" role=\"tablist\">\n <ng-container *ngFor=\"let tab of tabs; trackBy: trackByFn\">\n <po-context-tab-button\n *ngIf=\"!tab.removed\"\n #tabButton\n class=\"po-tab-button\"\n [class.po-tab-button-aa]=\"size === 'small'\"\n [p-active]=\"tab.active\"\n [p-disabled]=\"tab.disabled\"\n [p-show-tooltip]=\"tab.showTooltip\"\n [p-hide]=\"tab.hide\"\n [p-id]=\"tab.id\"\n [hidden]=\"tab.hide\"\n [p-hide-close]=\"tab.hideClose\"\n [attr.disabled]=\"tab.disabled\"\n [p-label]=\"tab.label\"\n [p-literals]=\"literals\"\n [id]=\"tab.id\"\n (keyup.enter)=\"closeListbox()\"\n (p-activated)=\"onTabActive(tab)\"\n (p-change-state)=\"onTabChangeState(tab)\"\n (p-change-visible)=\"onChangeVisibilityTab(tab)\"\n (p-click)=\"selectedTab(tab)\"\n (p-close)=\"closeTab(tab)\"\n >\n </po-context-tab-button>\n </ng-container>\n\n <po-tab-dropdown\n #tabDropdown\n *ngIf=\"isShowTabDropdown\"\n class=\"po-tab-dropdown\"\n [class.po-tab-dropdown-device]=\"!tabsDefault?.length\"\n [p-label]=\"literals.moreTabs\"\n [p-size]=\"size\"\n [p-tabs]=\"overflowedTabs\"\n (p-change-state)=\"onTabChangeState($event)\"\n (p-click)=\"onTabActiveByDropdown($event)\"\n >\n </po-tab-dropdown>\n </div>\n </div>\n</div>\n<div class=\"po-tabs-content\">\n <ng-content></ng-content>\n</div>\n" }]
51391
+ }] });
51392
+
51393
+ /**
51394
+ * @description
51395
+ * Módulo do componente po-context-tabs
51396
+ */
51397
+ class PoContextTabsModule {
51398
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: PoContextTabsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
51399
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.7", ngImport: i0, type: PoContextTabsModule, declarations: [PoContextTabsComponent, PoContextTabButtonComponent], imports: [CommonModule, PoIconModule, PoTooltipModule, PoTabsModule], exports: [PoContextTabsComponent] });
51400
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: PoContextTabsModule, imports: [CommonModule, PoIconModule, PoTooltipModule, PoTabsModule] });
51401
+ }
51402
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: PoContextTabsModule, decorators: [{
51403
+ type: NgModule,
51404
+ args: [{
51405
+ imports: [CommonModule, PoIconModule, PoTooltipModule, PoTabsModule],
51406
+ declarations: [PoContextTabsComponent, PoContextTabButtonComponent],
51407
+ exports: [PoContextTabsComponent]
51408
+ }]
51409
+ }] });
51410
+
50990
51411
  const poToolbarActionsIconDefault = 'ICON_MORE';
50991
51412
  /**
50992
51413
  * @docsPrivate
@@ -52609,6 +53030,7 @@ class PoComponentsModule {
52609
53030
  PoStepperModule,
52610
53031
  PoTableModule,
52611
53032
  PoTabsModule,
53033
+ PoContextTabsModule,
52612
53034
  PoTagModule,
52613
53035
  PoToolbarModule,
52614
53036
  PoTreeViewModule,
@@ -52654,6 +53076,7 @@ class PoComponentsModule {
52654
53076
  PoSlideModule,
52655
53077
  PoStepperModule,
52656
53078
  PoTableModule,
53079
+ PoContextTabsModule,
52657
53080
  PoTabsModule,
52658
53081
  PoTagModule,
52659
53082
  PoToolbarModule,
@@ -52702,6 +53125,7 @@ class PoComponentsModule {
52702
53125
  PoStepperModule,
52703
53126
  PoTableModule,
52704
53127
  PoTabsModule,
53128
+ PoContextTabsModule,
52705
53129
  PoTagModule,
52706
53130
  PoToolbarModule,
52707
53131
  PoTreeViewModule,
@@ -52747,6 +53171,7 @@ class PoComponentsModule {
52747
53171
  PoSlideModule,
52748
53172
  PoStepperModule,
52749
53173
  PoTableModule,
53174
+ PoContextTabsModule,
52750
53175
  PoTabsModule,
52751
53176
  PoTagModule,
52752
53177
  PoToolbarModule,
@@ -52800,6 +53225,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.7", ngImpor
52800
53225
  PoStepperModule,
52801
53226
  PoTableModule,
52802
53227
  PoTabsModule,
53228
+ PoContextTabsModule,
52803
53229
  PoTagModule,
52804
53230
  PoToolbarModule,
52805
53231
  PoTreeViewModule,
@@ -52848,6 +53274,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.7", ngImpor
52848
53274
  PoSlideModule,
52849
53275
  PoStepperModule,
52850
53276
  PoTableModule,
53277
+ PoContextTabsModule,
52851
53278
  PoTabsModule,
52852
53279
  PoTagModule,
52853
53280
  PoToolbarModule,
@@ -53788,5 +54215,5 @@ function validateProperty(property, target) {
53788
54215
  * Generated bundle index. Do not edit.
53789
54216
  */
53790
54217
 
53791
- export { AnimaliaIconDictionary, ForceBooleanComponentEnum, ForceOptionComponentEnum, I18N_CONFIG, ICONS_DICTIONARY, InputBoolean, InputRequired, PO_CONTROL_POSITIONS, PoAccordionComponent, PoAccordionItemComponent, PoAccordionModule, PoActiveOverlayModule, PoActiveOverlayService, PoAvatarComponent, PoAvatarModule, PoBadgeComponent, PoBadgeModule, PoBreadcrumbComponent, PoBreadcrumbModule, PoButtonComponent, PoButtonGroupComponent, PoButtonGroupModule, PoButtonGroupToggle, PoButtonKind, PoButtonModule, PoButtonSize, PoButtonType, PoCalendarComponent, PoCalendarMode, PoCalendarModule, PoChartComponent, PoChartLabelFormat, PoChartModule, PoChartType, PoCheckboxComponent, PoCheckboxGroupComponent, PoCheckboxGroupModule, PoCheckboxModule, PoCheckboxSize, PoCleanComponent, PoCleanModule, PoColorPaletteModule, PoColorPaletteService, PoComboComponent, PoComboFilterMode, PoComboOptionTemplateDirective, PoComponentInjectorModule, PoComponentInjectorService, PoComponentsModule, PoContainerComponent, PoContainerModule, PoControlPositionModule, PoDateService, PoDateTimeModule, PoDatepickerComponent, PoDatepickerIsoFormat, PoDatepickerModule, PoDatepickerRangeComponent, PoDecimalComponent, PoDialogComponent, PoDialogModule, PoDialogService, PoDialogType, PoDirectivesModule, PoDisclaimerComponent, PoDisclaimerGroupComponent, PoDisclaimerGroupModule, PoDisclaimerModule, PoDividerComponent, PoDividerModule, PoDividerSize, PoDropdownComponent, PoDropdownModule, PoDynamicContainerComponent, PoDynamicFieldType, PoDynamicFormComponent, PoDynamicModule, PoDynamicSharedBase, PoDynamicViewComponent, PoEmailComponent, PoFieldContainerBottomComponent, PoFieldContainerComponent, PoFieldContainerModule, PoFieldModule, PoGaugeComponent, PoGaugeModule, PoGridComponent, PoGridModule, PoGuardsModule, PoHttpInterceptorModule, PoHttpInterceptorService, PoHttpRequestInterceptorService, PoHttpRequestModule, PoI18nModule, PoI18nPipe, PoI18nService, PoIconComponent, PoIconDictionary, PoIconModule, PoImageComponent, PoImageModule, PoInfoComponent, PoInfoModule, PoInfoOrientation, PoInputComponent, PoInterceptorsModule, PoItemListComponent, PoLabelComponent, PoLabelModule, PoLanguageModule, PoLanguageService, PoLinkComponent, PoLinkModule, PoListBoxComponent, PoListBoxModule, PoListViewComponent, PoListViewContentTemplateDirective, PoListViewDetailTemplateDirective, PoListViewModule, PoLoadingComponent, PoLoadingIconComponent, PoLoadingModule, PoLoadingOverlayComponent, PoLoginComponent, PoLogoComponent, PoLogoModule, PoLookupComponent, PoLookupModalComponent, PoMask, PoMediaQueryModule, PoMediaQueryService, PoMenuComponent, PoMenuGlobalService, PoMenuHeaderTemplateDirective, PoMenuModule, PoMenuPanelComponent, PoMenuPanelModule, PoModalComponent, PoModalFooterComponent, PoModalModule, PoModule, PoMultiselectComponent, PoMultiselectFilterMode, PoMultiselectOptionTemplateDirective, PoNavbarComponent, PoNavbarModule, PoNotificationModule, PoNotificationService, PoNumberComponent, PoOverlayComponent, PoOverlayModule, PoPageDefaultComponent, PoPageDetailComponent, PoPageEditComponent, PoPageListComponent, PoPageModule, PoPageSlideComponent, PoPageSlideFooterComponent, PoPageSlideModule, PoPasswordComponent, PoPipesModule, PoPopoverComponent, PoPopoverModule, PoPopupComponent, PoPopupModule, PoProgressComponent, PoProgressModule, PoProgressSize, PoProgressStatus, PoRadioComponent, PoRadioGroupComponent, PoRadioGroupModule, PoRadioModule, PoRichTextComponent, PoRichTextToolbarActions, PoSearchComponent, PoSearchFilterMode, PoSearchListComponent, PoSearchModule, PoSelectComponent, PoServicesModule, PoSlideComponent, PoSlideContentTemplateDirective, PoSlideModule, PoStepComponent, PoStepperComponent, PoStepperModule, PoStepperOrientation, PoStepperStatus, PoSwitchComponent, PoSwitchLabelPosition, PoSwitchModule, PoTabComponent, PoTableCellTemplateDirective, PoTableColumnFrozenDirective, PoTableColumnSortType, PoTableColumnSpacing, PoTableColumnTemplateDirective, PoTableComponent, PoTableModule, PoTableRowTemplateArrowDirection, PoTableRowTemplateDirective, PoTabsComponent, PoTabsModule, PoTabsService, PoTagComponent, PoTagModule, PoTagOrientation, PoTagType, PoTextareaComponent, PoThemeA11yEnum, PoThemeModule, PoThemeService, PoThemeTypeEnum, PoTimeModule, PoTimePipe, PoToasterComponent, PoToasterMode, PoToasterModule, PoToasterOrientation, PoToasterType, PoToolbarComponent, PoToolbarModule, PoTooltipDirective, PoTooltipModule, PoTreeViewComponent, PoTreeViewModule, PoUploadComponent, PoUploadFile, PoUploadStatus, PoUrlComponent, PoWidgetComponent, PoWidgetModule, initializeLanguageDefault, mergePoI18nConfigs, poBreadcrumbLiterals, poChartLiteralsDefault, poDialogAlertLiteralsDefault, poDialogConfirmLiteralsDefault, poLanguageDefault, poLocaleDateSeparatorList, poLocaleDecimalSeparatorList, poLocaleDefault, poLocaleThousandSeparatorList, poLocales, poPageSlideLiteralsDefault, poTabsLiterals, poThemeDefault, poThemeDefaultAA, poThemeDefaultAAA, poThemeDefaultActions, poThemeDefaultActionsDark, poThemeDefaultBrands, poThemeDefaultBrandsDark, poThemeDefaultCategoricals, poThemeDefaultCategoricalsAA, poThemeDefaultCategoricalsDark, poThemeDefaultCategoricalsDarkAA, poThemeDefaultCategoricalsOverlayDark, poThemeDefaultCategoricalsOverlayDarkAA, poThemeDefaultDark, poThemeDefaultDarkValues, poThemeDefaultDarkValuesAA, poThemeDefaultFeedback, poThemeDefaultFeedbackDark, poThemeDefaultLight, poThemeDefaultLightValues, poThemeDefaultLightValuesAA, poThemeDefaultNeutrals, poThemeDefaultNeutralsDark, poThemeDefaultOverlayCategoricals, poThemeDefaultOverlayCategoricalsAA, poToasterLiterals, returnPoI18nService };
54218
+ export { AnimaliaIconDictionary, ForceBooleanComponentEnum, ForceOptionComponentEnum, I18N_CONFIG, ICONS_DICTIONARY, InputBoolean, InputRequired, PO_CONTROL_POSITIONS, PoAccordionComponent, PoAccordionItemComponent, PoAccordionModule, PoActiveOverlayModule, PoActiveOverlayService, PoAvatarComponent, PoAvatarModule, PoBadgeComponent, PoBadgeModule, PoBreadcrumbComponent, PoBreadcrumbModule, PoButtonComponent, PoButtonGroupComponent, PoButtonGroupModule, PoButtonGroupToggle, PoButtonKind, PoButtonModule, PoButtonSize, PoButtonType, PoCalendarComponent, PoCalendarMode, PoCalendarModule, PoChartComponent, PoChartLabelFormat, PoChartModule, PoChartType, PoCheckboxComponent, PoCheckboxGroupComponent, PoCheckboxGroupModule, PoCheckboxModule, PoCheckboxSize, PoCleanComponent, PoCleanModule, PoColorPaletteModule, PoColorPaletteService, PoComboComponent, PoComboFilterMode, PoComboOptionTemplateDirective, PoComponentInjectorModule, PoComponentInjectorService, PoComponentsModule, PoContainerComponent, PoContainerModule, PoContextTabButtonComponent, PoContextTabsComponent, PoContextTabsModule, PoControlPositionModule, PoDateService, PoDateTimeModule, PoDatepickerComponent, PoDatepickerIsoFormat, PoDatepickerModule, PoDatepickerRangeComponent, PoDecimalComponent, PoDialogComponent, PoDialogModule, PoDialogService, PoDialogType, PoDirectivesModule, PoDisclaimerComponent, PoDisclaimerGroupComponent, PoDisclaimerGroupModule, PoDisclaimerModule, PoDividerComponent, PoDividerModule, PoDividerSize, PoDropdownComponent, PoDropdownModule, PoDynamicContainerComponent, PoDynamicFieldType, PoDynamicFormComponent, PoDynamicModule, PoDynamicSharedBase, PoDynamicViewComponent, PoEmailComponent, PoFieldContainerBottomComponent, PoFieldContainerComponent, PoFieldContainerModule, PoFieldModule, PoGaugeComponent, PoGaugeModule, PoGridComponent, PoGridModule, PoGuardsModule, PoHttpInterceptorModule, PoHttpInterceptorService, PoHttpRequestInterceptorService, PoHttpRequestModule, PoI18nModule, PoI18nPipe, PoI18nService, PoIconComponent, PoIconDictionary, PoIconModule, PoImageComponent, PoImageModule, PoInfoComponent, PoInfoModule, PoInfoOrientation, PoInputComponent, PoInterceptorsModule, PoItemListComponent, PoLabelComponent, PoLabelModule, PoLanguageModule, PoLanguageService, PoLinkComponent, PoLinkModule, PoListBoxComponent, PoListBoxModule, PoListViewComponent, PoListViewContentTemplateDirective, PoListViewDetailTemplateDirective, PoListViewModule, PoLoadingComponent, PoLoadingIconComponent, PoLoadingModule, PoLoadingOverlayComponent, PoLoginComponent, PoLogoComponent, PoLogoModule, PoLookupComponent, PoLookupModalComponent, PoMask, PoMediaQueryModule, PoMediaQueryService, PoMenuComponent, PoMenuGlobalService, PoMenuHeaderTemplateDirective, PoMenuModule, PoMenuPanelComponent, PoMenuPanelModule, PoModalComponent, PoModalFooterComponent, PoModalModule, PoModule, PoMultiselectComponent, PoMultiselectFilterMode, PoMultiselectOptionTemplateDirective, PoNavbarComponent, PoNavbarModule, PoNotificationModule, PoNotificationService, PoNumberComponent, PoOverlayComponent, PoOverlayModule, PoPageDefaultComponent, PoPageDetailComponent, PoPageEditComponent, PoPageListComponent, PoPageModule, PoPageSlideComponent, PoPageSlideFooterComponent, PoPageSlideModule, PoPasswordComponent, PoPipesModule, PoPopoverComponent, PoPopoverModule, PoPopupComponent, PoPopupModule, PoProgressComponent, PoProgressModule, PoProgressSize, PoProgressStatus, PoRadioComponent, PoRadioGroupComponent, PoRadioGroupModule, PoRadioModule, PoRichTextComponent, PoRichTextToolbarActions, PoSearchComponent, PoSearchFilterMode, PoSearchListComponent, PoSearchModule, PoSelectComponent, PoServicesModule, PoSlideComponent, PoSlideContentTemplateDirective, PoSlideModule, PoStepComponent, PoStepperComponent, PoStepperModule, PoStepperOrientation, PoStepperStatus, PoSwitchComponent, PoSwitchLabelPosition, PoSwitchModule, PoTabButtonComponent, PoTabComponent, PoTabDropdownComponent, PoTableCellTemplateDirective, PoTableColumnFrozenDirective, PoTableColumnSortType, PoTableColumnSpacing, PoTableColumnTemplateDirective, PoTableComponent, PoTableModule, PoTableRowTemplateArrowDirection, PoTableRowTemplateDirective, PoTabsComponent, PoTabsModule, PoTabsService, PoTagComponent, PoTagModule, PoTagOrientation, PoTagType, PoTextareaComponent, PoThemeA11yEnum, PoThemeModule, PoThemeService, PoThemeTypeEnum, PoTimeModule, PoTimePipe, PoToasterComponent, PoToasterMode, PoToasterModule, PoToasterOrientation, PoToasterType, PoToolbarComponent, PoToolbarModule, PoTooltipDirective, PoTooltipModule, PoTreeViewComponent, PoTreeViewModule, PoUploadComponent, PoUploadFile, PoUploadStatus, PoUrlComponent, PoWidgetComponent, PoWidgetModule, initializeLanguageDefault, mergePoI18nConfigs, poBreadcrumbLiterals, poChartLiteralsDefault, poDialogAlertLiteralsDefault, poDialogConfirmLiteralsDefault, poLanguageDefault, poLocaleDateSeparatorList, poLocaleDecimalSeparatorList, poLocaleDefault, poLocaleThousandSeparatorList, poLocales, poPageSlideLiteralsDefault, poTabsLiterals, poThemeDefault, poThemeDefaultAA, poThemeDefaultAAA, poThemeDefaultActions, poThemeDefaultActionsDark, poThemeDefaultBrands, poThemeDefaultBrandsDark, poThemeDefaultCategoricals, poThemeDefaultCategoricalsAA, poThemeDefaultCategoricalsDark, poThemeDefaultCategoricalsDarkAA, poThemeDefaultCategoricalsOverlayDark, poThemeDefaultCategoricalsOverlayDarkAA, poThemeDefaultDark, poThemeDefaultDarkValues, poThemeDefaultDarkValuesAA, poThemeDefaultFeedback, poThemeDefaultFeedbackDark, poThemeDefaultLight, poThemeDefaultLightValues, poThemeDefaultLightValuesAA, poThemeDefaultNeutrals, poThemeDefaultNeutralsDark, poThemeDefaultOverlayCategoricals, poThemeDefaultOverlayCategoricalsAA, poToasterLiterals, returnPoI18nService };
53792
54219
  //# sourceMappingURL=po-ui-ng-components.mjs.map