diff --git a/projects/templates/src/lib/components/po-page-dynamic-table/po-page-dynamic-table.component.html b/projects/templates/src/lib/components/po-page-dynamic-table/po-page-dynamic-table.component.html index d400a032f..9b32b0dce 100644 --- a/projects/templates/src/lib/components/po-page-dynamic-table/po-page-dynamic-table.component.html +++ b/projects/templates/src/lib/components/po-page-dynamic-table/po-page-dynamic-table.component.html @@ -19,6 +19,7 @@ [p-actions]="tableActions" [p-actions-right]="actionRight" [p-selectable]="enableSelectionTable" + [p-single-select]="singleSelect" [p-columns]="columns" [p-items]="items" [p-height]="height" diff --git a/projects/templates/src/lib/components/po-page-dynamic-table/po-page-dynamic-table.component.spec.ts b/projects/templates/src/lib/components/po-page-dynamic-table/po-page-dynamic-table.component.spec.ts index 3fba24023..e788936e6 100644 --- a/projects/templates/src/lib/components/po-page-dynamic-table/po-page-dynamic-table.component.spec.ts +++ b/projects/templates/src/lib/components/po-page-dynamic-table/po-page-dynamic-table.component.spec.ts @@ -140,6 +140,9 @@ describe('PoPageDynamicTableComponent:', () => { expectPropertiesValues(component, 'hideCloseDisclaimers', validValues, validValues); }); + it('p-single-select: should update property `p-single-select` with false.', () => { + expectPropertiesValues(component, 'singleSelect', booleanInvalidValues, false); + it('hideColumnsManager: should set property `p-hide-columns-manager` to `false` if invalid value', () => { component.hideColumnsManager = utilsFunctions.convertToBoolean(3); diff --git a/projects/templates/src/lib/components/po-page-dynamic-table/po-page-dynamic-table.component.ts b/projects/templates/src/lib/components/po-page-dynamic-table/po-page-dynamic-table.component.ts index 1f3c9f560..43410db2a 100644 --- a/projects/templates/src/lib/components/po-page-dynamic-table/po-page-dynamic-table.component.ts +++ b/projects/templates/src/lib/components/po-page-dynamic-table/po-page-dynamic-table.component.ts @@ -266,6 +266,15 @@ export class PoPageDynamicTableComponent extends PoPageDynamicListBaseComponent */ @Input({ alias: 'p-infinite-scroll', transform: convertToBoolean }) infiniteScroll: boolean = false; + /** + * @description + * + * Define que somente uma linha da tabela pode ser selecionada. + * + * > Esta definição não se aplica aos itens filhos, os mesmos possuem comportamento independente do item pai. + */ + @Input('p-single-select') @InputBoolean() singleSelect?: boolean = false; + hasNext = false; items = []; literals;