@po-ui/ng-components 19.22.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) {
@@ -51840,6 +51845,25 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.7", ngImpor
51840
51845
  }]
51841
51846
  }] });
51842
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
+
51843
51867
  /**
51844
51868
  *
51845
51869
  * @description
@@ -51853,6 +51877,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.7", ngImpor
51853
51877
  * Para controlar sua largura, é possível utilizar o [Grid System](/guides/grid-system) para um maior
51854
51878
  * controle de seu redimensionamento, assim possibilitando o tratamento para diferentes resoluções.
51855
51879
  *
51880
+ * #### Boas práticas
51881
+ *
51882
+ * Utilize um tamanho mínimo de largura de aproximadamente `18.75rem` no componente.
51883
+ *
51856
51884
  * #### Acessibilidade tratada no componente
51857
51885
  *
51858
51886
  * Algumas diretrizes de acessibilidade já são tratadas no componente, internamente, e não podem ser alteradas. São elas:
@@ -51867,35 +51895,178 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.7", ngImpor
51867
51895
  *
51868
51896
  * > Para maiores informações, acesse o guia [Personalizando o Tema Padrão com Tokens CSS](https://po-ui.io/guides/theme-customization).
51869
51897
  *
51870
- * | Propriedade | Descrição | Valor Padrão |
51871
- * |----------------------------------------------|------------------------------------------------------------------|--------------------------------------------------|
51872
- * | **Default Values** | | |
51873
- * | `--padding` | Preenchimento | `1rem` |
51874
- * | `--border-radius` | Contém o valor do raio dos cantos do elemento&nbsp; | `var(--border-radius-md)` |
51875
- * | `--border-width` | Contém o valor da largura dos cantos do elemento&nbsp; | `var(--border-width-sm)` |
51876
- * | `--border-color` | Cor da borda | `var(--color-neutral-light-20)` |
51877
- * | `--background` | Cor de background | `var(--color-neutral-light-00)` |
51878
- * | `--shadow` | Contém o valor da sombra do elemento | `var(--shadow-md)` |
51879
- * | **Selected** | | |
51880
- * | `--background-selected` &nbsp; | Cor de background no estado selecionado &nbsp; | `var(--color-brand-01-lightest)` |
51881
- * | `--border-color-selected` &nbsp; | Cor da borda no estado selecionado | `var(--color-action-default)` |
51882
- * | **Hover** | | |
51883
- * | `--border-color-hover` | Cor da borda no estado hover | `var(--color-brand-01-dark)` |
51884
- * | `--shadow-hover` | Contém o valor da sombra do elemento no estado hover &nbsp; | `var(--shadow-lg)` |
51885
- * | **Focused** | | |
51886
- * | `--color-focused` | Cor principal no estado de focus | `var(--color-action-default)` |
51887
- * | `--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)` |
51888
51919
  *
51889
51920
  */
