Skip to content

Commit 0ff0afa

Browse files
authored
Merge changes in main to rjsf-v6 (#4164)
Co-authored-by: Heath C <[email protected]> Co-authored-by: Abdallah Al-Soqatri <[email protected]> Co-authored-by: Kevin Burnett <[email protected]> Co-authored-by: Marek Bodinger <[email protected]> Co-authored-by: Mehdi Salem <[email protected]> Co-authored-by: Jonasz Wiącek <[email protected]> Co-authored-by: Bogdan Savluk <[email protected]> Co-authored-by: Christian Wendt <[email protected]> Co-authored-by: Ben Lambert <[email protected]> Co-authored-by: David R. Bild <[email protected]> Co-authored-by: Ariqun <[email protected]> Co-authored-by: Shivam Anand Murmu <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Shubham Biswas <[email protected]> Co-authored-by: popmanhe <[email protected]> Co-authored-by: Yuki Aoki <[email protected]> Co-authored-by: Xiangcheng Kuo <[email protected]> Co-authored-by: Bart van Andel <[email protected]> Co-authored-by: Laurent Direr <[email protected]> Co-authored-by: Vegard Stenvik <[email protected]> Co-authored-by: Appie <[email protected]> Co-authored-by: Oren Forer <[email protected]> Co-authored-by: Marcus Penn <[email protected]> Co-authored-by: joachimhagheim <[email protected]> Co-authored-by: MarekBodingerBA <[email protected]> Co-authored-by: momesana <[email protected]> Co-authored-by: Martti Roitto <[email protected]> fix(utils): direct lodash function import to improve bundling on library client side (#3976) fix: #3961 resolve all recurse list for object properties (#3981) fix gap in outline when label is hidden (#3984) Fix: Expose the internal `ajv` variable in the validator implementation classes (#3991) Fixes: #3972 indirectly by exposing the `ajv` variable for use in the issue Fix: Change FormHelperText usage with @mui/material to render divs (#4032) Fixes #4031 by switching the render component for `FormHelperText` to be `div` fix: Added support for anyOf/oneOf in uiSchema (#4055) Fixes #4039 by updating `MultiSchemaField` to properly support `anyOf`/`oneOf` arrays in the `uiSchema` Fix checkbox with 0 as a value was unselectable in antd (#4068) Fixed #4067 by properly dealing with enums that have 0 as a value Fix potential XSS in the preview button of FileWidget (#4065) Fix: Make 'ui:rows' option work with chakra-ui for textarea elements #4070 (#4078) Fix typo in ErrorsListTemplate example (#4087) Fix #4080 by moving `base64` encoder/decoder from `@rjsf/utils` to playground (#4093) Fix: Error state not resetting when schema changes (#4079) (#4103) Fix noImplicitAny error (#4106) Fixes: [WARNING] Duplicate key "include" in object literal [duplicate-object-key] (#4114) Fixes: Warning: validateDOMNesting(...): <p> cannot appear as a descendant of <p>. (#4117) Fix documentation to add missing Form imports (#4131) Fix #4127 to add missing `Form` import in documentation Fix: filename should be bold (#4125) Fix: use correct ConfigProvider context by using named imports (#4132) Fix 4134 by filtering out bad DOM props (#4140) Fixes: #4134 by updating the spreading of props onto the `TextField` to remove bad DOM fields Fixed Programmatic submit not working properly in Firefox (#4150) Fix Maximum call stack size exceeded in findSchemaDefinition (#4123)
1 parent 152a8f6 commit 0ff0afa

File tree

106 files changed

+10393
-19151
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+10393
-19151
lines changed

.github/workflows/ci.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,12 @@ jobs:
5252
NODE_OPTIONS: --max_old_space_size=4096
5353

5454
- if: matrix.node-version == '18.x'
55-
uses: actions/upload-artifact@v3
55+
uses: actions/upload-artifact@v4
5656
with:
5757
name: playground
5858
path: packages/playground/dist
5959
- if: matrix.node-version == '18.x'
60-
uses: actions/upload-artifact@v3
60+
uses: actions/upload-artifact@v4
6161
with:
6262
name: docs
6363
path: packages/docs/build
@@ -69,12 +69,12 @@ jobs:
6969
needs: [build]
7070
steps:
7171
- name: Download built playground
72-
uses: actions/download-artifact@v3
72+
uses: actions/download-artifact@v4
7373
with:
7474
name: playground
7575
path: dist
7676
- name: Download built docs
77-
uses: actions/download-artifact@v3
77+
uses: actions/download-artifact@v4
7878
with:
7979
name: docs
8080
path: dist/docs

.github/workflows/release-docs.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
with:
2929
ref: main
3030
- name: Setup Python
31-
uses: actions/setup-python@v3
31+
uses: actions/setup-python@v5
3232
with:
3333
python-version: '3.10'
3434
- run: pip install -r requirements.docs.txt

CHANGELOG.md

+245-97
Large diffs are not rendered by default.

lerna.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"packages": ["packages/*"],
3-
"version": "5.15.0",
3+
"version": "5.18.2",
44
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
55
"useNx": true,
66
"useWorkspaces": true

package-lock.json

+4,565-4,212
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+14-14
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"changed": "lerna changed",
1111
"test": "lerna run --concurrency 2 --stream test",
1212
"test:update": "lerna run --concurrency 2 --stream test:update",
13-
"lint": "eslint './packages/**/*.{ts,js,tsx,jsx}' --quiet",
13+
"lint": "eslint './packages/**/*.{ts,tsx}' --quiet",
1414
"cs-check": "lerna run cs-check",
1515
"cs-format": "lerna run cs-format",
1616
"build": "lerna run --stream build",
@@ -20,7 +20,7 @@
2020
"prepare": "husky install",
2121
"format": "prettier --write .",
2222
"format-check": "prettier --check .",
23-
"bump-all-packages": "echo 'NOTE: Make sure to sanity check the playground locally before commiting changes' && npm update --save && npm install && npm run build && npm run test && npm run lint",
23+
"bump-all-packages": "echo 'NOTE: Make sure to sanity check the playground locally before commiting changes' && npm update --save && npm install && npm run lint && npm run build && npm run test",
2424
"bump-peer-deps": "node scripts/bump-peer-deps.js",
2525
"refresh-node-modules": "rimraf packages/*/node_modules && rimraf node_modules && npm install",
2626
"commit-package-changes": "git add package-lock.json packages/*/package*.json && cross-env CI=skipPrecommit git commit -m 'updated package*.json after versioning' && git push",
@@ -30,32 +30,32 @@
3030
"license": "Apache-2.0",
3131
"homepage": "https://github.com/rjsf-team/react-jsonschema-form",
3232
"devDependencies": {
33-
"@babel/eslint-parser": "^7.22.15",
33+
"@babel/eslint-parser": "^7.23.10",
3434
"@nrwl/nx-cloud": "^15.3.5",
35-
"@types/estree": "^1.0.1",
36-
"@types/jest": "^29.5.5",
37-
"@types/node": "^18.17.14",
35+
"@types/estree": "^1.0.5",
36+
"@types/jest": "^29.5.12",
37+
"@types/node": "^18.19.14",
3838
"@types/prettier": "^2.7.3",
39-
"@types/react": "^17.0.65",
40-
"@types/react-dom": "^17.0.20",
39+
"@types/react": "^17.0.75",
40+
"@types/react-dom": "^17.0.25",
4141
"@typescript-eslint/eslint-plugin": "^5.62.0",
4242
"@typescript-eslint/parser": "^5.62.0",
4343
"cross-env": "^7.0.3",
44-
"eslint": "^8.48.0",
44+
"eslint": "^8.56.0",
4545
"eslint-config-prettier": "^8.10.0",
46-
"eslint-plugin-import": "^2.28.1",
47-
"eslint-plugin-jsx-a11y": "^6.7.1",
46+
"eslint-plugin-import": "^2.29.1",
47+
"eslint-plugin-jsx-a11y": "^6.8.0",
4848
"eslint-plugin-prettier": "^4.2.1",
4949
"eslint-plugin-react": "^7.33.2",
5050
"eslint-plugin-react-hooks": "^4.6.0",
5151
"husky": "^8.0.3",
52-
"jest-environment-jsdom": "^29.6.4",
52+
"jest-environment-jsdom": "^29.7.0",
5353
"lerna": "^6.6.2",
5454
"lint-staged": "^13.3.0",
5555
"nx": "^15.9.2",
5656
"prettier": "^2.8.8",
57-
"rimraf": "^5.0.1",
58-
"ts-jest": "^29.1.1",
57+
"rimraf": "^5.0.5",
58+
"ts-jest": "^29.1.2",
5959
"tslib": "^2.6.2",
6060
"typescript": "^4.9.5"
6161
},

packages/antd/package.json

+27-27
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@rjsf/antd",
3-
"version": "5.15.0",
3+
"version": "5.18.2",
44
"description": "Ant Design theme, fields and widgets for react-jsonschema-form",
55
"main": "dist/index.js",
66
"module": "lib/index.js",
@@ -34,51 +34,51 @@
3434
},
3535
"peerDependencies": {
3636
"@ant-design/icons": "^4.0.0 || ^5.0.0",
37-
"@rjsf/core": "^5.12.x",
38-
"@rjsf/utils": "^5.12.x",
37+
"@rjsf/core": "^5.18.x",
38+
"@rjsf/utils": "^5.18.x",
3939
"antd": "^4.24.0 || ^5.8.5",
4040
"dayjs": "^1.8.0",
4141
"react": "^16.14.0 || >=17"
4242
},
4343
"dependencies": {
44-
"classnames": "^2.3.2",
44+
"classnames": "^2.5.1",
4545
"lodash": "^4.17.21",
4646
"lodash-es": "^4.17.21",
4747
"rc-picker": "^2.7.6"
4848
},
4949
"devDependencies": {
5050
"@ant-design/icons": "^4.8.1",
51-
"@babel/cli": "^7.22.15",
52-
"@babel/core": "^7.22.17",
53-
"@babel/eslint-parser": "^7.22.15",
51+
"@babel/cli": "^7.23.9",
52+
"@babel/core": "^7.23.9",
53+
"@babel/eslint-parser": "^7.23.10",
5454
"@babel/plugin-proposal-class-properties": "^7.18.6",
5555
"@babel/plugin-proposal-optional-chaining": "^7.21.0",
56-
"@babel/preset-env": "^7.22.15",
57-
"@babel/preset-react": "^7.22.15",
58-
"@babel/preset-typescript": "^7.22.15",
59-
"@rjsf/core": "^5.15.0",
60-
"@rjsf/snapshot-tests": "^5.15.0",
61-
"@rjsf/utils": "^5.15.0",
62-
"@rjsf/validator-ajv8": "^5.15.0",
63-
"@rollup/plugin-replace": "^5.0.2",
64-
"@types/jest": "^29.5.5",
65-
"@types/lodash": "^4.14.198",
66-
"@types/react": "^17.0.65",
67-
"@types/react-dom": "^17.0.20",
68-
"@types/react-test-renderer": "^17.0.3",
56+
"@babel/preset-env": "^7.23.9",
57+
"@babel/preset-react": "^7.23.3",
58+
"@babel/preset-typescript": "^7.23.3",
59+
"@rjsf/core": "^5.18.2",
60+
"@rjsf/snapshot-tests": "^5.18.2",
61+
"@rjsf/utils": "^5.18.2",
62+
"@rjsf/validator-ajv8": "^5.18.2",
63+
"@rollup/plugin-replace": "^5.0.5",
64+
"@types/jest": "^29.5.12",
65+
"@types/lodash": "^4.14.202",
66+
"@types/react": "^17.0.75",
67+
"@types/react-dom": "^17.0.25",
68+
"@types/react-test-renderer": "^17.0.9",
6969
"antd": "^5.0.0",
7070
"atob": "^2.1.2",
71-
"babel-jest": "^29.6.4",
72-
"dayjs": "^1.11.9",
71+
"babel-jest": "^29.7.0",
72+
"dayjs": "^1.11.10",
7373
"esbuild": "^0.18.20",
74-
"eslint": "^8.48.0",
75-
"jest": "^29.6.4",
76-
"jest-environment-jsdom": "^29.6.4",
74+
"eslint": "^8.56.0",
75+
"jest": "^29.7.0",
76+
"jest-environment-jsdom": "^29.7.0",
7777
"react": "^17.0.2",
7878
"react-dom": "^17.0.2",
7979
"react-test-renderer": "^17.0.2",
80-
"rimraf": "^5.0.1",
81-
"rollup": "^3.29.0",
80+
"rimraf": "^5.0.5",
81+
"rollup": "^3.29.4",
8282
"typescript": "^4.9.5"
8383
},
8484
"repository": {

packages/antd/src/templates/ArrayFieldItemTemplate/index.tsx

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
import Button from 'antd/lib/button';
2-
import Col from 'antd/lib/col';
3-
import Row from 'antd/lib/row';
1+
import { Button, Col, Row } from 'antd';
42
import { ArrayFieldTemplateItemType, FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
53

64
const BTN_GRP_STYLE = {

packages/antd/src/templates/ArrayFieldTemplate/index.tsx

+57-64
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@ import {
99
StrictRJSFSchema,
1010
} from '@rjsf/utils';
1111
import classNames from 'classnames';
12-
import Col from 'antd/lib/col';
13-
import Row from 'antd/lib/row';
14-
import { ConfigConsumer, ConfigConsumerProps } from 'antd/lib/config-provider/context';
12+
import { Col, Row, ConfigProvider } from 'antd';
13+
import { useContext } from 'react';
1514

1615
const DESCRIPTION_COL_STYLE = {
1716
paddingBottom: '8px',
@@ -63,70 +62,64 @@ export default function ArrayFieldTemplate<
6362
} = registry.templates;
6463
const { labelAlign = 'right', rowGutter = 24 } = formContext as GenericObjectType;
6564

65+
const { getPrefixCls } = useContext(ConfigProvider.ConfigContext);
66+
const prefixCls = getPrefixCls('form');
67+
const labelClsBasic = `${prefixCls}-item-label`;
68+
const labelColClassName = classNames(
69+
labelClsBasic,
70+
labelAlign === 'left' && `${labelClsBasic}-left`
71+
// labelCol.className,
72+
);
73+
6674
return (
67-
<ConfigConsumer>
68-
{(configProps: ConfigConsumerProps) => {
69-
const { getPrefixCls } = configProps;
70-
const prefixCls = getPrefixCls('form');
71-
const labelClsBasic = `${prefixCls}-item-label`;
72-
const labelColClassName = classNames(
73-
labelClsBasic,
74-
labelAlign === 'left' && `${labelClsBasic}-left`
75-
// labelCol.className,
76-
);
75+
<fieldset className={className} id={idSchema.$id}>
76+
<Row gutter={rowGutter}>
77+
{(uiOptions.title || title) && (
78+
<Col className={labelColClassName} span={24}>
79+
<ArrayFieldTitleTemplate
80+
idSchema={idSchema}
81+
required={required}
82+
title={uiOptions.title || title}
83+
schema={schema}
84+
uiSchema={uiSchema}
85+
registry={registry}
86+
/>
87+
</Col>
88+
)}
89+
{(uiOptions.description || schema.description) && (
90+
<Col span={24} style={DESCRIPTION_COL_STYLE}>
91+
<ArrayFieldDescriptionTemplate
92+
description={uiOptions.description || schema.description}
93+
idSchema={idSchema}
94+
schema={schema}
95+
uiSchema={uiSchema}
96+
registry={registry}
97+
/>
98+
</Col>
99+
)}
100+
<Col className='row array-item-list' span={24}>
101+
{items &&
102+
items.map(({ key, ...itemProps }: ArrayFieldTemplateItemType<T, S, F>) => (
103+
<ArrayFieldItemTemplate key={key} {...itemProps} />
104+
))}
105+
</Col>
77106

78-
return (
79-
<fieldset className={className} id={idSchema.$id}>
80-
<Row gutter={rowGutter}>
81-
{(uiOptions.title || title) && (
82-
<Col className={labelColClassName} span={24}>
83-
<ArrayFieldTitleTemplate
84-
idSchema={idSchema}
85-
required={required}
86-
title={uiOptions.title || title}
87-
schema={schema}
88-
uiSchema={uiSchema}
89-
registry={registry}
90-
/>
91-
</Col>
92-
)}
93-
{(uiOptions.description || schema.description) && (
94-
<Col span={24} style={DESCRIPTION_COL_STYLE}>
95-
<ArrayFieldDescriptionTemplate
96-
description={uiOptions.description || schema.description}
97-
idSchema={idSchema}
98-
schema={schema}
99-
uiSchema={uiSchema}
100-
registry={registry}
101-
/>
102-
</Col>
103-
)}
104-
<Col className='row array-item-list' span={24}>
105-
{items &&
106-
items.map(({ key, ...itemProps }: ArrayFieldTemplateItemType<T, S, F>) => (
107-
<ArrayFieldItemTemplate key={key} {...itemProps} />
108-
))}
107+
{canAdd && (
108+
<Col span={24}>
109+
<Row gutter={rowGutter} justify='end'>
110+
<Col flex='192px'>
111+
<AddButton
112+
className='array-item-add'
113+
disabled={disabled || readonly}
114+
onClick={onAddClick}
115+
uiSchema={uiSchema}
116+
registry={registry}
117+
/>
109118
</Col>
110-
111-
{canAdd && (
112-
<Col span={24}>
113-
<Row gutter={rowGutter} justify='end'>
114-
<Col flex='192px'>
115-
<AddButton
116-
className='array-item-add'
117-
disabled={disabled || readonly}
118-
onClick={onAddClick}
119-
uiSchema={uiSchema}
120-
registry={registry}
121-
/>
122-
</Col>
123-
</Row>
124-
</Col>
125-
)}
126119
</Row>
127-
</fieldset>
128-
);
129-
}}
130-
</ConfigConsumer>
120+
</Col>
121+
)}
122+
</Row>
123+
</fieldset>
131124
);
132125
}

packages/antd/src/templates/BaseInputTemplate/index.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { ChangeEvent, FocusEvent } from 'react';
2-
import Input from 'antd/lib/input';
3-
import InputNumber from 'antd/lib/input-number';
2+
import { Input, InputNumber } from 'antd';
43
import {
54
ariaDescribedByIds,
65
BaseInputTemplateProps,

packages/antd/src/templates/ErrorList/index.tsx

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
import Alert from 'antd/lib/alert';
2-
import List from 'antd/lib/list';
3-
import Space from 'antd/lib/space';
1+
import { Alert, List, Space } from 'antd';
42
import ExclamationCircleOutlined from '@ant-design/icons/ExclamationCircleOutlined';
53
import { ErrorListProps, FormContextType, RJSFSchema, StrictRJSFSchema, TranslatableString } from '@rjsf/utils';
64

packages/antd/src/templates/FieldTemplate/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import Form from 'antd/lib/form';
1+
import { Form } from 'antd';
22
import {
33
FieldTemplateProps,
44
FormContextType,

packages/antd/src/templates/IconButton/index.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import Button, { ButtonProps, ButtonType } from 'antd/lib/button';
1+
import { Button, ButtonProps } from 'antd';
22
import ArrowDownOutlined from '@ant-design/icons/ArrowDownOutlined';
33
import ArrowUpOutlined from '@ant-design/icons/ArrowUpOutlined';
44
import CopyOutlined from '@ant-design/icons/CopyOutlined';
@@ -28,7 +28,7 @@ export default function IconButton<T = any, S extends StrictRJSFSchema = RJSFSch
2828
return (
2929
<Button
3030
onClick={onClick as MouseEventHandler<HTMLAnchorElement> & MouseEventHandler<HTMLButtonElement>}
31-
type={iconType as ButtonType}
31+
type={iconType as ButtonProps['type']}
3232
icon={icon}
3333
{...otherProps}
3434
/>

0 commit comments

Comments
 (0)