Skip to content

Commit 07a8f97

Browse files
committed
Pagination Changes
1 parent e062863 commit 07a8f97

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

app/components/ak-pagination-provider/index.hbs

+3-1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,6 @@
1212
disableNext=this.disableNext
1313
nextAction=this.nextAction
1414
)
15-
}}
15+
}}
16+
17+
<div {{did-update this.updateTable @tableParams}} />

app/components/ak-pagination-provider/index.ts

+7
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,11 @@ export interface AkPaginationProviderSignature<R> {
3636
totalItems: number;
3737
itemPerPageOptions: number[];
3838
defaultLimit: number;
39+
tableParams?: string[];
3940
onItemPerPageChange: (args: PaginationProviderActionsArgs) => void;
4041
nextAction: (args: PaginationProviderActionsArgs) => void;
4142
prevAction: (args: PaginationProviderActionsArgs) => void;
43+
updateTable?: () => void;
4244
};
4345
Blocks: {
4446
default: [PaginationProviderDefaultBlockHash<R>];
@@ -124,6 +126,11 @@ export default class AkPaginationProviderComponent<R> extends Component<
124126
);
125127
}
126128

129+
@action
130+
updateTable() {
131+
this.args.updateTable?.();
132+
}
133+
127134
@action
128135
onItemPerPageChange(selectedItem: PaginationItemPerPageOptionProps) {
129136
this._updatePageItemSelectOptions(Number(selectedItem.value));

types/global.d.ts

+7
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,13 @@ declare module '@glint/environment-ember-loose/registry' {
109109
Return: void;
110110
}>;
111111

112+
'did-update': ModifierLike<{
113+
Args: {
114+
Positional: [callback: UnknownFnWithAnyArgType, params?: unknown];
115+
};
116+
Return: void;
117+
}>;
118+
112119
'will-destroy': ModifierLike<{
113120
Args: {
114121
Positional: [UnknownFnWithAnyArgType];

0 commit comments

Comments
 (0)