@rjsf/antd 6.0.0 → 6.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rjsf/antd",
3
- "version": "6.0.0",
3
+ "version": "6.0.2",
4
4
  "description": "Ant Design theme, fields and widgets for react-jsonschema-form",
5
5
  "main": "dist/index.js",
6
6
  "module": "lib/index.js",
@@ -63,8 +63,8 @@
63
63
  },
64
64
  "peerDependencies": {
65
65
  "@ant-design/icons": "^6.0.0",
66
- "@rjsf/core": "^6.0.0-beta.23",
67
- "@rjsf/utils": "^6.0.0-beta.23",
66
+ "@rjsf/core": "^6.x",
67
+ "@rjsf/utils": "^6.x",
68
68
  "antd": "^5.8.5",
69
69
  "dayjs": "^1.8.0",
70
70
  "react": ">=18"
@@ -77,10 +77,10 @@
77
77
  },
78
78
  "devDependencies": {
79
79
  "@ant-design/icons": "^6.1.0",
80
- "@rjsf/core": "^6.0.0-beta.23",
81
- "@rjsf/snapshot-tests": "^6.0.0-beta.23",
82
- "@rjsf/utils": "^6.0.0-beta.23",
83
- "@rjsf/validator-ajv8": "^6.0.0-beta.23",
80
+ "@rjsf/core": "^6.x",
81
+ "@rjsf/snapshot-tests": "^6.x",
82
+ "@rjsf/utils": "^6.x",
83
+ "@rjsf/validator-ajv8": "^6.x",
84
84
  "@rollup/plugin-replace": "^6.0.3",
85
85
  "antd": "^5.27.6",
86
86
  "atob": "^2.1.2",
@@ -12,10 +12,6 @@ import classNames from 'classnames';
12
12
  import { Col, Row, ConfigProvider } from 'antd';
13
13
  import { useContext } from 'react';
14
14
 
15
- const DESCRIPTION_COL_STYLE = {
16
- paddingBottom: '8px',
17
- };
18
-
19
15
  /** The `ArrayFieldTemplate` component is the template used to render all items in an array.
20
16
  *
21
17
  * @param props - The `ArrayFieldTemplateProps` props for the component
@@ -41,11 +37,6 @@ export default function ArrayFieldTemplate<
41
37
  uiSchema,
42
38
  } = props;
43
39
  const uiOptions = getUiOptions<T, S, F>(uiSchema);
44
- const ArrayFieldDescriptionTemplate = getTemplate<'ArrayFieldDescriptionTemplate', T, S, F>(
45
- 'ArrayFieldDescriptionTemplate',
46
- registry,
47
- uiOptions,
48
- );
49
40
  const ArrayFieldTitleTemplate = getTemplate<'ArrayFieldTitleTemplate', T, S, F>(
50
41
  'ArrayFieldTitleTemplate',
51
42
  registry,
@@ -84,17 +75,6 @@ export default function ArrayFieldTemplate<
84
75
  />
85
76
  </Col>
86
77
  )}
87
- {(uiOptions.description || schema.description) && (
88
- <Col span={24} style={DESCRIPTION_COL_STYLE}>
89
- <ArrayFieldDescriptionTemplate
90
- description={uiOptions.description || schema.description}
91
- fieldPathId={fieldPathId}
92
- schema={schema}
93
- uiSchema={uiSchema}
94
- registry={registry}
95
- />
96
- </Col>
97
- )}
98
78
  <Col className='row array-item-list' span={24}>
99
79
  {!showOptionalDataControlInTitle ? optionalDataControl : undefined}
100
80
  {items}
@@ -56,6 +56,7 @@ export default function FieldTemplate<
56
56
  } = formContext as GenericObjectType;
57
57
 
58
58
  const uiOptions = getUiOptions<T, S, F>(uiSchema);
59
+
59
60
  const WrapIfAdditionalTemplate = getTemplate<'WrapIfAdditionalTemplate', T, S, F>(
60
61
  'WrapIfAdditionalTemplate',
61
62
  registry,
@@ -79,7 +80,7 @@ export default function FieldTemplate<
79
80
  descriptionProps.extra = descriptionNode;
80
81
  break;
81
82
  }
82
-
83
+ const isCheckbox = uiOptions.widget === 'checkbox';
83
84
  return (
84
85
  <WrapIfAdditionalTemplate
85
86
  classNames={classNames}
@@ -101,7 +102,7 @@ export default function FieldTemplate<
101
102
  hasFeedback={schema.type !== 'array' && schema.type !== 'object'}
102
103
  help={(!!rawHelp && help) || (rawErrors?.length ? errors : undefined)}
103
104
  htmlFor={id}
104
- label={displayLabel && label}
105
+ label={displayLabel && !isCheckbox && label}
105
106
  labelCol={labelCol}
106
107
  required={required}
107
108
  style={wrapperStyle}
@@ -11,7 +11,6 @@ import {
11
11
  StrictRJSFSchema,
12
12
  UiSchema,
13
13
  canExpand,
14
- descriptionId,
15
14
  getTemplate,
16
15
  getUiOptions,
17
16
  titleId,
@@ -20,10 +19,6 @@ import {
20
19
  import { Col, Row, ConfigProvider } from 'antd';
21
20
  import { useContext } from 'react';
22
21
 
23
- const DESCRIPTION_COL_STYLE = {
24
- paddingBottom: '8px',
25
- };
26
-
27
22
  /** The `ObjectFieldTemplate` is the template to use to render all the inner properties of an object along with the
28
23
  * title and description if available. If the object is expandable, then an `AddButton` is also rendered after all
29
24
  * the properties.
@@ -36,7 +31,6 @@ export default function ObjectFieldTemplate<
36
31
  F extends FormContextType = any,
37
32
  >(props: ObjectFieldTemplateProps<T, S, F>) {
38
33
  const {
39
- description,
40
34
  disabled,
41
35
  formData,
42
36
  fieldPathId,
@@ -52,11 +46,6 @@ export default function ObjectFieldTemplate<
52
46
  } = props;
53
47
  const uiOptions = getUiOptions<T, S, F>(uiSchema);
54
48
  const TitleFieldTemplate = getTemplate<'TitleFieldTemplate', T, S, F>('TitleFieldTemplate', registry, uiOptions);
55
- const DescriptionFieldTemplate = getTemplate<'DescriptionFieldTemplate', T, S, F>(
56
- 'DescriptionFieldTemplate',
57
- registry,
58
- uiOptions,
59
- );
60
49
  const { formContext } = registry;
61
50
  const showOptionalDataControlInTitle = !readonly && !disabled;
62
51
  // Button templates are not overridden in the uiSchema
@@ -132,17 +121,6 @@ export default function ObjectFieldTemplate<
132
121
  />
133
122
  </Col>
134
123
  )}
135
- {description && (
136
- <Col span={24} style={DESCRIPTION_COL_STYLE}>
137
- <DescriptionFieldTemplate
138
- id={descriptionId(fieldPathId)}
139
- description={description}
140
- schema={schema}
141
- uiSchema={uiSchema}
142
- registry={registry}
143
- />
144
- </Col>
145
- )}
146
124
  {!showOptionalDataControlInTitle ? <Col span={24}>{optionalDataControl}</Col> : undefined}
147
125
  {properties
148
126
  .filter((e) => !e.hidden)