@po-ui/ng-components 19.5.0 → 19.6.0-beta.2
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.
- package/fesm2022/po-ui-ng-components.mjs +64 -25
- package/fesm2022/po-ui-ng-components.mjs.map +1 -1
- package/lib/components/po-tabs/po-tabs-base.component.d.ts +3 -1
- package/lib/services/po-theme/po-theme.service.d.ts +2 -0
- package/package.json +4 -4
- package/po-ui-ng-components-19.6.0-beta.2.tgz +0 -0
- package/schematics/ng-add/index.js +1 -1
- package/schematics/ng-update/v14/index.js +1 -1
- package/schematics/ng-update/v15/index.js +1 -1
- package/schematics/ng-update/v16/index.js +1 -1
- package/schematics/ng-update/v17/index.js +1 -1
- package/schematics/ng-update/v18/index.js +2 -2
- package/schematics/ng-update/v19/index.js +2 -2
- package/schematics/ng-update/v2/index.js +1 -1
- package/schematics/ng-update/v3/index.js +1 -1
- package/schematics/ng-update/v4/index.js +1 -1
- package/schematics/ng-update/v5/index.js +1 -1
- package/schematics/ng-update/v6/index.js +1 -1
- package/po-ui-ng-components-19.5.0.tgz +0 -0
|
@@ -17838,7 +17838,7 @@ class PoDatepickerComponent extends PoDatepickerBaseComponent {
|
|
|
17838
17838
|
};
|
|
17839
17839
|
}
|
|
17840
17840
|
onKeyup($event) {
|
|
17841
|
-
if (this.readonly) {
|
|
17841
|
+
if (this.readonly || $event?.target !== this.inputEl?.nativeElement) {
|
|
17842
17842
|
return;
|
|
17843
17843
|
}
|
|
17844
17844
|
this.objMask.keyup($event);
|
|
@@ -21034,18 +21034,7 @@ class PoThemeService {
|
|
|
21034
21034
|
this.document = document;
|
|
21035
21035
|
this.renderer = rendererFactory.createRenderer(null, null);
|
|
21036
21036
|
this._iconToken = value ?? AnimaliaIconDictionary;
|
|
21037
|
-
|
|
21038
|
-
// result: html:root
|
|
21039
|
-
this.setPerComponentAndOnRoot(undefined, poThemeDefaultAAA.perComponent, poThemeDefaultAAA.onRoot);
|
|
21040
|
-
// set double A
|
|
21041
|
-
// result: html[class*="-AA"]:root
|
|
21042
|
-
this.setPerComponentAndOnRoot({ a11y: PoThemeA11yEnum.AA }, poThemeDefaultAA.perComponent, poThemeDefaultAA.onRoot);
|
|
21043
|
-
// set Light mode values
|
|
21044
|
-
// result: html[class*="-light"]:root
|
|
21045
|
-
this.setPerComponentAndOnRoot({ type: PoThemeTypeEnum.light }, poThemeDefaultLightValues.perComponent, poThemeDefaultLightValues.onRoot);
|
|
21046
|
-
// set Dark mode values
|
|
21047
|
-
// result: html[class*="-dark"]:root
|
|
21048
|
-
this.setPerComponentAndOnRoot({ type: PoThemeTypeEnum.dark }, poThemeDefaultDarkValues.perComponent, poThemeDefaultDarkValues.onRoot);
|
|
21037
|
+
this.setDefaultBaseStyle();
|
|
21049
21038
|
}
|
|
21050
21039
|
/**
|
|
21051
21040
|
* Aplica um tema ao componente de acordo com o tipo de tema e o nível de acessibilidade especificados.
|
|
@@ -21059,6 +21048,9 @@ class PoThemeService {
|
|
|
21059
21048
|
* @param {boolean} [persistPreference=true] - (Opcional) Define se a preferência de tema deve ser salva no localStorage para persistência. `true` para salvar, `false` para não salvar.
|
|
21060
21049
|
*/
|
|
21061
21050
|
setTheme(themeConfig, themeType = PoThemeTypeEnum.light, a11yLevel = PoThemeA11yEnum.AAA, persistPreference = true) {
|
|
21051
|
+
if (themeConfig === poThemeDefault) {
|
|
21052
|
+
this.resetBaseTheme();
|
|
21053
|
+
}
|
|
21062
21054
|
// Change theme name, remove special characteres and number, replace space with dash
|
|
21063
21055
|
this.formatTheme(themeConfig, themeType, a11yLevel);
|
|
21064
21056
|
const _themeActive = Array.isArray(themeConfig.type) && themeConfig.type.length >= 1
|
|
@@ -21455,6 +21447,27 @@ class PoThemeService {
|
|
|
21455
21447
|
const _theme = this.getThemeActive();
|
|
21456
21448
|
this.setThemeA11y(_theme, a11y);
|
|
21457
21449
|
}
|
|
21450
|
+
resetBaseTheme() {
|
|
21451
|
+
const styleElement = this.document.head.querySelector('#baseStyle');
|
|
21452
|
+
if (styleElement) {
|
|
21453
|
+
this.renderer.removeChild(this.document.head, styleElement);
|
|
21454
|
+
}
|
|
21455
|
+
this.setDefaultBaseStyle();
|
|
21456
|
+
}
|
|
21457
|
+
setDefaultBaseStyle() {
|
|
21458
|
+
// set triple A for all themes (its the base theme)
|
|
21459
|
+
// result: html:root
|
|
21460
|
+
this.setPerComponentAndOnRoot(undefined, poThemeDefaultAAA.perComponent, poThemeDefaultAAA.onRoot);
|
|
21461
|
+
// set double A
|
|
21462
|
+
// result: html[class*="-AA"]:root
|
|
21463
|
+
this.setPerComponentAndOnRoot({ a11y: PoThemeA11yEnum.AA }, poThemeDefaultAA.perComponent, poThemeDefaultAA.onRoot);
|
|
21464
|
+
// set Light mode values
|
|
21465
|
+
// result: html[class*="-light"]:root
|
|
21466
|
+
this.setPerComponentAndOnRoot({ type: PoThemeTypeEnum.light }, poThemeDefaultLightValues.perComponent, poThemeDefaultLightValues.onRoot);
|
|
21467
|
+
// set Dark mode values
|
|
21468
|
+
// result: html[class*="-dark"]:root
|
|
21469
|
+
this.setPerComponentAndOnRoot({ type: PoThemeTypeEnum.dark }, poThemeDefaultDarkValues.perComponent, poThemeDefaultDarkValues.onRoot);
|
|
21470
|
+
}
|
|
21458
21471
|
static ɵfac = function PoThemeService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || PoThemeService)(i0.ɵɵinject(DOCUMENT), i0.ɵɵinject(i0.RendererFactory2), i0.ɵɵinject(ICONS_DICTIONARY, 8)); };
|
|
21459
21472
|
static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: PoThemeService, factory: PoThemeService.ɵfac, providedIn: 'root' });
|
|
21460
21473
|
}
|
|
@@ -34809,13 +34822,15 @@ class PoLookupModalBaseComponent {
|
|
|
34809
34822
|
}
|
|
34810
34823
|
//Método responsável por criar os disclaimers quando abre o modal.
|
|
34811
34824
|
setDisclaimersItems() {
|
|
34812
|
-
if (this.selectedItems &&
|
|
34813
|
-
this.multiple ? (this.selecteds = [{ value: this.selectedItems }]) : (this.selecteds = [this.selectedItems]);
|
|
34814
|
-
return;
|
|
34815
|
-
}
|
|
34816
|
-
if (this.selecteds.length === 0 && this.selectedItems && this.selectedItems.length) {
|
|
34825
|
+
if (this.selectedItems && Array.isArray(this.selectedItems) && this.selectedItems.length > 0) {
|
|
34817
34826
|
this.selecteds = [...this.selectedItems];
|
|
34818
34827
|
}
|
|
34828
|
+
else if (this.selectedItems && !Array.isArray(this.selectedItems)) {
|
|
34829
|
+
this.selecteds = [this.selectedItems];
|
|
34830
|
+
}
|
|
34831
|
+
else {
|
|
34832
|
+
this.selecteds = [];
|
|
34833
|
+
}
|
|
34819
34834
|
}
|
|
34820
34835
|
applyDisclaimerLabelValue(field, filterValue) {
|
|
34821
34836
|
const values = Array.isArray(filterValue) ? filterValue : [filterValue];
|
|
@@ -35653,27 +35668,48 @@ class PoLookupModalComponent extends PoLookupModalBaseComponent {
|
|
|
35653
35668
|
}
|
|
35654
35669
|
// Seleciona um item na tabela
|
|
35655
35670
|
onSelect(item) {
|
|
35671
|
+
const formattedItem = {
|
|
35672
|
+
value: item[this.fieldValue],
|
|
35673
|
+
label: item[this.fieldLabel],
|
|
35674
|
+
...item
|
|
35675
|
+
};
|
|
35656
35676
|
if (this.multiple) {
|
|
35657
|
-
this.
|
|
35677
|
+
this.selectedItems = this.selectedItems ? [...this.selectedItems, formattedItem] : [formattedItem];
|
|
35658
35678
|
}
|
|
35659
35679
|
else {
|
|
35660
|
-
this.
|
|
35680
|
+
this.selectedItems = [formattedItem];
|
|
35661
35681
|
}
|
|
35682
|
+
this.selecteds = [...this.selectedItems];
|
|
35662
35683
|
}
|
|
35663
35684
|
// Remove a seleção de um item na tabela
|
|
35664
35685
|
onUnselect(unselectedItem) {
|
|
35665
|
-
|
|
35686
|
+
if (this.multiple) {
|
|
35687
|
+
this.selectedItems = this.selectedItems.filter(item => item.value !== unselectedItem[this.fieldValue]);
|
|
35688
|
+
}
|
|
35689
|
+
else {
|
|
35690
|
+
this.selectedItems = [];
|
|
35691
|
+
}
|
|
35692
|
+
this.selecteds = [...this.selectedItems];
|
|
35666
35693
|
}
|
|
35667
35694
|
onUnselectFromDisclaimer(removedDisclaimer) {
|
|
35695
|
+
this.selectedItems = this.selectedItems.filter(item => item.value !== removedDisclaimer.value);
|
|
35696
|
+
if (this.selectedItems.length === 0) {
|
|
35697
|
+
this.selecteds = [];
|
|
35698
|
+
}
|
|
35699
|
+
else {
|
|
35700
|
+
this.selecteds = [...this.selectedItems];
|
|
35701
|
+
}
|
|
35668
35702
|
this.poTable.unselectRowItem(item => item[this.fieldValue] === removedDisclaimer.value);
|
|
35669
35703
|
}
|
|
35670
35704
|
// Seleciona todos os itens visíveis na tabela
|
|
35671
35705
|
onAllSelected(items) {
|
|
35672
|
-
this.
|
|
35706
|
+
this.selectedItems = items.map(item => ({ value: item[this.fieldValue], label: item[this.fieldLabel], ...item }));
|
|
35707
|
+
this.selecteds = [...this.selectedItems];
|
|
35673
35708
|
}
|
|
35674
35709
|
// Remove a seleção de todos os itens visíveis na tabela
|
|
35675
35710
|
onAllUnselected(items) {
|
|
35676
35711
|
this.poTable.unselectRows();
|
|
35712
|
+
this.selectedItems = [];
|
|
35677
35713
|
this.selecteds = [];
|
|
35678
35714
|
}
|
|
35679
35715
|
openModal() {
|
|
@@ -47697,7 +47733,7 @@ class PoDynamicViewBaseComponent extends PoDynamicSharedBase {
|
|
|
47697
47733
|
}
|
|
47698
47734
|
else {
|
|
47699
47735
|
this.service = this.multiselectFilterService;
|
|
47700
|
-
this.service.configProperties(field.optionsService, field.fieldLabel, field.fieldValue);
|
|
47736
|
+
this.service.configProperties(field.optionsService, field.fieldLabel || 'label', field.fieldValue || 'value');
|
|
47701
47737
|
}
|
|
47702
47738
|
}
|
|
47703
47739
|
else {
|
|
@@ -47706,7 +47742,7 @@ class PoDynamicViewBaseComponent extends PoDynamicSharedBase {
|
|
|
47706
47742
|
}
|
|
47707
47743
|
else {
|
|
47708
47744
|
this.service = this.comboFilterService;
|
|
47709
|
-
this.service.configProperties(field.optionsService, field.fieldLabel, field.fieldValue);
|
|
47745
|
+
this.service.configProperties(field.optionsService, field.fieldLabel || 'label', field.fieldValue || 'value');
|
|
47710
47746
|
}
|
|
47711
47747
|
}
|
|
47712
47748
|
}
|
|
@@ -47755,6 +47791,7 @@ class PoDynamicViewBaseComponent extends PoDynamicSharedBase {
|
|
|
47755
47791
|
const oldFieldIndex = newFields.indexOf(newFields.find(field => field === oldField));
|
|
47756
47792
|
newFields.splice(oldFieldIndex, 1, allValues);
|
|
47757
47793
|
sortFields(newFields);
|
|
47794
|
+
this.setContainerFields();
|
|
47758
47795
|
});
|
|
47759
47796
|
}
|
|
47760
47797
|
returnValues(field, value) {
|
|
@@ -58605,7 +58642,9 @@ class PoTabDropdownComponent {
|
|
|
58605
58642
|
* | `--font-weight` | Peso da fonte | `var(--font-weight-bold)` |
|
|
58606
58643
|
* | `--margin-tabs-container-left` | Margem lateral esquerda do componente quando usado dentro de um `page-default` | `var(--spacing-md)` |
|
|
58607
58644
|
* | `--margin-tabs-container-right` | Margem lateral direita do componente quando usado dentro de um `page-default` | `-16px` |
|
|
58608
|
-
* | `--padding-tabs-header` | Padding do valor lateral das abas |
|
|
58645
|
+
* | `--padding-tabs-header` | Padding do valor lateral das abas | `var(--spacing-sm)` |
|
|
58646
|
+
* | `--margin-tabs-first-child` | Margem lateral da primeira aba | `var(--spacing-md)` |
|
|
58647
|
+
* | `--margin-tabs-last-child` | Margem lateral da ultima aba | `var(--spacing-md)` |
|
|
58609
58648
|
* | **Disabled** | | |
|
|
58610
58649
|
* | `--color-disabled` | Cor da fonte no estado disabilitado | `var(--color-action-disabled)` |
|
|
58611
58650
|
* | `--background-item-disabled` | Cor de background do item desabilitado | `var(--color-neutral-light-10)` |
|