Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PrimeReact support v6 #4497

Draft
wants to merge 3 commits into
base: rjsf-v6
Choose a base branch
from
Draft

PrimeReact support v6 #4497

wants to merge 3 commits into from

Conversation

jasny
Copy link

@jasny jasny commented Feb 14, 2025

Reasons for making this change

Added PrimeReact theme. PrimeReact is a popular component library for React.

Fixes #2928

PrimeReact is at version 10. A lot has changed since 2022 both v4 to v6 of rjsf and v7 to v10 of primereact. The theme was created from scratch instead of modifying the existing PR. Closes #2723

Checklist

  • I'm updating documentation
  • I'm adding or updating code
    • I've added and/or updated tests. I've run npx nx run-many --target=build --exclude=@rjsf/docs && npm run test:update to update snapshots, if needed.
    • I've updated docs if needed
    • I've updated the changelog with a description of the PR
  • I'm adding a new feature
    • I've updated the playground with an example use of the feature

This was referenced Feb 14, 2025
@nickgros nickgros mentioned this pull request Feb 14, 2025
8 tasks
jasny added 3 commits March 8, 2025 13:57
Add `PrimeReact Customization` to docs
List `@rjsf/primereact` as them in the docs
@MarcoFantini
Copy link

Great work! This will be really useful for us!

@heath-freenome
Copy link
Member

@jasny I've merged a few PRs with updates and fixes from main. You'll have to rebase and update your PR. Also, checkout the new Layout Grid in the playground and update the layoutGrid.tsx in the samples directory to add your custom uiSchema for the grid to it.

Comment on lines +7 to +8
"typings": "lib/index.d.ts",
"scripts": {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jasny I improved ESM support in the other themes in 5.24.7. Can you add these:

Suggested change
"typings": "lib/index.d.ts",
"scripts": {
"typings": "lib/index.d.ts",
"exports": {
".": {
"require": "./dist/index.js",
"import": "./lib/index.js",
"types": "./lib/index.d.ts"
},
"./lib": {
"require": "./dist/index.js",
"import": "./lib/index.js",
"types": "./lib/index.d.ts"
},
"./lib/*.js": {
"require": "./dist/*.js",
"import": "./lib/*.js",
"types": "./lib/*.d.ts"
},
"./dist": {
"require": "./dist/index.js",
"import": "./lib/index.js",
"types": "./lib/index.d.ts"
},
"./dist/*.js": {
"require": "./dist/*.js",
"import": "./lib/*.js",
"types": "./lib/*.d.ts"
}
},
"scripts": {

"module": "lib/index.js",
"typings": "lib/index.d.ts",
"scripts": {
"build:ts": "tsc -b",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To improve ESM support you need to change this to:

Suggested change
"build:ts": "tsc -b",
"build:ts": "tsc -b tsconfig.build.json && tsc-alias -p tsconfig.build.json",

And add a tsconfig.build.json that looks like:

{
  "extends": "../../tsconfig.build.json",
  "compilerOptions": {
    "outDir": "./lib"
  },
  "files": [],
  "references": [
    {
      "path": "./src"
    }
  ],
  "tsc-alias": {
    "resolveFullPaths": true,
    "verbose": true,
  }
}

}}
>
<AddButton
className='array-item-add'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add id={buttonId<T>(idSchema, 'add')} to match the changes made in other themes in v6

{canExpand<T, S, F>(schema, uiSchema, formData) && (
<div style={{ marginTop: '1rem', textAlign: 'right' }}>
<AddButton
icon='pi pi-plus'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add id={buttonId<T>(idSchema, 'add')} to match the changes made in other themes in v6

</div>
<div style={{ flex: 1 }}>{children}</div>
<div>
<RemoveButton disabled={disabled || readonly} onClick={onDropPropertyClick(label)} registry={registry} />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add id={buttonId<T>(idSchema, 'remove')} to match the changes made in other themes in v6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants