Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"comma-dangle": [
0
],
"@typescript-eslint/no-require-imports": "off",
"@typescript-eslint/no-unused-vars": [
2,
{
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG_v6.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ should change the heading of the (upcoming) version to include a major version b
- Implemented the `GridTemplate` component, adding it to the `templates` for the theme
- Implemented the new `LayoutGridField`, `LayoutMultiSchemaField` and `LayoutHeaderField` fields, adding them to the `fields` list

## @rjsf/daisyui

- Added new theme!

## @rjsf/fluent-ui

- BREAKING CHANGE: Deleted this theme in favor of `fluentui-rc`
Expand All @@ -64,6 +68,10 @@ should change the heading of the (upcoming) version to include a major version b
- Updated the `ArrayFieldTemplate`, `ObjectFieldTemplate`, and `WrapIfAdditionalTemplate` to a unique id using the `buttonId()` function and adding consistent marker classes
- Implemented the `GridTemplate` component, adding it to the `templates` for the theme

## @rjsf/shadcn

- Added new theme!

## @rjsf/utils

- BREAKING CHANGE: Refactored the `ArrayFieldItemTemplateType` to extract out all the button related props to `ArrayFieldItemButtonsTemplateType`, adding `buttonsProps: ArrayFieldItemButtonsTemplateType` as a new prop
Expand Down
8,071 changes: 2,497 additions & 5,574 deletions package-lock.json

Large diffs are not rendered by default.

59 changes: 26 additions & 33 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,40 +29,40 @@
"license": "Apache-2.0",
"homepage": "https://github.com/rjsf-team/react-jsonschema-form",
"devDependencies": {
"@babel/eslint-parser": "^7.23.10",
"@babel/eslint-parser": "7.27.0",
"@babel/plugin-transform-class-static-block": "^7.26.0",
"@nx/js": "^20.7.1",
"@swc-node/register": "^1.9.1",
"@swc/core": "^1.5.7",
"@swc/helpers": "^0.5.11",
"@nx/js": "20.8.0",
"@swc-node/register": "1.10.10",
"@swc/core": "1.11.21",
"@swc/helpers": "0.5.17",
"@testing-library/jest-dom": "^6.4.2",
"@testing-library/react": "^14.2.1",
"@types/estree": "^1.0.5",
"@types/jest": "^29.5.12",
"@types/node": "^20.11.20",
"@types/prettier": "^2.7.3",
"@types/estree": "1.0.7",
"@types/jest": "29.5.14",
"@types/node": "22.14.1",
"@types/prettier": "3.0.0",
"@types/react": "^18.2.58",
"@types/react-dom": "^18.2.19",
"@typescript-eslint/eslint-plugin": "^5.62.0",
"@typescript-eslint/parser": "^5.62.0",
"@typescript-eslint/eslint-plugin": "8.30.1",
"@typescript-eslint/parser": "8.30.1",
"cross-env": "^7.0.3",
"esbuild": "^0.18.20",
"esbuild": "0.25.2",
"eslint": "^8.56.0",
"eslint-config-prettier": "^8.10.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-jsx-a11y": "^6.8.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
"husky": "^8.0.3",
"eslint-config-prettier": "10.1.2",
"eslint-plugin-import": "2.31.0",
"eslint-plugin-jsx-a11y": "6.10.2",
"eslint-plugin-prettier": "5.2.6",
"eslint-plugin-react": "7.37.5",
"eslint-plugin-react-hooks": "5.2.0",
"husky": "9.1.7",
"jest-environment-jsdom": "^29.7.0",
"lint-staged": "^13.3.0",
"lint-staged": "15.5.1",
"move-file-cli": "^3.0.0",
"nx": "20.7.1",
"prettier": "^2.8.8",
"rimraf": "^5.0.5",
"ts-jest": "^29.1.2",
"tsc-alias": "^1.8.11",
"nx": "20.8.0",
"prettier": "3.5.3",
"rimraf": "6.0.1",
"ts-jest": "29.3.2",
"tsc-alias": "1.8.13",
"tslib": "^2.6.2",
"tsx": "^4.19.3",
"typescript": "^4.9.5"
Expand All @@ -82,12 +82,5 @@
"packages/validator-ajv8",
"packages/snapshot-tests",
"packages/shadcn"
],
"dependencies": {
"@restart/hooks": "^0.6.2",
"@restart/ui": "^1.9.4",
"ajv": "^8.17.1",
"ajv-keywords": "^5.1.0",
"uncontrollable": "^9.0.0"
}
]
}
4 changes: 2 additions & 2 deletions packages/antd/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import Widgets, { generateWidgets } from './widgets';
export function generateTheme<
T = any,
S extends StrictRJSFSchema = RJSFSchema,
F extends FormContextType = any
F extends FormContextType = any,
>(): ThemeProps<T, S, F> {
return {
templates: generateTemplates<T, S, F>(),
Expand All @@ -21,7 +21,7 @@ const Theme = generateTheme();
export function generateForm<
T = any,
S extends StrictRJSFSchema = RJSFSchema,
F extends FormContextType = any
F extends FormContextType = any,
>(): ComponentType<FormProps<T, S, F>> {
return withTheme<T, S, F>(generateTheme<T, S, F>());
}
Expand Down
4 changes: 2 additions & 2 deletions packages/antd/src/templates/ArrayFieldItemTemplate/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ const BTN_STYLE = {
export default function ArrayFieldItemTemplate<
T = any,
S extends StrictRJSFSchema = RJSFSchema,
F extends FormContextType = any
F extends FormContextType = any,
>(props: ArrayFieldItemTemplateType<T, S, F>) {
const { children, buttonsProps, hasToolbar, index, registry, uiSchema } = props;
const uiOptions = getUiOptions<T, S, F>(uiSchema);
const ArrayFieldItemButtonsTemplate = getTemplate<'ArrayFieldItemButtonsTemplate', T, S, F>(
'ArrayFieldItemButtonsTemplate',
registry,
uiOptions
uiOptions,
);
const { rowGutter = 24, toolbarAlign = 'top' } = registry.formContext;

Expand Down
10 changes: 5 additions & 5 deletions packages/antd/src/templates/ArrayFieldTemplate/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const DESCRIPTION_COL_STYLE = {
export default function ArrayFieldTemplate<
T = any,
S extends StrictRJSFSchema = RJSFSchema,
F extends FormContextType = any
F extends FormContextType = any,
>(props: ArrayFieldTemplateProps<T, S, F>) {
const {
canAdd,
Expand All @@ -45,17 +45,17 @@ export default function ArrayFieldTemplate<
const ArrayFieldDescriptionTemplate = getTemplate<'ArrayFieldDescriptionTemplate', T, S, F>(
'ArrayFieldDescriptionTemplate',
registry,
uiOptions
uiOptions,
);
const ArrayFieldItemTemplate = getTemplate<'ArrayFieldItemTemplate', T, S, F>(
'ArrayFieldItemTemplate',
registry,
uiOptions
uiOptions,
);
const ArrayFieldTitleTemplate = getTemplate<'ArrayFieldTitleTemplate', T, S, F>(
'ArrayFieldTitleTemplate',
registry,
uiOptions
uiOptions,
);
// Button templates are not overridden in the uiSchema
const {
Expand All @@ -68,7 +68,7 @@ export default function ArrayFieldTemplate<
const labelClsBasic = `${prefixCls}-item-label`;
const labelColClassName = classNames(
labelClsBasic,
labelAlign === 'left' && `${labelClsBasic}-left`
labelAlign === 'left' && `${labelClsBasic}-left`,
// labelCol.className,
);

Expand Down
2 changes: 1 addition & 1 deletion packages/antd/src/templates/BaseInputTemplate/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const INPUT_STYLE = {
export default function BaseInputTemplate<
T = any,
S extends StrictRJSFSchema = RJSFSchema,
F extends FormContextType = any
F extends FormContextType = any,
>(props: BaseInputTemplateProps<T, S, F>) {
const {
disabled,
Expand Down
2 changes: 1 addition & 1 deletion packages/antd/src/templates/DescriptionField/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { DescriptionFieldProps, FormContextType, RJSFSchema, StrictRJSFSchema }
export default function DescriptionField<
T = any,
S extends StrictRJSFSchema = RJSFSchema,
F extends FormContextType = any
F extends FormContextType = any,
>(props: DescriptionFieldProps<T, S, F>) {
const { id, description } = props;
if (!description) {
Expand Down
2 changes: 1 addition & 1 deletion packages/antd/src/templates/FieldErrorTemplate/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { FieldErrorProps, FormContextType, RJSFSchema, StrictRJSFSchema, errorId
export default function FieldErrorTemplate<
T = any,
S extends StrictRJSFSchema = RJSFSchema,
F extends FormContextType = any
F extends FormContextType = any,
>(props: FieldErrorProps<T, S, F>) {
const { errors = [], idSchema } = props;
if (errors.length === 0) {
Expand Down
4 changes: 2 additions & 2 deletions packages/antd/src/templates/FieldTemplate/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const VERTICAL_WRAPPER_COL = { span: 24 };
export default function FieldTemplate<
T = any,
S extends StrictRJSFSchema = RJSFSchema,
F extends FormContextType = any
F extends FormContextType = any,
>(props: FieldTemplateProps<T, S, F>) {
const {
children,
Expand Down Expand Up @@ -58,7 +58,7 @@ export default function FieldTemplate<
const WrapIfAdditionalTemplate = getTemplate<'WrapIfAdditionalTemplate', T, S, F>(
'WrapIfAdditionalTemplate',
registry,
uiOptions
uiOptions,
);

if (hidden) {
Expand Down
14 changes: 7 additions & 7 deletions packages/antd/src/templates/IconButton/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ import { MouseEventHandler } from 'react';
export type AntdIconButtonProps<
T = any,
S extends StrictRJSFSchema = RJSFSchema,
F extends FormContextType = any
F extends FormContextType = any,
> = Omit<IconButtonProps<T, S, F>, 'type' | 'color'>;

export default function IconButton<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(
props: AntdIconButtonProps<T, S, F> & Omit<ButtonProps, 'onClick'>
props: AntdIconButtonProps<T, S, F> & Omit<ButtonProps, 'onClick'>,
) {
const { iconType = 'default', icon, onClick, uiSchema, registry, ...otherProps } = props;
return (
Expand All @@ -36,7 +36,7 @@ export default function IconButton<T = any, S extends StrictRJSFSchema = RJSFSch
}

export function AddButton<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(
props: AntdIconButtonProps<T, S, F>
props: AntdIconButtonProps<T, S, F>,
) {
const {
registry: { translateString },
Expand All @@ -53,7 +53,7 @@ export function AddButton<T = any, S extends StrictRJSFSchema = RJSFSchema, F ex
}

export function CopyButton<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(
props: AntdIconButtonProps<T, S, F>
props: AntdIconButtonProps<T, S, F>,
) {
const {
registry: { translateString },
Expand All @@ -62,7 +62,7 @@ export function CopyButton<T = any, S extends StrictRJSFSchema = RJSFSchema, F e
}

export function MoveDownButton<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(
props: AntdIconButtonProps<T, S, F>
props: AntdIconButtonProps<T, S, F>,
) {
const {
registry: { translateString },
Expand All @@ -73,7 +73,7 @@ export function MoveDownButton<T = any, S extends StrictRJSFSchema = RJSFSchema,
}

export function MoveUpButton<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(
props: AntdIconButtonProps<T, S, F>
props: AntdIconButtonProps<T, S, F>,
) {
const {
registry: { translateString },
Expand All @@ -82,7 +82,7 @@ export function MoveUpButton<T = any, S extends StrictRJSFSchema = RJSFSchema, F
}

export function RemoveButton<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(
props: AntdIconButtonProps<T, S, F>
props: AntdIconButtonProps<T, S, F>,
) {
// The `block` prop is not part of the `IconButtonProps` defined in the template, so get it from the uiSchema instead
const options = getUiOptions<T, S, F>(props.uiSchema);
Expand Down
6 changes: 3 additions & 3 deletions packages/antd/src/templates/ObjectFieldTemplate/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const DESCRIPTION_COL_STYLE = {
export default function ObjectFieldTemplate<
T = any,
S extends StrictRJSFSchema = RJSFSchema,
F extends FormContextType = any
F extends FormContextType = any,
>(props: ObjectFieldTemplateProps<T, S, F>) {
const {
description,
Expand All @@ -55,7 +55,7 @@ export default function ObjectFieldTemplate<
const DescriptionFieldTemplate = getTemplate<'DescriptionFieldTemplate', T, S, F>(
'DescriptionFieldTemplate',
registry,
uiOptions
uiOptions,
);
// Button templates are not overridden in the uiSchema
const {
Expand Down Expand Up @@ -110,7 +110,7 @@ export default function ObjectFieldTemplate<
const labelClsBasic = `${prefixCls}-item-label`;
const labelColClassName = classNames(
labelClsBasic,
labelAlign === 'left' && `${labelClsBasic}-left`
labelAlign === 'left' && `${labelClsBasic}-left`,
// labelCol.className,
);

Expand Down
2 changes: 1 addition & 1 deletion packages/antd/src/templates/SubmitButton/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ type ButtonType = NonNullable<ButtonProps['type']>;
export default function SubmitButton<
T = any,
S extends StrictRJSFSchema = RJSFSchema,
F extends FormContextType = any
F extends FormContextType = any,
>({ uiSchema }: SubmitButtonProps<T, S, F>) {
const { submitText, norender, props: submitButtonProps } = getSubmitButtonOptions(uiSchema);
if (norender) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const INPUT_STYLE = {
export default function WrapIfAdditionalTemplate<
T = any,
S extends StrictRJSFSchema = RJSFSchema,
F extends FormContextType = any
F extends FormContextType = any,
>(props: WrapIfAdditionalTemplateProps<T, S, F>) {
const {
children,
Expand Down
2 changes: 1 addition & 1 deletion packages/antd/src/templates/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import WrapIfAdditionalTemplate from './WrapIfAdditionalTemplate';
export function generateTemplates<
T = any,
S extends StrictRJSFSchema = RJSFSchema,
F extends FormContextType = any
F extends FormContextType = any,
>(): Partial<TemplatesType<T, S, F>> {
return {
ArrayFieldItemTemplate,
Expand Down
2 changes: 1 addition & 1 deletion packages/antd/src/widgets/AltDateTimeWidget/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import _AltDateWidget from '../AltDateWidget';
export default function AltDateTimeWidget<
T = any,
S extends StrictRJSFSchema = RJSFSchema,
F extends FormContextType = any
F extends FormContextType = any,
>(props: WidgetProps<T, S, F>) {
const { AltDateWidget } = props.registry.widgets;
return <AltDateWidget showTime {...props} />;
Expand Down
4 changes: 2 additions & 2 deletions packages/antd/src/widgets/AltDateWidget/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const readyForChange = (state: DateObject) => {
export default function AltDateWidget<
T = any,
S extends StrictRJSFSchema = RJSFSchema,
F extends FormContextType = any
F extends FormContextType = any,
>(props: WidgetProps<T, S, F>) {
const {
autofocus,
Expand Down Expand Up @@ -117,7 +117,7 @@ export default function AltDateWidget<
state,
showTime,
options.yearsRange as [number, number] | undefined,
options.format as DateElementFormat | undefined
options.format as DateElementFormat | undefined,
).map((elemProps, i) => {
const elemId = id + '_' + elemProps.type;
return (
Expand Down
2 changes: 1 addition & 1 deletion packages/antd/src/widgets/CheckboxWidget/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
export default function CheckboxWidget<
T = any,
S extends StrictRJSFSchema = RJSFSchema,
F extends FormContextType = any
F extends FormContextType = any,
>(props: WidgetProps<T, S, F>) {
const { autofocus, disabled, formContext, id, label, hideLabel, onBlur, onChange, onFocus, readonly, value } = props;
const { readonlyAsDisabled = true } = formContext as GenericObjectType;
Expand Down
2 changes: 1 addition & 1 deletion packages/antd/src/widgets/CheckboxesWidget/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {
export default function CheckboxesWidget<
T = any,
S extends StrictRJSFSchema = RJSFSchema,
F extends FormContextType = any
F extends FormContextType = any,
>({ autofocus, disabled, formContext, id, onBlur, onChange, onFocus, options, readonly, value }: WidgetProps<T, S, F>) {
const { readonlyAsDisabled = true } = formContext as GenericObjectType;

Expand Down
2 changes: 1 addition & 1 deletion packages/antd/src/widgets/DateTimeWidget/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const DATE_PICKER_STYLE = {
export default function DateTimeWidget<
T = any,
S extends StrictRJSFSchema = RJSFSchema,
F extends FormContextType = any
F extends FormContextType = any,
>(props: WidgetProps<T, S, F>) {
const { disabled, formContext, id, onBlur, onChange, onFocus, placeholder, readonly, value } = props;
const { readonlyAsDisabled = true } = formContext as GenericObjectType;
Expand Down
Loading