@@ -11,11 +11,9 @@ import {
1111 ContentChildren ,
1212 DoCheck ,
1313 ElementRef ,
14- Inject ,
1514 IterableDiffers ,
1615 OnDestroy ,
1716 OnInit ,
18- Optional ,
1917 QueryList ,
2018 Renderer2 ,
2119 TemplateRef ,
@@ -28,12 +26,11 @@ import { Observable, Subscription } from 'rxjs';
2826import { PoDateService } from '../../services/po-date/po-date.service' ;
2927import { PoLanguageService } from '../../services/po-language/po-language.service' ;
3028import { PoNotificationService } from '../../services/po-notification/po-notification.service' ;
31- import { convertToBoolean , getDefaultSizeFn , PO_TABLE_ROW_HEIGHT_BY_SPACING , uuid } from '../../utils/util' ;
29+ import { getDefaultSizeFn , PO_TABLE_ROW_HEIGHT_BY_SPACING , PoUtils , uuid } from '../../utils/util' ;
3230import { PoModalAction , PoModalComponent } from '../po-modal' ;
3331import { PoPopupComponent } from '../po-popup/po-popup.component' ;
3432import { PoTableColumnLabel } from './po-table-column-label/po-table-column-label.interface' ;
3533
36- import { AnimaliaIconDictionary , ICONS_DICTIONARY } from '../po-icon' ;
3734import { PoTableRowTemplateArrowDirection } from './enums/po-table-row-template-arrow-direction.enum' ;
3835import { PoTableAction } from './interfaces/po-table-action.interface' ;
3936import { PoTableColumn } from './interfaces/po-table-column.interface' ;
@@ -173,8 +170,7 @@ export class PoTableComponent
173170
174171 private _columnManagerTarget : ElementRef ;
175172 private _columnManagerTargetFixed : ElementRef ;
176- private _iconToken : { [ key : string ] : string } ;
177- private differ ;
173+ private readonly differ ;
178174 private footerHeight ;
179175 private timeoutResize ;
180176 private visibleElement = false ;
@@ -215,21 +211,16 @@ export class PoTableComponent
215211 return this . _columnManagerTargetFixed ;
216212 }
217213
218- get iconNameLib ( ) {
219- return this . _iconToken . NAME_LIB ;
220- }
221-
222214 /* eslint-disable max-params */
223215
224216 constructor (
225217 poDate : PoDateService ,
226218 differs : IterableDiffers ,
227219 private readonly renderer : Renderer2 ,
228220 poLanguageService : PoLanguageService ,
229- private changeDetector : ChangeDetectorRef ,
230- private decimalPipe : DecimalPipe ,
231- private defaultService : PoTableService ,
232- @Optional ( ) @Inject ( ICONS_DICTIONARY ) value : { [ key : string ] : string }
221+ private readonly changeDetector : ChangeDetectorRef ,
222+ private readonly decimalPipe : DecimalPipe ,
223+ private readonly defaultService : PoTableService
233224 ) {
234225 super ( poDate , poLanguageService , defaultService ) ;
235226 this . JSON = JSON ;
@@ -242,8 +233,6 @@ export class PoTableComponent
242233 this . resizeListener = renderer . listen ( 'window' , 'resize' , ( event : any ) => {
243234 this . debounceResize ( ) ;
244235 } ) ;
245-
246- this . _iconToken = value ?? AnimaliaIconDictionary ;
247236 }
248237 /* eslint-enable max-params */
249238
@@ -392,8 +381,6 @@ export class PoTableComponent
392381 this . clearColumnWidths ( ) ;
393382 }
394383
395- // Permite que os cabeçalhos sejam calculados na primeira vez que o componente torna-se visível,
396- // evitando com isso, problemas com Tabs ou Divs que iniciem escondidas.
397384 if ( this . tableWrapperElement ?. nativeElement . offsetWidth && ! this . visibleElement && this . initialized ) {
398385 this . debounceResize ( ) ;
399386 this . checkInfiniteScroll ( ) ;
@@ -597,7 +584,7 @@ export class PoTableComponent
597584
598585 getBooleanLabel ( rowValue : any , columnBoolean : PoTableColumn ) : string {
599586 if ( rowValue || rowValue === false || rowValue === 0 ) {
600- rowValue = convertToBoolean ( rowValue ) ;
587+ rowValue = PoUtils . convertToBoolean ( rowValue ) ;
601588
602589 if ( columnBoolean . boolean ) {
603590 return rowValue ? columnBoolean . boolean . trueLabel || 'Sim' : columnBoolean . boolean . falseLabel || 'Não' ;
@@ -659,6 +646,12 @@ export class PoTableComponent
659646 this . changeVisibleColumns . emit ( columns ) ;
660647 }
661648
649+ onChangeFixedColumns ( columns : Array < string > ) {
650+ if ( ! this . hideActionFixedColumns ) {
651+ this . changeFixedColumns . emit ( columns ) ;
652+ }
653+ }
654+
662655 onColumnRestoreManager ( value : Array < string > ) {
663656 this . columnRestoreManager . emit ( value ) ;
664657 }
0 commit comments