primereact icon indicating copy to clipboard operation
primereact copied to clipboard

Fix: Datatable radiobuttons and types

Open ivanpajon opened this issue 1 year ago • 6 comments

Defect Fixes

Fix #6697

I fix the behavior of radiobuttons in datatable so they can be styled through PT, and although I don't even know what ptm, ptmo, cx, sx functions mean and do... I figured out what they did and managed to make it work. So please, if there is a cleaner way or a 'Prime React' way you usually use, feel free to make the necessary changes.

Changes made:

  • Types: Fix wrong defined types
  • Types: Add missing types
  • Types: Remvove types not used
  • Datatable: Propagate unstyled prop inside Datatable internal components
  • Radiobutton: Change prop input to radiobuttoninput
  • Radiobutton: Change prop box to radiobuttonbox
  • Radiobutton: Change prop icon to radiobuttonicon
  • Update Tailwind PT
  • Update Datatable doc unstyled example

Using the same example used to reproduce the bug you can see the result:

  1. Download stackblitz example to local
  2. Clone PrimeReact with changes from this pull request
  3. Build PrimeReact in local
  4. Link PrimeReact local library in Stackblitz local example
  5. Serve
  6. You will see 2 Datatables
  7. Styles in "Fixed unstyled values" Datatable should be correct.

Open in StackBlitz

Table "Deafult unstyled values" not working: default_unstyled_values

Fixed table "Fixed unstyled values": fixed_unstyled_values

Example of PrimeReact documentation: radiobutton_primereact_doc

ONLY RADIOBUTTONS, DON'T COMPARE REST OF STYLES

ivanpajon avatar May 28 '24 22:05 ivanpajon

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Ignored Deployments
Name Status Preview Comments Updated (UTC)
primereact ⬜️ Ignored (Inspect) Visit Preview Jun 10, 2024 11:02am
primereact-v9 ⬜️ Ignored (Inspect) Visit Preview Jun 10, 2024 11:02am

vercel[bot] avatar May 28 '24 22:05 vercel[bot]

See "npm run build:api" script in package.json

melloware avatar May 28 '24 23:05 melloware

In fact I didn't manually change any the index.json, but after running npm run dev:link:windows and making the changes that file was auto generated. If index.json files are not needed when doing a commit maybe .gitignore should be updated...

ivanpajon avatar May 29 '24 06:05 ivanpajon

Hmm OK i didn't see you had updated .d.ts that is what triggers the updating of index.json.

melloware avatar May 29 '24 11:05 melloware

@nitrogenous this looks great to me but wanted you to review also.

melloware avatar May 29 '24 11:05 melloware

Seems fine but we are currently working on some structural updates let me also check is there any conflicts with our current tasks. Appreciate it @melloware

nitrogenous avatar May 30 '24 08:05 nitrogenous