primevue
primevue copied to clipboard
DataTable: Incorrect passthrough types
Describe the bug
There are 2 issues at hand:
- TS definitions for
DataTablePassThroughOptions
are not in sync with documentation. Specifically, in TS file we have thiscolumn?: ColumnPassThroughOptionType;
, but in documentation it'sDataTablePassThroughOptionType
- Neither of the definitions are actually what is being passed to the passthrough method, in terms of arguments. Instead of being passed either
ColumnPassThroughOptionType
orDataTablePassThroughOptionType
- the callback method for thecolumn
is being passed this:
On a practical level, I'm unable to style the DataTable based on the loading
prop value because either parentInstance
property doesn't exist on ColumnPassThroughOptionType
where I can get hold of loading
value or if I go via parent
property through to $parentInstance
where I can see loading
property - the value is not representing what is currently being passed to the component via a loading
prop (which is being correctly presented via parentInstance
property, which is missing from TS definitions).
Hope this is quick to fix and not too much to ask 🙏
Reproducer
https://stackblitz.com/edit/primevue-create-vue-typescript-issue-template-yu6yrx?file=src%2Fmain.ts
PrimeVue version
3.51.0
Vue version
3.x
Language
TypeScript
Build / Runtime
Vue CLI App
Browser(s)
Chrome 123.0.6312.123
Steps to reproduce the behavior
Go to repro link, open console, inspect the object being outputted into the console
Expected behavior
I should be able to obtain loading
prop via pass through options callback without TS errors