primevue icon indicating copy to clipboard operation
primevue copied to clipboard

DataTable: Incorrect passthrough types

Open slavco86 opened this issue 10 months ago • 0 comments

Describe the bug

There are 2 issues at hand:

  1. TS definitions for DataTablePassThroughOptions are not in sync with documentation. Specifically, in TS file we have this column?: ColumnPassThroughOptionType; , but in documentation it's DataTablePassThroughOptionType
  2. Neither of the definitions are actually what is being passed to the passthrough method, in terms of arguments. Instead of being passed either ColumnPassThroughOptionType or DataTablePassThroughOptionType - the callback method for the column is being passed this: Screenshot 2024-04-15 at 19 16 16

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

slavco86 avatar Apr 15 '24 18:04 slavco86