@po-ui/ng-components 19.21.0 → 19.23.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.
@@ -1734,7 +1734,7 @@ class PoTagBaseComponent {
1734
1734
  * @default `false`
1735
1735
  */
1736
1736
  set icon(value) {
1737
- if (this.type) {
1737
+ if (this.type && !this.forceIcon) {
1738
1738
  this._icon = convertToBoolean(value);
1739
1739
  }
1740
1740
  else {
@@ -1785,6 +1785,8 @@ class PoTagBaseComponent {
1785
1785
  get type() {
1786
1786
  return this._type;
1787
1787
  }
1788
+ //propriedade interna para forçar icone mesmo com tipo definido
1789
+ forceIcon = false;
1788
1790
  /**
1789
1791
  * @optional
1790
1792
  *
@@ -1831,7 +1833,7 @@ class PoTagBaseComponent {
1831
1833
  this.language = languageService.getShortLanguage();
1832
1834
  }
1833
1835
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: PoTagBaseComponent, deps: [{ token: PoLanguageService }], target: i0.ɵɵFactoryTarget.Directive });
1834
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "19.0.7", type: PoTagBaseComponent, isStandalone: true, inputs: { label: ["p-label", "label"], removable: ["p-removable", "removable", convertToBoolean], disabled: ["p-disabled", "disabled", convertToBoolean], value: ["p-value", "value"], appendInBody: ["p-append-in-body", "appendInBody"], color: ["p-color", "color"], textColor: ["p-text-color", "textColor"], icon: ["p-icon", "icon"], orientation: ["p-orientation", "orientation"], type: ["p-type", "type"], literals: ["p-literals", "literals"] }, outputs: { click: "p-click", remove: "p-close" }, ngImport: i0 });
1836
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "19.0.7", type: PoTagBaseComponent, isStandalone: true, inputs: { label: ["p-label", "label"], removable: ["p-removable", "removable", convertToBoolean], disabled: ["p-disabled", "disabled", convertToBoolean], value: ["p-value", "value"], appendInBody: ["p-append-in-body", "appendInBody"], color: ["p-color", "color"], textColor: ["p-text-color", "textColor"], icon: ["p-icon", "icon"], orientation: ["p-orientation", "orientation"], type: ["p-type", "type"], forceIcon: ["p-force-icon", "forceIcon", convertToBoolean], literals: ["p-literals", "literals"] }, outputs: { click: "p-click", remove: "p-close" }, ngImport: i0 });
1835
1837
  }
1836
1838
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: PoTagBaseComponent, decorators: [{
1837
1839
  type: Directive
@@ -1871,6 +1873,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.7", ngImpor
1871
1873
  }], type: [{
1872
1874
  type: Input,
1873
1875
  args: ['p-type']
1876
+ }], forceIcon: [{
1877
+ type: Input,
1878
+ args: [{ alias: 'p-force-icon', transform: convertToBoolean }]
1874
1879
  }], literals: [{
1875
1880
  type: Input,
1876
1881
  args: ['p-literals']
@@ -2746,11 +2751,11 @@ class PoTagComponent extends PoTagBaseComponent {
2746
2751
  }
2747
2752
  }
2748
2753
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: PoTagComponent, deps: [{ token: i0.ElementRef }, { token: PoLanguageService }], target: i0.ɵɵFactoryTarget.Component });
2749
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.7", type: PoTagComponent, isStandalone: false, selector: "po-tag", viewQueries: [{ propertyName: "tagContainer", first: true, predicate: ["tagContainer"], descendants: true, static: true }, { propertyName: "tagClose", first: true, predicate: ["tagClose"], descendants: true, static: true }, { propertyName: "poTag", first: true, predicate: ["poTag"], descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"po-tag-container\" [class.po-tag-container-horizontal]=\"tagOrientation\">\n <div *ngIf=\"label\" class=\"po-tag-title po-text-nowrap\">\n <span class=\"po-tag-label\">{{ tagOrientation ? label + ':' : label }}</span>\n </div>\n\n <div class=\"po-tag-sub-container\">\n <div\n #poTagWrapper\n class=\"po-tag-wrapper\"\n [class.po-clickable]=\"isClickable && !disabled && !removable\"\n [attr.role]=\"isClickable && !disabled && !removable ? 'button' : ''\"\n (keydown.enter)=\"onKeyPressed($event)\"\n (keydown.space)=\"$event.preventDefault()\"\n (keyup.space)=\"onKeyPressed($event)\"\n (click)=\"onClick()\"\n [tabindex]=\"isClickable && !removable ? 0 : -1\"\n >\n <div\n #poTag\n class=\"po-tag\"\n [class.po-clickable]=\"isClickable && !disabled && !removable\"\n [class.po-tag-removable]=\"removable\"\n [class.po-tag-disabled]=\"disabled && removable\"\n [ngClass]=\"tagColor\"\n [ngStyle]=\"styleTag()\"\n >\n <po-icon\n *ngIf=\"icon && !removable\"\n class=\"po-tag-icon\"\n [p-icon]=\"!type ? icon : iconFromType\"\n [ngStyle]=\"!type && customTextColor ? { 'color': customTextColor } : ''\"\n >\n </po-icon>\n\n <div\n #tagContainer\n class=\"po-tag-value\"\n [p-append-in-body]=\"appendInBody\"\n [p-tooltip]=\"getWidthTag() ? value : ''\"\n p-tooltip-position=\"top\"\n >\n <span [ngStyle]=\"!type && customTextColor && !removable ? { 'color': customTextColor } : ''\">{{\n value\n }}</span>\n </div>\n\n <po-icon\n #tagClose\n *ngIf=\"removable\"\n p-icon=\"ICON_CLOSE\"\n p-tooltip-position=\"top\"\n [p-tooltip]=\"literals.remove\"\n [p-append-in-body]=\"appendInBody\"\n [attr.aria-label]=\"setAriaLabel()\"\n class=\"po-tag-remove\"\n [class.po-clickable]=\"!disabled\"\n [tabindex]=\"!disabled ? 0 : -1\"\n [attr.role]=\"!disabled ? 'button' : ''\"\n (click)=\"onClose()\"\n (keydown.enter)=\"onClose('enter')\"\n >\n </po-icon>\n </div>\n </div>\n </div>\n</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: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: PoIconComponent, selector: "po-icon", inputs: ["p-icon"] }, { kind: "directive", type: PoTooltipDirective, selector: "[p-tooltip]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2754
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.7", type: PoTagComponent, isStandalone: false, selector: "po-tag", viewQueries: [{ propertyName: "tagContainer", first: true, predicate: ["tagContainer"], descendants: true, static: true }, { propertyName: "tagClose", first: true, predicate: ["tagClose"], descendants: true, static: true }, { propertyName: "poTag", first: true, predicate: ["poTag"], descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"po-tag-container\" [class.po-tag-container-horizontal]=\"tagOrientation\">\n <div *ngIf=\"label\" class=\"po-tag-title po-text-nowrap\">\n <span class=\"po-tag-label\">{{ tagOrientation ? label + ':' : label }}</span>\n </div>\n\n <div class=\"po-tag-sub-container\">\n <div\n #poTagWrapper\n class=\"po-tag-wrapper\"\n [class.po-clickable]=\"isClickable && !disabled && !removable\"\n [attr.role]=\"isClickable && !disabled && !removable ? 'button' : ''\"\n (keydown.enter)=\"onKeyPressed($event)\"\n (keydown.space)=\"$event.preventDefault()\"\n (keyup.space)=\"onKeyPressed($event)\"\n (click)=\"onClick()\"\n [tabindex]=\"isClickable && !removable ? 0 : -1\"\n >\n <div\n #poTag\n class=\"po-tag\"\n [class.po-clickable]=\"isClickable && !disabled && !removable\"\n [class.po-tag-removable]=\"removable\"\n [class.po-tag-disabled]=\"disabled && removable\"\n [ngClass]=\"tagColor\"\n [ngStyle]=\"styleTag()\"\n >\n <po-icon\n *ngIf=\"icon && !removable\"\n class=\"po-tag-icon\"\n [p-icon]=\"!type || forceIcon ? icon : iconFromType\"\n [ngStyle]=\"!type && customTextColor ? { 'color': customTextColor } : ''\"\n >\n </po-icon>\n\n <div\n #tagContainer\n class=\"po-tag-value\"\n [p-append-in-body]=\"appendInBody\"\n [p-tooltip]=\"getWidthTag() ? value : ''\"\n p-tooltip-position=\"top\"\n >\n <span [ngStyle]=\"!type && customTextColor && !removable ? { 'color': customTextColor } : ''\">{{\n value\n }}</span>\n </div>\n\n <po-icon\n #tagClose\n *ngIf=\"removable\"\n p-icon=\"ICON_CLOSE\"\n p-tooltip-position=\"top\"\n [p-tooltip]=\"literals.remove\"\n [p-append-in-body]=\"appendInBody\"\n [attr.aria-label]=\"setAriaLabel()\"\n class=\"po-tag-remove\"\n [class.po-clickable]=\"!disabled\"\n [tabindex]=\"!disabled ? 0 : -1\"\n [attr.role]=\"!disabled ? 'button' : ''\"\n (click)=\"onClose()\"\n (keydown.enter)=\"onClose('enter')\"\n >\n </po-icon>\n </div>\n </div>\n </div>\n</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: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: PoIconComponent, selector: "po-icon", inputs: ["p-icon"] }, { kind: "directive", type: PoTooltipDirective, selector: "[p-tooltip]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2750
2755
  }
2751
2756
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: PoTagComponent, decorators: [{
2752
2757
  type: Component,
2753
- args: [{ selector: 'po-tag', changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, template: "<div class=\"po-tag-container\" [class.po-tag-container-horizontal]=\"tagOrientation\">\n <div *ngIf=\"label\" class=\"po-tag-title po-text-nowrap\">\n <span class=\"po-tag-label\">{{ tagOrientation ? label + ':' : label }}</span>\n </div>\n\n <div class=\"po-tag-sub-container\">\n <div\n #poTagWrapper\n class=\"po-tag-wrapper\"\n [class.po-clickable]=\"isClickable && !disabled && !removable\"\n [attr.role]=\"isClickable && !disabled && !removable ? 'button' : ''\"\n (keydown.enter)=\"onKeyPressed($event)\"\n (keydown.space)=\"$event.preventDefault()\"\n (keyup.space)=\"onKeyPressed($event)\"\n (click)=\"onClick()\"\n [tabindex]=\"isClickable && !removable ? 0 : -1\"\n >\n <div\n #poTag\n class=\"po-tag\"\n [class.po-clickable]=\"isClickable && !disabled && !removable\"\n [class.po-tag-removable]=\"removable\"\n [class.po-tag-disabled]=\"disabled && removable\"\n [ngClass]=\"tagColor\"\n [ngStyle]=\"styleTag()\"\n >\n <po-icon\n *ngIf=\"icon && !removable\"\n class=\"po-tag-icon\"\n [p-icon]=\"!type ? icon : iconFromType\"\n [ngStyle]=\"!type && customTextColor ? { 'color': customTextColor } : ''\"\n >\n </po-icon>\n\n <div\n #tagContainer\n class=\"po-tag-value\"\n [p-append-in-body]=\"appendInBody\"\n [p-tooltip]=\"getWidthTag() ? value : ''\"\n p-tooltip-position=\"top\"\n >\n <span [ngStyle]=\"!type && customTextColor && !removable ? { 'color': customTextColor } : ''\">{{\n value\n }}</span>\n </div>\n\n <po-icon\n #tagClose\n *ngIf=\"removable\"\n p-icon=\"ICON_CLOSE\"\n p-tooltip-position=\"top\"\n [p-tooltip]=\"literals.remove\"\n [p-append-in-body]=\"appendInBody\"\n [attr.aria-label]=\"setAriaLabel()\"\n class=\"po-tag-remove\"\n [class.po-clickable]=\"!disabled\"\n [tabindex]=\"!disabled ? 0 : -1\"\n [attr.role]=\"!disabled ? 'button' : ''\"\n (click)=\"onClose()\"\n (keydown.enter)=\"onClose('enter')\"\n >\n </po-icon>\n </div>\n </div>\n </div>\n</div>\n" }]
2758
+ args: [{ selector: 'po-tag', changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, template: "<div class=\"po-tag-container\" [class.po-tag-container-horizontal]=\"tagOrientation\">\n <div *ngIf=\"label\" class=\"po-tag-title po-text-nowrap\">\n <span class=\"po-tag-label\">{{ tagOrientation ? label + ':' : label }}</span>\n </div>\n\n <div class=\"po-tag-sub-container\">\n <div\n #poTagWrapper\n class=\"po-tag-wrapper\"\n [class.po-clickable]=\"isClickable && !disabled && !removable\"\n [attr.role]=\"isClickable && !disabled && !removable ? 'button' : ''\"\n (keydown.enter)=\"onKeyPressed($event)\"\n (keydown.space)=\"$event.preventDefault()\"\n (keyup.space)=\"onKeyPressed($event)\"\n (click)=\"onClick()\"\n [tabindex]=\"isClickable && !removable ? 0 : -1\"\n >\n <div\n #poTag\n class=\"po-tag\"\n [class.po-clickable]=\"isClickable && !disabled && !removable\"\n [class.po-tag-removable]=\"removable\"\n [class.po-tag-disabled]=\"disabled && removable\"\n [ngClass]=\"tagColor\"\n [ngStyle]=\"styleTag()\"\n >\n <po-icon\n *ngIf=\"icon && !removable\"\n class=\"po-tag-icon\"\n [p-icon]=\"!type || forceIcon ? icon : iconFromType\"\n [ngStyle]=\"!type && customTextColor ? { 'color': customTextColor } : ''\"\n >\n </po-icon>\n\n <div\n #tagContainer\n class=\"po-tag-value\"\n [p-append-in-body]=\"appendInBody\"\n [p-tooltip]=\"getWidthTag() ? value : ''\"\n p-tooltip-position=\"top\"\n >\n <span [ngStyle]=\"!type && customTextColor && !removable ? { 'color': customTextColor } : ''\">{{\n value\n }}</span>\n </div>\n\n <po-icon\n #tagClose\n *ngIf=\"removable\"\n p-icon=\"ICON_CLOSE\"\n p-tooltip-position=\"top\"\n [p-tooltip]=\"literals.remove\"\n [p-append-in-body]=\"appendInBody\"\n [attr.aria-label]=\"setAriaLabel()\"\n class=\"po-tag-remove\"\n [class.po-clickable]=\"!disabled\"\n [tabindex]=\"!disabled ? 0 : -1\"\n [attr.role]=\"!disabled ? 'button' : ''\"\n (click)=\"onClose()\"\n (keydown.enter)=\"onClose('enter')\"\n >\n </po-icon>\n </div>\n </div>\n </div>\n</div>\n" }]
2754
2759
  }], ctorParameters: () => [{ type: i0.ElementRef }, { type: PoLanguageService }], propDecorators: { tagContainer: [{
2755
2760
  type: ViewChild,
2756
2761
  args: ['tagContainer', { static: true }]
@@ -7034,11 +7039,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.7", ngImpor
7034
7039
  }] });
7035
7040
 
7036
7041
  /**
7037
- * @usedBy PoButtonComponent
7042
+ * @usedBy PoButtonComponent, PoWidgetComponent
7038
7043
  *
7039
7044
  * @description
7040
7045
  *
7041
- * Estilos (`p-kind`) disponíveis do componente.
7046
+ * Estilos disponíveis do button.
7042
7047
  */
7043
7048
  var PoButtonKind;
7044
7049
  (function (PoButtonKind) {
@@ -9965,7 +9970,13 @@ class PoCheckboxBaseComponent {
9965
9970
  * Este evento ativa automaticamente a exibição do ícone de ajuda adicional ao `p-help`.
9966
9971
  */
9967
9972
  additionalHelp = new EventEmitter();
9968
- // Evento disparado ao sair do campo.
9973
+ /**
9974
+ * @optional
9975
+ *
9976
+ * @description
9977
+ *
9978
+ * Evento disparado ao sair do campo.
9979
+ */
9969
9980
  blur = new EventEmitter();
9970
9981
  /**
9971
9982
  * @optional
@@ -51834,6 +51845,25 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.7", ngImpor
51834
51845
  }]
51835
51846
  }] });
51836
51847
 
51848
+ const poWidgetLiteralsDefault = {
51849
+ en: {
51850
+ help: 'Help',
51851
+ configuration: 'Settings'
51852
+ },
51853
+ es: {
51854
+ help: 'Ayuda',
51855
+ configuration: 'Ajustes'
51856
+ },
51857
+ pt: {
51858
+ help: 'Ajuda',
51859
+ configuration: 'Configurações'
51860
+ },
51861
+ ru: {
51862
+ help: 'Помощь',
51863
+ configuration: 'Настройки'
51864
+ }
51865
+ };
51866
+
51837
51867
  /**
51838
51868
  *
51839
51869
  * @description
@@ -51847,6 +51877,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.7", ngImpor
51847
51877
  * Para controlar sua largura, é possível utilizar o [Grid System](/guides/grid-system) para um maior
51848
51878
  * controle de seu redimensionamento, assim possibilitando o tratamento para diferentes resoluções.
51849
51879
  *
51880
+ * #### Boas práticas
51881
+ *
51882
+ * Utilize um tamanho mínimo de largura de aproximadamente `18.75rem` no componente.
51883
+ *
51850
51884
  * #### Acessibilidade tratada no componente
51851
51885
  *
51852
51886
  * Algumas diretrizes de acessibilidade já são tratadas no componente, internamente, e não podem ser alteradas. São elas:
@@ -51861,35 +51895,178 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.7", ngImpor
51861
51895
  *
51862
51896
  * > Para maiores informações, acesse o guia [Personalizando o Tema Padrão com Tokens CSS](https://po-ui.io/guides/theme-customization).
51863
51897
  *
51864
- * | Propriedade | Descrição | Valor Padrão |
51865
- * |----------------------------------------------|------------------------------------------------------------------|--------------------------------------------------|
51866
- * | **Default Values** | | |
51867
- * | `--padding` | Preenchimento | `1rem` |
51868
- * | `--border-radius` | Contém o valor do raio dos cantos do elemento&nbsp; | `var(--border-radius-md)` |
51869
- * | `--border-width` | Contém o valor da largura dos cantos do elemento&nbsp; | `var(--border-width-sm)` |
51870
- * | `--border-color` | Cor da borda | `var(--color-neutral-light-20)` |
51871
- * | `--background` | Cor de background | `var(--color-neutral-light-00)` |
51872
- * | `--shadow` | Contém o valor da sombra do elemento | `var(--shadow-md)` |
51873
- * | **Selected** | | |
51874
- * | `--background-selected` &nbsp; | Cor de background no estado selecionado &nbsp; | `var(--color-brand-01-lightest)` |
51875
- * | `--border-color-selected` &nbsp; | Cor da borda no estado selecionado | `var(--color-action-default)` |
51876
- * | **Hover** | | |
51877
- * | `--border-color-hover` | Cor da borda no estado hover | `var(--color-brand-01-dark)` |
51878
- * | `--shadow-hover` | Contém o valor da sombra do elemento no estado hover &nbsp; | `var(--shadow-lg)` |
51879
- * | **Focused** | | |
51880
- * | `--color-focused` | Cor principal no estado de focus | `var(--color-action-default)` |
51881
- * | `--outline-color-focused` &nbsp; | Cor do outline do estado de focus | `var(--color-action-focus)` |
51898
+ * | Propriedade | Descrição | Valor Padrão |
51899
+ * |----------------------------------------------|------------------------------------------------------------------|-----------------------------------------------------------------------------|
51900
+ * | **Default Values** | | |
51901
+ * | `--font-family` | Família tipográfica usada | `var(--font-family-theme) ` |
51902
+ * | `--font-size` | Tamanho da fonte | `var(--font-size-sm)` |
51903
+ * | `--font-weight` | Peso da fonte | `var(--font-weight-bold)` |
51904
+ * | `--font-color` | Cor da fonte | `var(--color-neutral-dark-95)` |
51905
+ * | `--padding` - `@deprecated 21.x.x` | Preenchimento do componente | `1rem` |
51906
+ * | `--padding-header` | Preenchimento do header | `var(--spacing-sm) var(--spacing-sm) var(--spacing-xs) var(--spacing-sm)` |
51907
+ * | `--padding-body` | Preenchimento do body | `var(--spacing-xs) var(--spacing-sm) var(--spacing-xs) var(--spacing-sm)` |
51908
+ * | `--padding-footer` | Preenchimento do footer | `var(--spacing-xs) var(--spacing-sm) var(--spacing-sm) var(--spacing-sm)` |
51909
+ * | `--border-radius` | Contém o valor do raio dos cantos do elemento&nbsp; | `var(--border-radius-md)` |
51910
+ * | `--border-width` | Contém o valor da largura dos cantos do elemento&nbsp; | `var(--border-width-sm)` |
51911
+ * | `--border-color` | Cor da borda | `var(--color-neutral-light-20)` |
51912
+ * | `--background` | Cor de background | `var(--color-neutral-light-00)` |
51913
+ * | `--shadow` | Contém o valor da sombra do elemento | `var(--shadow-md)` |
51914
+ * | **Hover** | | |
51915
+ * | `--border-color-hover` | Cor da borda no estado hover | `var(--color-brand-01-dark)` |
51916
+ * | **Focused** | | |
51917
+ * | `--color-focused` | Cor principal no estado de focus | `var(--color-action-default)` |
51918
+ * | `--outline-color-focused` &nbsp; | Cor do outline do estado de focus | `var(--color-action-focus)` |
51882
51919
  *
51883
51920
  */
51884
51921
  class PoWidgetBaseComponent {
51922
+ poThemeService;
51923
+ _size = undefined;
51885
51924
  /** Descrição da segunda ação. */
51925
+ /**
51926
+ * @optional
51927
+ *
51928
+ * @description
51929
+ * Define o label e exibe a ação secundária no footer do componente.
51930
+ *
51931
+ * > Exibida apenas quando `p-primary-label` estiver definida.
51932
+ */
51886
51933
  secondaryLabel;
51887
51934
  /**
51888
51935
  * @optional
51889
51936
  *
51890
51937
  * @description
51891
51938
  *
51892
- * Ação que será executada quando o usuário clicar sobre a área total do `po-widget`.
51939
+ * Caso verdadeiro o botão da ação `p-primary-label` ativará o modo `danger`.
51940
+ *
51941
+ * > Incompatível com o tipo **tertiary** da propriedade `p-kind-primary-action`.
51942
+ *
51943
+ * @default `false`
51944
+ */
51945
+ dangerPrimaryAction = false;
51946
+ /**
51947
+ * @optional
51948
+ *
51949
+ * @description
51950
+ *
51951
+ * Caso verdadeiro o botão da ação `p-secondary-label` ativará o modo `danger`.
51952
+ *
51953
+ * > Incompatível com o tipo **tertiary** da propriedade `p-kind-primary-action`.
51954
+ *
51955
+ * @default `false`
51956
+ */
51957
+ dangerSecondaryAction = false;
51958
+ /**
51959
+ * @optional
51960
+ *
51961
+ * @description
51962
+ *
51963
+ * Define o estilo do botão da ação `p-primary-label`, conforme o enum `PoButtonKind`.
51964
+ *
51965
+ * @default `tertiary`
51966
+ */
51967
+ kindPrimaryAction;
51968
+ /**
51969
+ * @optional
51970
+ *
51971
+ * @description
51972
+ *
51973
+ * Define o estilo do botão da ação `p-secondary-label`, conforme o enum `PoButtonKind`.
51974
+ *
51975
+ * @default `tertiary`
51976
+ */
51977
+ kindSecondaryAction;
51978
+ /**
51979
+ * @optional
51980
+ *
51981
+ * @description
51982
+ *
51983
+ * Label da tag exibida no header.
51984
+ *
51985
+ * > Quando a tag atingir uma largura máxima de 15rem (240px), será truncado com reticências.
51986
+ * O conteúdo completo poderá ser visualizado ao passar o mouse sobre a tag, por meio do tooltip.
51987
+ */
51988
+ tagLabel;
51989
+ /**
51990
+ * @optional
51991
+ *
51992
+ * @description
51993
+ *
51994
+ * Define o tipo da `p-tag`, conforme o enum **PoTagType**.
51995
+ *
51996
+ * Valores válidos:
51997
+ * - `success`: cor verde utilizada para simbolizar sucesso ou êxito.
51998
+ * - `warning`: cor amarela que representa aviso ou advertência.
51999
+ * - `danger`: cor vermelha para erro ou aviso crítico.
52000
+ * - `info`: cor azul claro que caracteriza conteúdo informativo.
52001
+ * - `neutral`: cor cinza claro para uso geral.
52002
+ *
52003
+ * @default `success`
52004
+ */
52005
+ tagType;
52006
+ /**
52007
+ * @optional
52008
+ *
52009
+ * @description
52010
+ *
52011
+ * Define o ícone exibido ao lado do label da `p-tag`.
52012
+ *
52013
+ * É possível usar qualquer um dos ícones da [Biblioteca de ícones PO UI](https://po-ui.io/icons), conforme exemplo:
52014
+ * ```
52015
+ * <po-widget p-tag-icon="an an-user"></po-widget>
52016
+ * ```
52017
+ * Também é possível utilizar outras fontes de ícones, por exemplo a biblioteca *Font Awesome*, desde que a biblioteca
52018
+ * esteja carregada no projeto:
52019
+ * ```
52020
+ * <po-widget p-tag-icon="fa fa-podcast"></po-widget>
52021
+ * ```
52022
+ *
52023
+ * Outra opção seria a customização do ícone através do `TemplateRef`, conforme exemplo abaixo:
52024
+ * ```
52025
+ * <po-widget [p-tag-icon]="template"></po-widget>
52026
+ *
52027
+ * <ng-template #template>
52028
+ * <i class="fa fa-podcast" style="font-size: inherit;"></i>
52029
+ * </ng-template>
52030
+ * ```
52031
+ * > Para o ícone enquadrar corretamente, deve-se utilizar `font-size: inherit` caso o ícone utilizado não aplique-o.
52032
+ */
52033
+ tagIcon;
52034
+ /**
52035
+ * @optional
52036
+ *
52037
+ * @description
52038
+ *
52039
+ * Lista de ações exibidas no header do componente.
52040
+ * As propriedades das ações seguem a interface `PoPopupAction`.
52041
+ */
52042
+ actions = [];
52043
+ /**
52044
+ * @optional
52045
+ *
52046
+ * @description
52047
+ *
52048
+ * Define o tamanho dos botões do componente:
52049
+ * - `small`: altura de 32px (disponível apenas para acessibilidade AA).
52050
+ * - `medium`: altura de 44px.
52051
+ *
52052
+ * > Caso a acessibilidade AA não esteja configurada, o tamanho `medium` será mantido.
52053
+ * Para mais detalhes, consulte a documentação do [po-theme](https://po-ui.io/documentation/po-theme).
52054
+ *
52055
+ * @default `medium`
52056
+ */
52057
+ set size(value) {
52058
+ this._size = validateSize(value, this.poThemeService, PoFieldSize);
52059
+ }
52060
+ get size() {
52061
+ return this._size ?? getDefaultSize(this.poThemeService, PoFieldSize);
52062
+ }
52063
+ /**
52064
+ * @optional
52065
+ *
52066
+ * @description
52067
+ *
52068
+ * Evento disparado quando o usuário clicar no componente.
52069
+ * > Quando este evento está em uso, uma sombra (shadow) é aplicada automaticamente ao componente.
51893
52070
  */
51894
52071
  click = new EventEmitter();
51895
52072
  /**
@@ -51897,7 +52074,7 @@ class PoWidgetBaseComponent {
51897
52074
  *
51898
52075
  * @description
51899
52076
  *
51900
- * Função que será disparada com o valor do `p-disabled` quando esta propriedade for alterada.
52077
+ * Evento disparado quando a propriedade `p-disabled` for alterada.
51901
52078
  */
51902
52079
  onDisabled = new EventEmitter();
51903
52080
  /**
@@ -51905,7 +52082,7 @@ class PoWidgetBaseComponent {
51905
52082
  *
51906
52083
  * @description
51907
52084
  *
51908
- * Função que será chamada na primeira ação.
52085
+ * Evento disparado ao clicar na ação `p-primary-label`.
51909
52086
  */
51910
52087
  primaryAction = new EventEmitter();
51911
52088
  /**
@@ -51913,21 +52090,21 @@ class PoWidgetBaseComponent {
51913
52090
  *
51914
52091
  * @description
51915
52092
  *
51916
- * Função que será chamada na segunda ação.
52093
+ * Evento disparado ao clicar na ação `p-secondary-label`.
51917
52094
  */
51918
52095
  secondaryAction = new EventEmitter();
51919
52096
  /**
51920
52097
  * @optional
51921
52098
  *
51922
52099
  * @description
51923
- * Função chamada ao clicar no ícone de configuração
52100
+ * Evento disparado ao clicar em **Configurações** incluído no menu de ações do header.
51924
52101
  */
51925
52102
  setting = new EventEmitter();
51926
52103
  /**
51927
52104
  * @optional
51928
52105
  *
51929
52106
  * @description
51930
- * Função que será chamada ao clicar no título.
52107
+ * Evento disparado ao clicar no título definido em `p-title`.
51931
52108
  */
51932
52109
  titleAction = new EventEmitter();
51933
52110
  containerHeight = 'auto';
@@ -51945,7 +52122,7 @@ class PoWidgetBaseComponent {
51945
52122
  *
51946
52123
  * @description
51947
52124
  *
51948
- * Aplicação de imagem de fundo.
52125
+ * Define uma imagem de fundo.
51949
52126
  * > Se a imagem escolhida intervir na legibilidade do texto contido no `p-widget`,
51950
52127
  * pode-se utilizar a propriedade `p-primary` em conjunto para que os textos fiquem na cor branca.
51951
52128
  *
@@ -51961,7 +52138,7 @@ class PoWidgetBaseComponent {
51961
52138
  *
51962
52139
  * @description
51963
52140
  *
51964
- * Desabilita todas as ações do componente.
52141
+ * Desabilita o componente.
51965
52142
  *
51966
52143
  * @default `false`
51967
52144
  */
@@ -51977,9 +52154,7 @@ class PoWidgetBaseComponent {
51977
52154
  *
51978
52155
  * @description
51979
52156
  *
51980
- * Define a altura do `po-widget`.
51981
- * A altura mínima para o `po-widget` depende do que será exibido através das propriedades `p-primary-label`,
51982
- * `p-setting`, `p-help` e `p-title`.
52157
+ * Define a altura do componente.
51983
52158
  * > Caso não seja informado valor, a propriedade irá assumir o tamanho do conteúdo.
51984
52159
  */
51985
52160
  set height(value) {
@@ -51994,7 +52169,7 @@ class PoWidgetBaseComponent {
51994
52169
  *
51995
52170
  * @description
51996
52171
  *
51997
- * Link de ajuda
52172
+ * Link de ajuda incluído no menu de ações do header.
51998
52173
  */
51999
52174
  set help(value) {
52000
52175
  this._help = isTypeof(value, 'string') ? value : '';
@@ -52009,7 +52184,8 @@ class PoWidgetBaseComponent {
52009
52184
  *
52010
52185
  * @description
52011
52186
  *
52012
- * Desabilita a sombra do `po-widget` quando o mesmo for clicável.
52187
+ * Desabilita a sombra do componente quando o mesmo for clicável.
52188
+ * > A sombra é exibida por padrão apenas quando o evento `p-click` está definido.
52013
52189
  *
52014
52190
  * @default `true`
52015
52191
  */
@@ -52040,9 +52216,8 @@ class PoWidgetBaseComponent {
52040
52216
  *
52041
52217
  * @description
52042
52218
  *
52043
- * Descrição da primeira ação.
52219
+ * Define o label e exibe a ação primária no footer do componente.
52044
52220
  *
52045
- * @default `false`
52046
52221
  */
52047
52222
  set primaryLabel(value) {
52048
52223
  this._primaryLabel = isTypeof(value, 'string') ? value : '';
@@ -52056,9 +52231,10 @@ class PoWidgetBaseComponent {
52056
52231
  *
52057
52232
  * @description
52058
52233
  *
52059
- * Título do `po-widget`.
52234
+ * Título do componente.
52060
52235
  *
52061
- * @default `false`
52236
+ * > Quando o conteúdo exceder o espaço disponível, o texto será truncado com reticências. O conteúdo completo poderá
52237
+ * ser visualizado ao passar o mouse sobre a tag, por meio do tooltip.
52062
52238
  */
52063
52239
  set title(value) {
52064
52240
  this._title = isTypeof(value, 'string') ? value : '';
@@ -52067,14 +52243,44 @@ class PoWidgetBaseComponent {
52067
52243
  get title() {
52068
52244
  return this._title;
52069
52245
  }
52070
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: PoWidgetBaseComponent, deps: [], target: i0.ɵɵFactoryTarget.Directive });
52071
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.7", type: PoWidgetBaseComponent, isStandalone: true, inputs: { secondaryLabel: ["p-secondary-label", "secondaryLabel"], background: ["p-background", "background"], disabled: ["p-disabled", "disabled"], height: ["p-height", "height"], help: ["p-help", "help"], noShadow: ["p-no-shadow", "noShadow"], primary: ["p-primary", "primary"], primaryLabel: ["p-primary-label", "primaryLabel"], title: ["p-title", "title"] }, outputs: { click: "p-click", onDisabled: "p-on-disabled", primaryAction: "p-primary-action", secondaryAction: "p-secondary-action", setting: "p-setting", titleAction: "p-title-action" }, ngImport: i0 });
52246
+ constructor(poThemeService) {
52247
+ this.poThemeService = poThemeService;
52248
+ }
52249
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: PoWidgetBaseComponent, deps: [{ token: PoThemeService }], target: i0.ɵɵFactoryTarget.Directive });
52250
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "19.0.7", type: PoWidgetBaseComponent, isStandalone: true, inputs: { secondaryLabel: ["p-secondary-label", "secondaryLabel"], dangerPrimaryAction: ["p-danger-primary-action", "dangerPrimaryAction", convertToBoolean], dangerSecondaryAction: ["p-danger-secondary-action", "dangerSecondaryAction", convertToBoolean], kindPrimaryAction: ["p-kind-primary-action", "kindPrimaryAction"], kindSecondaryAction: ["p-kind-secondary-action", "kindSecondaryAction"], tagLabel: ["p-tag", "tagLabel"], tagType: ["p-tag-type", "tagType"], tagIcon: ["p-tag-icon", "tagIcon"], actions: ["p-actions", "actions"], size: ["p-size", "size"], background: ["p-background", "background"], disabled: ["p-disabled", "disabled"], height: ["p-height", "height"], help: ["p-help", "help"], noShadow: ["p-no-shadow", "noShadow"], primary: ["p-primary", "primary"], primaryLabel: ["p-primary-label", "primaryLabel"], title: ["p-title", "title"] }, outputs: { click: "p-click", onDisabled: "p-on-disabled", primaryAction: "p-primary-action", secondaryAction: "p-secondary-action", setting: "p-setting", titleAction: "p-title-action" }, ngImport: i0 });
52072
52251
  }
52073
52252
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: PoWidgetBaseComponent, decorators: [{
52074
52253
  type: Directive
52075
- }], propDecorators: { secondaryLabel: [{
52254
+ }], ctorParameters: () => [{ type: PoThemeService }], propDecorators: { secondaryLabel: [{
52076
52255
  type: Input,
52077
52256
  args: ['p-secondary-label']
52257
+ }], dangerPrimaryAction: [{
52258
+ type: Input,
52259
+ args: [{ alias: 'p-danger-primary-action', transform: convertToBoolean }]
52260
+ }], dangerSecondaryAction: [{
52261
+ type: Input,
52262
+ args: [{ alias: 'p-danger-secondary-action', transform: convertToBoolean }]
52263
+ }], kindPrimaryAction: [{
52264
+ type: Input,
52265
+ args: ['p-kind-primary-action']
52266
+ }], kindSecondaryAction: [{
52267
+ type: Input,
52268
+ args: ['p-kind-secondary-action']
52269
+ }], tagLabel: [{
52270
+ type: Input,
52271
+ args: ['p-tag']
52272
+ }], tagType: [{
52273
+ type: Input,
52274
+ args: ['p-tag-type']
52275
+ }], tagIcon: [{
52276
+ type: Input,
52277
+ args: ['p-tag-icon']
52278
+ }], actions: [{
52279
+ type: Input,
52280
+ args: ['p-actions']
52281
+ }], size: [{
52282
+ type: Input,
52283
+ args: [{ alias: 'p-size' }]
52078
52284
  }], click: [{
52079
52285
  type: Output,
52080
52286
  args: ['p-click']
@@ -52146,17 +52352,54 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.7", ngImpor
52146
52352
  *
52147
52353
  */
52148
52354
  class PoWidgetComponent extends PoWidgetBaseComponent {
52355
+ cd;
52356
+ poTheme;
52357
+ popupTarget;
52358
+ literals;
52359
+ hasContent = false;
52360
+ poPopupComponent;
52361
+ buttonPopUp;
52362
+ wrapperInfo;
52363
+ wrapperTitle;
52364
+ tagElement;
52365
+ contentContainer;
52149
52366
  get showTitleAction() {
52150
52367
  return !!this.titleAction.observers[0];
52151
52368
  }
52152
- constructor(viewRef) {
52153
- super();
52369
+ constructor(viewRef, languageService, cd, poTheme) {
52370
+ super(poTheme);
52371
+ this.cd = cd;
52372
+ this.poTheme = poTheme;
52373
+ const language = languageService.getShortLanguage();
52374
+ this.literals = {
52375
+ ...poWidgetLiteralsDefault[poLocaleDefault],
52376
+ ...poWidgetLiteralsDefault[language]
52377
+ };
52378
+ }
52379
+ ngAfterViewInit() {
52380
+ this.updateContent();
52381
+ }
52382
+ get a11Level() {
52383
+ return this.poTheme.getA11yLevel();
52384
+ }
52385
+ ngOnChanges(changes) {
52386
+ if (changes['help'] || changes['actions']) {
52387
+ this.checkDefaultActions();
52388
+ }
52389
+ if (changes['title'] || changes['tagLabel']) {
52390
+ this.cd.detectChanges();
52391
+ }
52392
+ this.updateContent();
52393
+ this.setHeight(this.height);
52154
52394
  }
52155
52395
  ngOnInit() {
52156
52396
  this.setHeight(this.height);
52397
+ this.checkDefaultActions();
52398
+ this.showTooltip();
52399
+ this.cd.detectChanges();
52157
52400
  }
52158
52401
  hasTitleHelpOrSetting() {
52159
- return !!this.title || !!this.help || !!this.setting.observers[0];
52402
+ return !!this.title || !!this.help || !!this.setting.observers[0] || !!this.tagLabel || !!this?.actions.length;
52160
52403
  }
52161
52404
  onClick(event) {
52162
52405
  if (this.click.observed && !this.disabled) {
@@ -52171,21 +52414,18 @@ class PoWidgetComponent extends PoWidgetBaseComponent {
52171
52414
  event.preventDefault();
52172
52415
  }
52173
52416
  }
52174
- openHelp(event) {
52417
+ openHelp() {
52175
52418
  if (!this.disabled) {
52176
- event.stopPropagation();
52177
52419
  window.open(this.help, '_blank');
52178
52420
  }
52179
52421
  }
52180
- runPrimaryAction(event) {
52422
+ runPrimaryAction() {
52181
52423
  if (!this.disabled) {
52182
- event.stopPropagation();
52183
52424
  this.primaryAction.emit();
52184
52425
  }
52185
52426
  }
52186
- runSecondaryAction(event) {
52427
+ runSecondaryAction() {
52187
52428
  if (!this.disabled) {
52188
- event.stopPropagation();
52189
52429
  this.secondaryAction.emit();
52190
52430
  }
52191
52431
  }
@@ -52196,25 +52436,24 @@ class PoWidgetComponent extends PoWidgetBaseComponent {
52196
52436
  }
52197
52437
  }
52198
52438
  setHeight(height) {
52439
+ this.checkDefaultActions();
52440
+ const actionsHeight = this.a11Level === 'AA' && this.size === 'small' ? 56 : 68;
52441
+ const actionsButton = this.a11Level === 'AA' && this.size === 'small' ? 56 : 68;
52199
52442
  if (height) {
52200
- let bodyHeight = height;
52201
- const hasSettingOrHelp = this.setting.observers.length > 0 || this.help;
52202
- const footerBorder = 1;
52203
- const footerHeight = 40;
52204
- const settingHeight = 37;
52205
- const shadowHeight = 2;
52206
- const titleHeight = 50;
52207
- if (this.noShadow) {
52208
- bodyHeight -= shadowHeight;
52209
- }
52210
- if (hasSettingOrHelp && !this.title) {
52211
- bodyHeight -= settingHeight;
52443
+ let bodyHeight = height - 2;
52444
+ if ((this.title || this.tagLabel) && !this.actions.length) {
52445
+ if (this.tagLabel && this.tagIcon) {
52446
+ bodyHeight -= 50;
52447
+ }
52448
+ else {
52449
+ bodyHeight -= 48;
52450
+ }
52212
52451
  }
52213
- if (this.title) {
52214
- bodyHeight -= titleHeight;
52452
+ if (this.actions.length) {
52453
+ bodyHeight -= actionsHeight;
52215
52454
  }
52216
- if (this.primaryLabel) {
52217
- bodyHeight -= footerHeight + footerBorder;
52455
+ if (this.primaryLabel || this.secondaryLabel) {
52456
+ bodyHeight -= actionsButton;
52218
52457
  }
52219
52458
  this.containerHeight = `${bodyHeight}px`;
52220
52459
  }
@@ -52222,19 +52461,97 @@ class PoWidgetComponent extends PoWidgetBaseComponent {
52222
52461
  this.containerHeight = `auto`;
52223
52462
  }
52224
52463
  }
52225
- settingOutput(event) {
52464
+ settingOutput() {
52226
52465
  if (!this.disabled) {
52227
- event.stopPropagation();
52228
52466
  this.setting.emit();
52229
52467
  }
52230
52468
  }
52231
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: PoWidgetComponent, deps: [{ token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Component });
52232
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.7", type: PoWidgetComponent, isStandalone: false, selector: "po-widget", usesInheritance: true, ngImport: i0, template: "<div\n [class.po-clickable]=\"click.observers.length\"\n [class.po-widget]=\"!primary\"\n [class.po-widget-disabled]=\"disabled\"\n [class.po-widget-primary]=\"primary\"\n [class.po-widget-no-shadow]=\"click.observers.length && noShadow\"\n [style.background-image]=\"background ? 'url(' + background + ')' : undefined\"\n (click)=\"onClick($event)\"\n (keydown)=\"onKeyDown($event)\"\n [tabindex]=\"disabled || !click.observers.length ? -1 : 0\"\n>\n <div *ngIf=\"hasTitleHelpOrSetting()\" class=\"po-widget-header\">\n <span *ngIf=\"showTitleAction; else noTitleAction\" class=\"po-widget-title-action\" (click)=\"runTitleAction($event)\">\n {{ title }}\n </span>\n <ng-template #noTitleAction>{{ title }}</ng-template>\n\n <div *ngIf=\"setting.observers[0] || help\" class=\"po-pull-right\">\n <po-icon\n id=\"settingAction-{{ id }}\"\n *ngIf=\"setting.observers[0]\"\n p-icon=\"ICON_SETTINGS\"\n class=\"po-clickable\"\n (click)=\"settingOutput($event)\"\n >\n </po-icon>\n <po-icon id=\"helpLink-{{ id }}\" *ngIf=\"help\" p-icon=\"ICON_HELP\" (click)=\"openHelp($event)\" class=\"po-clickable\">\n </po-icon>\n </div>\n </div>\n\n <po-container p-no-border [p-height]=\"containerHeight\">\n <div class=\"po-widget-body\">\n <ng-content></ng-content>\n </div>\n </po-container>\n\n <div *ngIf=\"primaryLabel\" class=\"po-widget-footer\">\n <div class=\"po-widget-xl\" *ngIf=\"!secondaryLabel\">\n <a class=\"po-widget-action\" id=\"primaryAct-{{ id }}\" (click)=\"runPrimaryAction($event)\">{{ primaryLabel }}</a>\n </div>\n\n <div class=\"po-widget-md\" *ngIf=\"secondaryLabel\">\n <a class=\"po-widget-action\" id=\"primaryAct-{{ id }}\" (click)=\"runPrimaryAction($event)\">{{ primaryLabel }}</a>\n </div>\n <div class=\"po-widget-md\" *ngIf=\"secondaryLabel\">\n <a class=\"po-widget-action\" id=\"secondaryAct-{{ id }}\" (click)=\"runSecondaryAction($event)\">{{\n secondaryLabel\n }}</a>\n </div>\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: PoContainerComponent, selector: "po-container" }, { kind: "component", type: PoIconComponent, selector: "po-icon", inputs: ["p-icon"] }] });
52469
+ togglePopup(targetRef, event) {
52470
+ event.stopPropagation();
52471
+ this.popupTarget = targetRef;
52472
+ this.cd.detectChanges();
52473
+ this.poPopupComponent.toggle();
52474
+ }
52475
+ showTooltip() {
52476
+ const sumGap = this.tagLabel ? 12 : 6;
52477
+ return (this.title &&
52478
+ this.wrapperTitle?.nativeElement.offsetWidth + sumGap + (this.tagElement?.nativeElement.offsetWidth || 0) >=
52479
+ this.wrapperInfo?.nativeElement.offsetWidth);
52480
+ }
52481
+ closePopUp() {
52482
+ this.buttonPopUp?.focus();
52483
+ }
52484
+ checkDefaultActions() {
52485
+ if (this.setting.observed && !this.actions.some(action => action.$id === 'widget_configuration')) {
52486
+ this.actions = [
52487
+ ...this.actions,
52488
+ {
52489
+ icon: 'ICON_SETTINGS',
52490
+ label: this.literals.configuration,
52491
+ type: 'default',
52492
+ action: this.settingOutput.bind(this),
52493
+ $id: 'widget_configuration'
52494
+ }
52495
+ ];
52496
+ }
52497
+ if (this.help && !this.actions.some(action => action.$id === 'widget_help')) {
52498
+ this.actions = [
52499
+ ...this.actions,
52500
+ {
52501
+ icon: 'ICON_HELP',
52502
+ label: this.literals.help,
52503
+ type: 'default',
52504
+ action: this.openHelp.bind(this),
52505
+ $id: 'widget_help'
52506
+ }
52507
+ ];
52508
+ }
52509
+ if (!this.help) {
52510
+ this.actions = this.actions.filter(action => action.$id !== 'widget_help');
52511
+ }
52512
+ }
52513
+ updateContent() {
52514
+ const el = this.contentContainer?.nativeElement;
52515
+ if (!el) {
52516
+ return;
52517
+ }
52518
+ const existContent = Array.from(el.childNodes).some(node => {
52519
+ if (node.nodeType === Node.TEXT_NODE) {
52520
+ return (node.textContent || '').trim().length > 0;
52521
+ }
52522
+ if (node.nodeType === Node.ELEMENT_NODE) {
52523
+ return true;
52524
+ }
52525
+ return false;
52526
+ });
52527
+ this.hasContent = existContent;
52528
+ this.cd.detectChanges();
52529
+ }
52530
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: PoWidgetComponent, deps: [{ token: i0.ViewContainerRef }, { token: PoLanguageService }, { token: i0.ChangeDetectorRef }, { token: PoThemeService }], target: i0.ɵɵFactoryTarget.Component });
52531
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.7", type: PoWidgetComponent, isStandalone: false, selector: "po-widget", viewQueries: [{ propertyName: "poPopupComponent", first: true, predicate: ["popup"], descendants: true, static: true }, { propertyName: "buttonPopUp", first: true, predicate: ["buttonPopUp"], descendants: true }, { propertyName: "wrapperInfo", first: true, predicate: ["wrapperInfo"], descendants: true }, { propertyName: "wrapperTitle", first: true, predicate: ["wrapperTitle"], descendants: true }, { propertyName: "tagElement", first: true, predicate: ["tagElement"], descendants: true, read: ElementRef }, { propertyName: "contentContainer", first: true, predicate: ["contentContainer"], descendants: true, read: ElementRef }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<div\n class=\"po-widget-container\"\n [class.po-clickable]=\"click.observers.length\"\n [class.po-widget]=\"!primary\"\n [class.po-widget-disabled]=\"disabled\"\n [class.po-widget-primary]=\"primary\"\n [class.po-widget-no-shadow]=\"click.observers.length && noShadow\"\n [style.background-image]=\"background ? 'url(' + background + ')' : undefined\"\n (click)=\"onClick($event)\"\n (keydown)=\"onKeyDown($event)\"\n [tabindex]=\"disabled || !click.observers.length ? -1 : 0\"\n>\n <div *ngIf=\"hasTitleHelpOrSetting()\" class=\"po-widget-header\">\n <div class=\"po-widget-wrapper-info\">\n <div #wrapperInfo class=\"po-widget-wrapper-tag\">\n @if (showTitleAction) {\n <span\n #wrapperTitle\n class=\"po-widget-title-action po-widget-text\"\n (click)=\"runTitleAction($event)\"\n [p-tooltip]=\"title && showTooltip() ? title : ''\"\n >\n {{ title }}\n </span>\n } @else {\n <p #wrapperTitle class=\"po-widget-text\" [p-tooltip]=\"title && showTooltip() ? title : ''\">\n {{ title }}\n </p>\n }\n\n <po-tag\n #tagElement\n *ngIf=\"tagLabel\"\n [p-value]=\"tagLabel\"\n [p-icon]=\"tagIcon\"\n [p-type]=\"disabled ? null : tagType ? tagType : 'success'\"\n [p-color]=\"disabled ? '#ECECEE' : null\"\n [p-text-color]=\"disabled ? '#36364A' : null\"\n p-force-icon\n >\n </po-tag>\n </div>\n\n <div\n *ngIf=\"actions?.length\"\n class=\"po-widget-button-wrapper\"\n #popupTarget\n (click)=\"togglePopup(popupTarget, $event)\"\n (keydown)=\"$event.stopPropagation()\"\n >\n <po-button\n #buttonPopUp\n [p-size]=\"size\"\n p-icon=\"an-fill an-dots-three-outline-vertical\"\n [p-disabled]=\"disabled\"\n p-kind=\"tertiary\"\n >\n </po-button>\n </div>\n </div>\n </div>\n\n <po-container p-no-border [p-height]=\"containerHeight\">\n <div #contentContainer class=\"po-widget-body\">\n <ng-content #refContent></ng-content>\n </div>\n <span *ngIf=\"!hasContent && height\" class=\"po-header-content-fallback\">.</span>\n </po-container>\n\n <div *ngIf=\"primaryLabel\" class=\"po-widget-footer\">\n <ng-container *ngIf=\"!secondaryLabel\">\n <div class=\"po-widget-actions\" (click)=\"$event.stopPropagation()\" (keydown)=\"$event.stopPropagation()\">\n <po-button\n class=\"po-widget-actions\"\n id=\"primaryAct-{{ id }}\"\n [p-label]=\"primaryLabel\"\n (p-click)=\"runPrimaryAction()\"\n [p-danger]=\"dangerPrimaryAction\"\n [p-kind]=\"primary ? 'primary' : kindPrimaryAction || 'tertiary'\"\n [p-disabled]=\"disabled\"\n [p-size]=\"size\"\n ></po-button>\n </div>\n </ng-container>\n\n <ng-container *ngIf=\"secondaryLabel\">\n <div class=\"po-widget-actions\" (click)=\"$event.stopPropagation()\" (keydown)=\"$event.stopPropagation()\">\n <po-button\n class=\"po-widget-actions\"\n id=\"primaryAct-{{ id }}\"\n [p-label]=\"primaryLabel\"\n (p-click)=\"runPrimaryAction()\"\n [p-danger]=\"dangerPrimaryAction\"\n [p-kind]=\"primary ? 'primary' : kindPrimaryAction || 'tertiary'\"\n [p-disabled]=\"disabled\"\n [p-size]=\"size\"\n ></po-button>\n </div>\n </ng-container>\n <ng-container *ngIf=\"secondaryLabel\">\n <div class=\"po-widget-actions\" (click)=\"$event.stopPropagation()\" (keydown)=\"$event.stopPropagation()\">\n <po-button\n class=\"po-widget-actions\"\n id=\"secondaryAct-{{ id }}\"\n [p-label]=\"secondaryLabel\"\n (p-click)=\"runSecondaryAction()\"\n [p-danger]=\"dangerSecondaryAction\"\n [p-kind]=\"primary ? 'primary' : kindSecondaryAction || 'tertiary'\"\n [p-disabled]=\"disabled\"\n [p-size]=\"size\"\n ></po-button>\n </div>\n </ng-container>\n </div>\n</div>\n\n<po-popup #popup [p-actions]=\"actions\" [p-size]=\"size\" [p-target]=\"popupTarget\" (p-close)=\"closePopUp()\"> </po-popup>\n", dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: PoContainerComponent, selector: "po-container" }, { kind: "component", type: PoTagComponent, selector: "po-tag" }, { kind: "component", type: PoButtonComponent, selector: "po-button" }, { kind: "component", type: PoPopupComponent, selector: "po-popup" }, { kind: "directive", type: PoTooltipDirective, selector: "[p-tooltip]" }] });
52233
52532
  }
52234
52533
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: PoWidgetComponent, decorators: [{
52235
52534
  type: Component,
52236
- args: [{ selector: 'po-widget', standalone: false, template: "<div\n [class.po-clickable]=\"click.observers.length\"\n [class.po-widget]=\"!primary\"\n [class.po-widget-disabled]=\"disabled\"\n [class.po-widget-primary]=\"primary\"\n [class.po-widget-no-shadow]=\"click.observers.length && noShadow\"\n [style.background-image]=\"background ? 'url(' + background + ')' : undefined\"\n (click)=\"onClick($event)\"\n (keydown)=\"onKeyDown($event)\"\n [tabindex]=\"disabled || !click.observers.length ? -1 : 0\"\n>\n <div *ngIf=\"hasTitleHelpOrSetting()\" class=\"po-widget-header\">\n <span *ngIf=\"showTitleAction; else noTitleAction\" class=\"po-widget-title-action\" (click)=\"runTitleAction($event)\">\n {{ title }}\n </span>\n <ng-template #noTitleAction>{{ title }}</ng-template>\n\n <div *ngIf=\"setting.observers[0] || help\" class=\"po-pull-right\">\n <po-icon\n id=\"settingAction-{{ id }}\"\n *ngIf=\"setting.observers[0]\"\n p-icon=\"ICON_SETTINGS\"\n class=\"po-clickable\"\n (click)=\"settingOutput($event)\"\n >\n </po-icon>\n <po-icon id=\"helpLink-{{ id }}\" *ngIf=\"help\" p-icon=\"ICON_HELP\" (click)=\"openHelp($event)\" class=\"po-clickable\">\n </po-icon>\n </div>\n </div>\n\n <po-container p-no-border [p-height]=\"containerHeight\">\n <div class=\"po-widget-body\">\n <ng-content></ng-content>\n </div>\n </po-container>\n\n <div *ngIf=\"primaryLabel\" class=\"po-widget-footer\">\n <div class=\"po-widget-xl\" *ngIf=\"!secondaryLabel\">\n <a class=\"po-widget-action\" id=\"primaryAct-{{ id }}\" (click)=\"runPrimaryAction($event)\">{{ primaryLabel }}</a>\n </div>\n\n <div class=\"po-widget-md\" *ngIf=\"secondaryLabel\">\n <a class=\"po-widget-action\" id=\"primaryAct-{{ id }}\" (click)=\"runPrimaryAction($event)\">{{ primaryLabel }}</a>\n </div>\n <div class=\"po-widget-md\" *ngIf=\"secondaryLabel\">\n <a class=\"po-widget-action\" id=\"secondaryAct-{{ id }}\" (click)=\"runSecondaryAction($event)\">{{\n secondaryLabel\n }}</a>\n </div>\n </div>\n</div>\n" }]
52237
- }], ctorParameters: () => [{ type: i0.ViewContainerRef }] });
52535
+ args: [{ selector: 'po-widget', standalone: false, template: "<div\n class=\"po-widget-container\"\n [class.po-clickable]=\"click.observers.length\"\n [class.po-widget]=\"!primary\"\n [class.po-widget-disabled]=\"disabled\"\n [class.po-widget-primary]=\"primary\"\n [class.po-widget-no-shadow]=\"click.observers.length && noShadow\"\n [style.background-image]=\"background ? 'url(' + background + ')' : undefined\"\n (click)=\"onClick($event)\"\n (keydown)=\"onKeyDown($event)\"\n [tabindex]=\"disabled || !click.observers.length ? -1 : 0\"\n>\n <div *ngIf=\"hasTitleHelpOrSetting()\" class=\"po-widget-header\">\n <div class=\"po-widget-wrapper-info\">\n <div #wrapperInfo class=\"po-widget-wrapper-tag\">\n @if (showTitleAction) {\n <span\n #wrapperTitle\n class=\"po-widget-title-action po-widget-text\"\n (click)=\"runTitleAction($event)\"\n [p-tooltip]=\"title && showTooltip() ? title : ''\"\n >\n {{ title }}\n </span>\n } @else {\n <p #wrapperTitle class=\"po-widget-text\" [p-tooltip]=\"title && showTooltip() ? title : ''\">\n {{ title }}\n </p>\n }\n\n <po-tag\n #tagElement\n *ngIf=\"tagLabel\"\n [p-value]=\"tagLabel\"\n [p-icon]=\"tagIcon\"\n [p-type]=\"disabled ? null : tagType ? tagType : 'success'\"\n [p-color]=\"disabled ? '#ECECEE' : null\"\n [p-text-color]=\"disabled ? '#36364A' : null\"\n p-force-icon\n >\n </po-tag>\n </div>\n\n <div\n *ngIf=\"actions?.length\"\n class=\"po-widget-button-wrapper\"\n #popupTarget\n (click)=\"togglePopup(popupTarget, $event)\"\n (keydown)=\"$event.stopPropagation()\"\n >\n <po-button\n #buttonPopUp\n [p-size]=\"size\"\n p-icon=\"an-fill an-dots-three-outline-vertical\"\n [p-disabled]=\"disabled\"\n p-kind=\"tertiary\"\n >\n </po-button>\n </div>\n </div>\n </div>\n\n <po-container p-no-border [p-height]=\"containerHeight\">\n <div #contentContainer class=\"po-widget-body\">\n <ng-content #refContent></ng-content>\n </div>\n <span *ngIf=\"!hasContent && height\" class=\"po-header-content-fallback\">.</span>\n </po-container>\n\n <div *ngIf=\"primaryLabel\" class=\"po-widget-footer\">\n <ng-container *ngIf=\"!secondaryLabel\">\n <div class=\"po-widget-actions\" (click)=\"$event.stopPropagation()\" (keydown)=\"$event.stopPropagation()\">\n <po-button\n class=\"po-widget-actions\"\n id=\"primaryAct-{{ id }}\"\n [p-label]=\"primaryLabel\"\n (p-click)=\"runPrimaryAction()\"\n [p-danger]=\"dangerPrimaryAction\"\n [p-kind]=\"primary ? 'primary' : kindPrimaryAction || 'tertiary'\"\n [p-disabled]=\"disabled\"\n [p-size]=\"size\"\n ></po-button>\n </div>\n </ng-container>\n\n <ng-container *ngIf=\"secondaryLabel\">\n <div class=\"po-widget-actions\" (click)=\"$event.stopPropagation()\" (keydown)=\"$event.stopPropagation()\">\n <po-button\n class=\"po-widget-actions\"\n id=\"primaryAct-{{ id }}\"\n [p-label]=\"primaryLabel\"\n (p-click)=\"runPrimaryAction()\"\n [p-danger]=\"dangerPrimaryAction\"\n [p-kind]=\"primary ? 'primary' : kindPrimaryAction || 'tertiary'\"\n [p-disabled]=\"disabled\"\n [p-size]=\"size\"\n ></po-button>\n </div>\n </ng-container>\n <ng-container *ngIf=\"secondaryLabel\">\n <div class=\"po-widget-actions\" (click)=\"$event.stopPropagation()\" (keydown)=\"$event.stopPropagation()\">\n <po-button\n class=\"po-widget-actions\"\n id=\"secondaryAct-{{ id }}\"\n [p-label]=\"secondaryLabel\"\n (p-click)=\"runSecondaryAction()\"\n [p-danger]=\"dangerSecondaryAction\"\n [p-kind]=\"primary ? 'primary' : kindSecondaryAction || 'tertiary'\"\n [p-disabled]=\"disabled\"\n [p-size]=\"size\"\n ></po-button>\n </div>\n </ng-container>\n </div>\n</div>\n\n<po-popup #popup [p-actions]=\"actions\" [p-size]=\"size\" [p-target]=\"popupTarget\" (p-close)=\"closePopUp()\"> </po-popup>\n" }]
52536
+ }], ctorParameters: () => [{ type: i0.ViewContainerRef }, { type: PoLanguageService }, { type: i0.ChangeDetectorRef }, { type: PoThemeService }], propDecorators: { poPopupComponent: [{
52537
+ type: ViewChild,
52538
+ args: ['popup', { static: true }]
52539
+ }], buttonPopUp: [{
52540
+ type: ViewChild,
52541
+ args: ['buttonPopUp']
52542
+ }], wrapperInfo: [{
52543
+ type: ViewChild,
52544
+ args: ['wrapperInfo']
52545
+ }], wrapperTitle: [{
52546
+ type: ViewChild,
52547
+ args: ['wrapperTitle']
52548
+ }], tagElement: [{
52549
+ type: ViewChild,
52550
+ args: ['tagElement', { read: ElementRef }]
52551
+ }], contentContainer: [{
52552
+ type: ViewChild,
52553
+ args: ['contentContainer', { read: ElementRef }]
52554
+ }] } });
52238
52555
 
52239
52556
  /**
52240
52557
  * @description
@@ -52243,13 +52560,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.7", ngImpor
52243
52560
  */
52244
52561
  class PoWidgetModule {
52245
52562
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: PoWidgetModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
52246
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.7", ngImport: i0, type: PoWidgetModule, declarations: [PoWidgetComponent], imports: [CommonModule, PoContainerModule, PoIconModule], exports: [PoWidgetComponent] });
52247
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: PoWidgetModule, imports: [CommonModule, PoContainerModule, PoIconModule] });
52563
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.7", ngImport: i0, type: PoWidgetModule, declarations: [PoWidgetComponent], imports: [CommonModule, PoContainerModule, PoIconModule, PoTagModule, PoButtonModule, PoPopupModule, PoTooltipModule], exports: [PoWidgetComponent] });
52564
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: PoWidgetModule, imports: [CommonModule, PoContainerModule, PoIconModule, PoTagModule, PoButtonModule, PoPopupModule, PoTooltipModule] });
52248
52565
  }
52249
52566
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: PoWidgetModule, decorators: [{
52250
52567
  type: NgModule,
52251
52568
  args: [{
52252
- imports: [CommonModule, PoContainerModule, PoIconModule],
52569
+ imports: [CommonModule, PoContainerModule, PoIconModule, PoTagModule, PoButtonModule, PoPopupModule, PoTooltipModule],
52253
52570
  exports: [PoWidgetComponent],
52254
52571
  declarations: [PoWidgetComponent]
52255
52572
  }]