Skip to content

Commit b0754ab

Browse files
fix(table): Adiciona ion on close [v19] (#1362)
* fix(popover): fix popover actions * fix(ion-table): fix order call * feat: adiciona ion-on-close do popover nas tabelas
1 parent e0e32dc commit b0754ab

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed

projects/ion/src/lib/smart-table/smart-table.component.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,13 @@
368368
(ionOnSecondAction)="
369369
action.call && handleEvent(row, action.call)
370370
"
371+
(ionOnClose)="
372+
action.popover!(row)['ionOnClose']
373+
? handleEventEmit(
374+
action.popover!(row)['ionOnClose']
375+
)
376+
: null
377+
"
371378
[attr.data-testid]="'row-' + index + '-' + action.label"
372379
type="ghost"
373380
size="sm"

projects/ion/src/lib/table/ion-table.component.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,13 @@
303303
(ionOnSecondAction)="
304304
action.call ? handleEvent(row, action.call) : null
305305
"
306+
(ionOnClose)="
307+
action.popover!(row)['ionOnClose']
308+
? handleEventEmit(
309+
action.popover!(row)['ionOnClose']
310+
)
311+
: null
312+
"
306313
[attr.data-testid]="
307314
'row-' + index + '-' + action.label
308315
"

projects/ion/src/lib/utils/baseTable.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { EventEmitter } from '@angular/core';
44
import { CheckBoxEvent, CheckBoxStates, StateChange } from '../core/types';
55
import { PageEvent } from '../core/types/pagination';
66
import { ActionTable, BaseRow, Column, ConfigTable } from '../table/utils';
7+
import { SafeAny } from './safe-any';
78

89
export const DISABLED_COLOR = 'var(--ion-neutral-4)';
910
export const ENABLED_COLOR = 'var(--ion-primary-6)';
@@ -101,6 +102,12 @@ export abstract class BaseTable<
101102
}
102103
}
103104

105+
public handleEventEmit(action: EventEmitter<void>): void {
106+
if (action) {
107+
action.emit();
108+
}
109+
}
110+
104111
public showAction(row: RowType, action: ActionTable<RowType>): boolean {
105112
return action && action.show ? action.show(row) : true;
106113
}

0 commit comments

Comments
 (0)