51890
51921
  class PoWidgetBaseComponent {
51922
+ poThemeService;
51923
+ _size = undefined;
51891
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
+ */
51892
51933
  secondaryLabel;
51893
51934
  /**
51894
51935
  * @optional
51895
51936
  *
51896
51937
  * @description
51897
51938
  *
51898
- * 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.
51899
52070
  */
51900
52071
  click = new EventEmitter();
51901
52072
  /**
@@ -51903,7 +52074,7 @@ class PoWidgetBaseComponent {
51903
52074
  *
51904
52075
  * @description
51905
52076
  *
51906
- * 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.
51907
52078
  */
51908
52079
  onDisabled = new EventEmitter();
51909
52080
  /**
@@ -51911,7 +52082,7 @@ class PoWidgetBaseComponent {
51911
52082
  *
51912
52083
  * @description
51913
52084
  *
51914
- * Função que será chamada na primeira ação.
52085
+ * Evento disparado ao clicar na ação `p-primary-label`.
51915
52086
  */
51916
52087
  primaryAction = new EventEmitter();
51917
52088
  /**
@@ -51919,21 +52090,21 @@ class PoWidgetBaseComponent {
51919
52090
  *
51920
52091
  * @description
51921
52092
  *
51922
- * Função que será chamada na segunda ação.
52093
+ * Evento disparado ao clicar na ação `p-secondary-label`.
51923
52094
  */
51924
52095
  secondaryAction = new EventEmitter();
51925
52096
  /**
51926
52097
  * @optional
51927
52098
  *
51928
52099
  * @description
51929
- * 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.
51930
52101
  */
51931
52102
  setting = new EventEmitter();
51932
52103
  /**
51933
52104
  * @optional
51934
52105
  *
51935
52106
  * @description
51936
- * Função que será chamada ao clicar no título.
52107
+ * Evento disparado ao clicar no título definido em `p-title`.
51937
52108
  */
51938
52109
  titleAction = new EventEmitter();
51939
52110
  containerHeight = 'auto';
@@ -51951,7 +52122,7 @@ class PoWidgetBaseComponent {
51951
52122
  *
51952
52123
  * @description
51953
52124
  *
51954
- * Aplicação de imagem de fundo.
52125
+ * Define uma imagem de fundo.
51955
52126
  * > Se a imagem escolhida intervir na legibilidade do texto contido no `p-widget`,
51956
52127
  * pode-se utilizar a propriedade `p-primary` em conjunto para que os textos fiquem na cor branca.
51957
52128
  *
@@ -51967,7 +52138,7 @@ class PoWidgetBaseComponent {
51967
52138
  *
51968
52139
  * @description
51969
52140
  *
51970
- * Desabilita todas as ações do componente.
52141
+ * Desabilita o componente.
51971
52142
  *
51972
52143
  * @default `false`
51973
52144
  */
@@ -51983,9 +52154,7 @@ class PoWidgetBaseComponent {
51983
52154
  *
51984
52155
  * @description
51985
52156
  *
51986
- * Define a altura do `po-widget`.
51987
- * A altura mínima para o `po-widget` depende do que será exibido através das propriedades `p-primary-label`,
51988
- * `p-setting`, `p-help` e `p-title`.
52157
+ * Define a altura do componente.
51989
52158
  * > Caso não seja informado valor, a propriedade irá assumir o tamanho do conteúdo.
51990
52159
  */
51991
52160
  set height(value) {
@@ -52000,7 +52169,7 @@ class PoWidgetBaseComponent {
52000
52169
  *
52001
52170
  * @description
52002
52171
  *
52003
- * Link de ajuda
52172
+ * Link de ajuda incluído no menu de ações do header.
52004
52173
  */
52005
52174
  set help(value) {
52006
52175
  this._help = isTypeof(value, 'string') ? value : '';
@@ -52015,7 +52184,8 @@ class PoWidgetBaseComponent {
52015
52184
  *
52016
52185
  * @description
52017
52186
  *
52018
- * 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.
52019
52189
  *
52020
52190
  * @default `true`
52021
52191
  */
@@ -52046,9 +52216,8 @@ class PoWidgetBaseComponent {
52046
52216
  *
52047
52217
  * @description
52048
52218
  *
52049
- * Descrição da primeira ação.
52219
+ * Define o label e exibe a ação primária no footer do componente.
52050
52220
  *
52051
- * @default `false`
52052
52221
  */
52053
52222
  set primaryLabel(value) {
52054
52223
  this._primaryLabel = isTypeof(value, 'string') ? value : '';
@@ -52062,9 +52231,10 @@ class PoWidgetBaseComponent {
52062
52231
  *
52063
52232
  * @description
52064
52233
  *
52065
- * Título do `po-widget`.
52234
+ * Título do componente.
52066
52235
  *
52067
- * @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.
52068
52238
  */
52069
52239
  set title(value) {
52070
52240
  this._title = isTypeof(value, 'string') ? value : '';
@@ -52073,14 +52243,44 @@ class PoWidgetBaseComponent {
52073
52243
  get title() {
52074
52244
  return this._title;
52075
52245
  }
52076
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: PoWidgetBaseComponent, deps: [], target: i0.ɵɵFactoryTarget.Directive });
52077
- 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 });
52078
52251
  }
52079
52252
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: PoWidgetBaseComponent, decorators: [{
52080
52253
  type: Directive
52081
- }], propDecorators: { secondaryLabel: [{
52254
+ }], ctorParameters: () => [{ type: PoThemeService }], propDecorators: { secondaryLabel: [{
52082
52255
  type: Input,
52083
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' }]
52084
52284
  }], click: [{
52085
52285
  type: Output,
52086
52286
  args: ['p-click']
@@ -52152,17 +52352,54 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.7", ngImpor
52152
52352
  *
52153
52353
  */
52154
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;
52155
52366
  get showTitleAction() {
52156
52367
  return !!this.titleAction.observers[0];
52157
52368
  }
52158
- constructor(viewRef) {
52159
- 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);
52160
52394
  }
52161
52395
  ngOnInit() {
52162
52396
  this.setHeight(this.height);
52397
+ this.checkDefaultActions();
52398
+ this.showTooltip();
52399
+ this.cd.detectChanges();
52163
52400
  }
52164
52401
  hasTitleHelpOrSetting() {
52165
- return !!this.title || !!this.help || !!this.setting.observers[0];
52402
+ return !!this.title || !!this.help || !!this.setting.observers[0] || !!this.tagLabel || !!this?.actions.length;
52166
52403
  }
52167
52404
  onClick(event) {
52168
52405
  if (this.click.observed && !this.disabled) {
@@ -52177,21 +52414,18 @@ class PoWidgetComponent extends PoWidgetBaseComponent {
52177
52414
  event.preventDefault();
52178
52415
  }
52179
52416
  }
52180
- openHelp(event) {
52417
+ openHelp() {
52181
52418
  if (!this.disabled) {
52182
- event.stopPropagation();
52183
52419
  window.open(this.help, '_blank');
52184
52420
  }
52185
52421
  }
52186
- runPrimaryAction(event) {
52422
+ runPrimaryAction() {
52187
52423
  if (!this.disabled) {
52188
- event.stopPropagation();
52189
52424
  this.primaryAction.emit();
52190
52425
  }
52191
52426
  }
52192
- runSecondaryAction(event) {
52427
+ runSecondaryAction() {
52193
52428
  if (!this.disabled) {
52194
- event.stopPropagation();
52195
52429
  this.secondaryAction.emit();
52196
52430
  }
52197
52431
  }
@@ -52202,25 +52436,24 @@ class PoWidgetComponent extends PoWidgetBaseComponent {
52202
52436
  }
52203
52437
  }
52204
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;
52205
52442
  if (height) {
52206
- let bodyHeight = height;
52207
- const hasSettingOrHelp = this.setting.observers.length > 0 || this.help;
52208
- const footerBorder = 1;
52209
- const footerHeight = 40;
52210
- const settingHeight = 37;
52211
- const shadowHeight = 2;
52212
- const titleHeight = 50;
52213
- if (this.noShadow) {
52214
- bodyHeight -= shadowHeight;
52215
- }
52216
- if (hasSettingOrHelp && !this.title) {
52217
- 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
+ }
52218
52451
  }
52219
- if (this.title) {
52220
- bodyHeight -= titleHeight;
52452
+ if (this.actions.length) {
52453
+ bodyHeight -= actionsHeight;
52221
52454
  }
52222
- if (this.primaryLabel) {
52223
- bodyHeight -= footerHeight + footerBorder;
52455
+ if (this.primaryLabel || this.secondaryLabel) {
52456
+ bodyHeight -= actionsButton;
52224
52457
  }
52225
52458
  this.containerHeight = `${bodyHeight}px`;
52226
52459
  }
@@ -52228,19 +52461,97 @@ class PoWidgetComponent extends PoWidgetBaseComponent {
52228
52461
  this.containerHeight = `auto`;
52229
52462
  }
52230
52463
  }
52231
- settingOutput(event) {
52464
+ settingOutput() {
52232
52465
  if (!this.disabled) {
52233
- event.stopPropagation();
52234
52466
  this.setting.emit();
52235
52467
  }
52236
52468
  }
52237
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: PoWidgetComponent, deps: [{ token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Component });
52238
- 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]" }] });
52239
52532
  }
52240
52533
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: PoWidgetComponent, decorators: [{
52241
52534
  type: Component,
52242
- 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" }]
52243
- }], 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
+ }] } });
52244
52555
 
52245
52556
  /**
52246
52557
  * @description
@@ -52249,13 +52560,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.7", ngImpor
52249
52560
  */
52250
52561
  class PoWidgetModule {
52251
52562
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: PoWidgetModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
52252
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.7", ngImport: i0, type: PoWidgetModule, declarations: [PoWidgetComponent], imports: [CommonModule, PoContainerModule, PoIconModule], exports: [PoWidgetComponent] });
52253
- 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] });
52254
52565
  }
52255
52566
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: PoWidgetModule, decorators: [{
52256
52567
  type: NgModule,
52257
52568
  args: [{
52258
- imports: [CommonModule, PoContainerModule, PoIconModule],
52569
+ imports: [CommonModule, PoContainerModule, PoIconModule, PoTagModule, PoButtonModule, PoPopupModule, PoTooltipModule],
52259
52570
  exports: [PoWidgetComponent],
52260
52571
  declarations: [PoWidgetComponent]
52261
52572
  }]