@rjsf/core 6.5.3 → 6.6.0
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/dist/core.umd.js +240 -279
- package/dist/index.cjs +330 -369
- package/dist/index.cjs.map +4 -4
- package/dist/index.esm.js +288 -328
- package/dist/index.esm.js.map +4 -4
- package/lib/components/Form.d.ts +3 -4
- package/lib/components/Form.d.ts.map +1 -1
- package/lib/components/Form.js +6 -25
- package/lib/components/RichDescription.js +1 -1
- package/lib/components/RichHelp.js +1 -1
- package/lib/components/fields/FallbackField.d.ts.map +1 -1
- package/lib/components/fields/FallbackField.js +1 -1
- package/lib/components/fields/LayoutGridField.js +1 -1
- package/lib/components/fields/MultiSchemaField.d.ts.map +1 -1
- package/lib/components/fields/MultiSchemaField.js +1 -1
- package/lib/components/fields/ObjectField.js +1 -1
- package/lib/components/fields/index.js +1 -1
- package/lib/components/templates/ButtonTemplates/index.js +1 -1
- package/lib/components/templates/FieldHelpTemplate.d.ts.map +1 -1
- package/lib/components/templates/UnsupportedField.js +1 -1
- package/lib/components/templates/index.js +2 -2
- package/lib/components/widgets/FileWidget.d.ts.map +1 -1
- package/lib/components/widgets/FileWidget.js +3 -2
- package/lib/components/widgets/index.js +4 -4
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/withTheme.d.ts +1 -1
- package/lib/withTheme.d.ts.map +1 -1
- package/package.json +17 -17
- package/src/components/Form.tsx +8 -52
- package/src/components/RichDescription.tsx +1 -1
- package/src/components/RichHelp.tsx +1 -1
- package/src/components/fields/FallbackField.tsx +1 -1
- package/src/components/fields/LayoutGridField.tsx +1 -1
- package/src/components/fields/MultiSchemaField.tsx +3 -3
- package/src/components/fields/ObjectField.tsx +1 -1
- package/src/components/fields/index.ts +1 -1
- package/src/components/templates/ButtonTemplates/index.ts +1 -1
- package/src/components/templates/FieldHelpTemplate.tsx +1 -0
- package/src/components/templates/UnsupportedField.tsx +1 -1
- package/src/components/templates/index.ts +2 -2
- package/src/components/widgets/FileWidget.tsx +3 -2
- package/src/components/widgets/index.ts +4 -4
- package/src/index.ts +1 -1
- package/src/tsconfig.json +0 -1
- package/src/withTheme.tsx +2 -1
package/lib/withTheme.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ComponentType } from 'react';
|
|
2
|
-
import { FormProps } from './components/Form.js';
|
|
3
2
|
import { FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
|
|
3
|
+
import { FormProps } from './components/Form.js';
|
|
4
4
|
/** The properties for the `withTheme` function, essentially a subset of properties from the `FormProps` that can be
|
|
5
5
|
* overridden while creating a theme
|
|
6
6
|
*/
|
package/lib/withTheme.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withTheme.d.ts","sourceRoot":"","sources":["../src/withTheme.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAA4B,MAAM,OAAO,CAAC;AAChE,
|
|
1
|
+
{"version":3,"file":"withTheme.d.ts","sourceRoot":"","sources":["../src/withTheme.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAA4B,MAAM,OAAO,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE5E,OAAa,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEpD;;GAEG;AACH,MAAM,MAAM,UAAU,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,SAAS,gBAAgB,GAAG,UAAU,EAAE,CAAC,SAAS,eAAe,GAAG,GAAG,IAAI,IAAI,CAC9G,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAClB,QAAQ,GAAG,WAAW,GAAG,SAAS,GAAG,sBAAsB,CAC5D,CAAC;AAEF,mHAAmH;AACnH,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,SAAS,gBAAgB,GAAG,UAAU,EAAE,CAAC,SAAS,eAAe,GAAG,GAAG,EACjH,UAAU,EAAE,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,GAC9B,aAAa,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CA2BnC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rjsf/core",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.6.0",
|
|
4
4
|
"description": "A simple React component capable of building HTML forms out of a JSON schema.",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"compileReplacer": "tsc -p tsconfig.replacer.json && move-file lodashReplacer.js lodashReplacer.cjs",
|
|
@@ -9,20 +9,21 @@
|
|
|
9
9
|
"build:esm": "esbuild ./src/index.ts --bundle --outfile=dist/index.esm.js --sourcemap --packages=external --format=esm",
|
|
10
10
|
"build:umd": "rollup dist/index.esm.js --format=umd --file=dist/core.umd.js --name=JSONSchemaForm",
|
|
11
11
|
"build": "npm run build:ts && npm run build:cjs && npm run build:esm && npm run build:umd",
|
|
12
|
-
"cs-check": "
|
|
13
|
-
"cs-format": "
|
|
14
|
-
"lint": "
|
|
12
|
+
"cs-check": "oxfmt --check \"{src,test}/**/*.{ts,tsx,js,jsx}\"",
|
|
13
|
+
"cs-format": "oxfmt \"{src,test}/**/*.{ts,tsx,js,jsx}\"",
|
|
14
|
+
"lint": "oxlint src test",
|
|
15
15
|
"precommit": "lint-staged",
|
|
16
16
|
"publish-to-npm": "npm run build && npm publish",
|
|
17
|
-
"test": "
|
|
17
|
+
"test": "vitest run",
|
|
18
18
|
"test:debug": "node --inspect-brk ../../node_modules/.bin/jest",
|
|
19
|
-
"test:update": "
|
|
20
|
-
"test:watch": "
|
|
21
|
-
"test-coverage": "
|
|
19
|
+
"test:update": "vitest run --update-snapshots",
|
|
20
|
+
"test:watch": "vitest",
|
|
21
|
+
"test-coverage": "vitest run --coverage"
|
|
22
22
|
},
|
|
23
23
|
"lint-staged": {
|
|
24
|
-
"{src,test}/**/*.
|
|
25
|
-
"
|
|
24
|
+
"{src,test}/**/*.{ts,tsx,js,jsx}": [
|
|
25
|
+
"oxlint --fix",
|
|
26
|
+
"oxfmt"
|
|
26
27
|
]
|
|
27
28
|
},
|
|
28
29
|
"main": "dist/index.js",
|
|
@@ -72,21 +73,20 @@
|
|
|
72
73
|
"dependencies": {
|
|
73
74
|
"lodash": "^4.18.1",
|
|
74
75
|
"lodash-es": "^4.18.1",
|
|
75
|
-
"markdown-to-jsx": "^8.
|
|
76
|
+
"markdown-to-jsx": "^9.8.1",
|
|
76
77
|
"prop-types": "^15.8.1"
|
|
77
78
|
},
|
|
78
79
|
"devDependencies": {
|
|
79
|
-
"@rjsf/snapshot-tests": "6.
|
|
80
|
-
"@rjsf/utils": "6.
|
|
81
|
-
"@rjsf/validator-ajv8": "6.
|
|
80
|
+
"@rjsf/snapshot-tests": "6.6.0",
|
|
81
|
+
"@rjsf/utils": "6.6.0",
|
|
82
|
+
"@rjsf/validator-ajv8": "6.6.0",
|
|
82
83
|
"@testing-library/jest-dom": "^6.9.1",
|
|
83
84
|
"@testing-library/react": "^16.3.2",
|
|
84
85
|
"@testing-library/user-event": "^14.6.1",
|
|
85
86
|
"@types/react-portal": "^4.0.7",
|
|
86
|
-
"ajv": "^8.
|
|
87
|
+
"ajv": "^8.20.0",
|
|
87
88
|
"atob": "^2.1.2",
|
|
88
|
-
"
|
|
89
|
-
"jsdom": "^27.0.1",
|
|
89
|
+
"jsdom": "^29.1.1",
|
|
90
90
|
"react-portal": "^4.3.0"
|
|
91
91
|
},
|
|
92
92
|
"directories": {
|
package/src/components/Form.tsx
CHANGED
|
@@ -21,7 +21,6 @@ import {
|
|
|
21
21
|
RegistryWidgetsType,
|
|
22
22
|
RJSFSchema,
|
|
23
23
|
RJSFValidationError,
|
|
24
|
-
removeOptionalEmptyObjects,
|
|
25
24
|
SchemaUtilsType,
|
|
26
25
|
shouldRender,
|
|
27
26
|
SUBMIT_BTN_OPTIONS_KEY,
|
|
@@ -210,10 +209,9 @@ export interface FormProps<T = any, S extends StrictRJSFSchema = RJSFSchema, F e
|
|
|
210
209
|
* called. Set to `false` by default.
|
|
211
210
|
*/
|
|
212
211
|
omitExtraData?: boolean;
|
|
213
|
-
/**
|
|
214
|
-
*
|
|
215
|
-
*
|
|
216
|
-
* required inner fields. This works independently of `omitExtraData`. Set to `false` by default.
|
|
212
|
+
/** This option no longer does anything as it has been co-opted into `omitExtraData`
|
|
213
|
+
*
|
|
214
|
+
* @deprecated - Will be removed in a future release use `omitExtraData` instead
|
|
217
215
|
*/
|
|
218
216
|
removeEmptyOptionalObjects?: boolean;
|
|
219
217
|
/** When this prop is set to `top` or 'bottom', a list of errors (or the custom error list defined in the `ErrorList`) will also
|
|
@@ -895,8 +893,7 @@ export default class Form<
|
|
|
895
893
|
this._isProcessingUserChange = true;
|
|
896
894
|
const { newValue, path, id } = this.pendingChanges[0];
|
|
897
895
|
const { newErrorSchema } = this.pendingChanges[0];
|
|
898
|
-
const { extraErrors, omitExtraData, liveOmit, noValidate, liveValidate, onChange
|
|
899
|
-
this.props;
|
|
896
|
+
const { extraErrors, omitExtraData, liveOmit, noValidate, liveValidate, onChange } = this.props;
|
|
900
897
|
const { formData: oldFormData, schemaUtils, schema, fieldPathId, schemaValidationErrorSchema, errors } = this.state;
|
|
901
898
|
let { customErrors } = this.state;
|
|
902
899
|
// Use the un-merged AJV-only schema as the base for re-merging extraErrors. Mirrors the
|
|
@@ -971,19 +968,6 @@ export default class Form<
|
|
|
971
968
|
};
|
|
972
969
|
}
|
|
973
970
|
|
|
974
|
-
if (removeEmptyOptionalObjects) {
|
|
975
|
-
newFormData = removeOptionalEmptyObjects(
|
|
976
|
-
schemaUtils.getValidator(),
|
|
977
|
-
schema,
|
|
978
|
-
schemaUtils.getRootSchema(),
|
|
979
|
-
newFormData,
|
|
980
|
-
) as T;
|
|
981
|
-
state = {
|
|
982
|
-
...state,
|
|
983
|
-
formData: newFormData,
|
|
984
|
-
};
|
|
985
|
-
}
|
|
986
|
-
|
|
987
971
|
if (newErrorSchema) {
|
|
988
972
|
// First check to see if there is an existing validation error on this path...
|
|
989
973
|
// @ts-expect-error TS2590, because getting from the error schema is confusing TS
|
|
@@ -1100,28 +1084,19 @@ export default class Form<
|
|
|
1100
1084
|
* @param data - The data associated with the field that was blurred
|
|
1101
1085
|
*/
|
|
1102
1086
|
onBlur = (id: string, data: any) => {
|
|
1103
|
-
const { onBlur, omitExtraData, liveOmit, liveValidate
|
|
1087
|
+
const { onBlur, omitExtraData, liveOmit, liveValidate } = this.props;
|
|
1104
1088
|
if (onBlur) {
|
|
1105
1089
|
onBlur(id, data);
|
|
1106
1090
|
}
|
|
1107
1091
|
if ((omitExtraData === true && liveOmit === 'onBlur') || liveValidate === 'onBlur') {
|
|
1108
1092
|
const { onChange, extraErrors } = this.props;
|
|
1109
|
-
const { formData
|
|
1093
|
+
const { formData } = this.state;
|
|
1110
1094
|
let newFormData: T | undefined = formData;
|
|
1111
1095
|
let state: Partial<FormState<T, S, F>> = { formData: newFormData };
|
|
1112
1096
|
if (omitExtraData === true && liveOmit === 'onBlur') {
|
|
1113
1097
|
newFormData = this.omitExtraData(formData);
|
|
1114
1098
|
state = { formData: newFormData };
|
|
1115
1099
|
}
|
|
1116
|
-
if (removeEmptyOptionalObjects) {
|
|
1117
|
-
newFormData = removeOptionalEmptyObjects(
|
|
1118
|
-
schemaUtils.getValidator(),
|
|
1119
|
-
schema,
|
|
1120
|
-
schemaUtils.getRootSchema(),
|
|
1121
|
-
newFormData,
|
|
1122
|
-
) as T;
|
|
1123
|
-
state = { ...state, formData: newFormData };
|
|
1124
|
-
}
|
|
1125
1100
|
if (liveValidate === 'onBlur') {
|
|
1126
1101
|
const { schema, schemaUtils, errorSchema, customErrors, retrievedSchema } = this.state;
|
|
1127
1102
|
const liveValidation = this.liveValidate(
|
|
@@ -1179,23 +1154,13 @@ export default class Form<
|
|
|
1179
1154
|
}
|
|
1180
1155
|
|
|
1181
1156
|
event.persist();
|
|
1182
|
-
const { omitExtraData, extraErrors, noValidate, onSubmit
|
|
1157
|
+
const { omitExtraData, extraErrors, noValidate, onSubmit } = this.props;
|
|
1183
1158
|
let { formData: newFormData } = this.state;
|
|
1184
1159
|
|
|
1185
1160
|
if (omitExtraData === true) {
|
|
1186
1161
|
newFormData = this.omitExtraData(newFormData);
|
|
1187
1162
|
}
|
|
1188
1163
|
|
|
1189
|
-
if (removeEmptyOptionalObjects) {
|
|
1190
|
-
const { schemaUtils, schema } = this.state;
|
|
1191
|
-
newFormData = removeOptionalEmptyObjects(
|
|
1192
|
-
schemaUtils.getValidator(),
|
|
1193
|
-
schema,
|
|
1194
|
-
schemaUtils.getRootSchema(),
|
|
1195
|
-
newFormData,
|
|
1196
|
-
) as T;
|
|
1197
|
-
}
|
|
1198
|
-
|
|
1199
1164
|
if (noValidate || this.validateFormWithFormData(newFormData)) {
|
|
1200
1165
|
// There are no errors generated through schema validation.
|
|
1201
1166
|
// Check for user provided errors and update state accordingly.
|
|
@@ -1379,20 +1344,11 @@ export default class Form<
|
|
|
1379
1344
|
* @returns - True if the form is valid, false otherwise.
|
|
1380
1345
|
*/
|
|
1381
1346
|
validateForm() {
|
|
1382
|
-
const { omitExtraData
|
|
1347
|
+
const { omitExtraData } = this.props;
|
|
1383
1348
|
let { formData: newFormData } = this.state;
|
|
1384
1349
|
if (omitExtraData === true) {
|
|
1385
1350
|
newFormData = this.omitExtraData(newFormData);
|
|
1386
1351
|
}
|
|
1387
|
-
if (removeEmptyOptionalObjects) {
|
|
1388
|
-
const { schemaUtils, schema } = this.state;
|
|
1389
|
-
newFormData = removeOptionalEmptyObjects(
|
|
1390
|
-
schemaUtils.getValidator(),
|
|
1391
|
-
schema,
|
|
1392
|
-
schemaUtils.getRootSchema(),
|
|
1393
|
-
newFormData,
|
|
1394
|
-
) as T;
|
|
1395
|
-
}
|
|
1396
1352
|
return this.validateFormWithFormData(newFormData);
|
|
1397
1353
|
}
|
|
1398
1354
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { useMemo, useState } from 'react';
|
|
1
2
|
import {
|
|
2
3
|
FallbackFieldProps,
|
|
3
4
|
FieldPathId,
|
|
@@ -11,7 +12,6 @@ import {
|
|
|
11
12
|
TranslatableString,
|
|
12
13
|
useDeepCompareMemo,
|
|
13
14
|
} from '@rjsf/utils';
|
|
14
|
-
import { useMemo, useState } from 'react';
|
|
15
15
|
import { JSONSchema7TypeName } from 'json-schema';
|
|
16
16
|
|
|
17
17
|
/**
|
|
@@ -32,8 +32,8 @@ import has from 'lodash/has';
|
|
|
32
32
|
import includes from 'lodash/includes';
|
|
33
33
|
import intersection from 'lodash/intersection';
|
|
34
34
|
import isEmpty from 'lodash/isEmpty';
|
|
35
|
-
import isFunction from 'lodash/isFunction';
|
|
36
35
|
import isEqual from 'lodash/isEqual';
|
|
36
|
+
import isFunction from 'lodash/isFunction';
|
|
37
37
|
import isObject from 'lodash/isObject';
|
|
38
38
|
import isPlainObject from 'lodash/isPlainObject';
|
|
39
39
|
import isString from 'lodash/isString';
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
import { Component } from 'react';
|
|
2
|
-
import get from 'lodash/get';
|
|
3
|
-
import isEmpty from 'lodash/isEmpty';
|
|
4
|
-
import omit from 'lodash/omit';
|
|
5
2
|
import {
|
|
6
3
|
ANY_OF_KEY,
|
|
7
4
|
deepEquals,
|
|
@@ -21,6 +18,9 @@ import {
|
|
|
21
18
|
TranslatableString,
|
|
22
19
|
UiSchema,
|
|
23
20
|
} from '@rjsf/utils';
|
|
21
|
+
import get from 'lodash/get';
|
|
22
|
+
import isEmpty from 'lodash/isEmpty';
|
|
23
|
+
import omit from 'lodash/omit';
|
|
24
24
|
|
|
25
25
|
/** Type used for the state of the `AnyOfField` component */
|
|
26
26
|
type AnyOfFieldState<S extends StrictRJSFSchema = RJSFSchema> = {
|
|
@@ -23,11 +23,11 @@ import {
|
|
|
23
23
|
StrictRJSFSchema,
|
|
24
24
|
TranslatableString,
|
|
25
25
|
} from '@rjsf/utils';
|
|
26
|
-
import Markdown from 'markdown-to-jsx';
|
|
27
26
|
import get from 'lodash/get';
|
|
28
27
|
import has from 'lodash/has';
|
|
29
28
|
import isObject from 'lodash/isObject';
|
|
30
29
|
import set from 'lodash/set';
|
|
30
|
+
import { Markdown } from 'markdown-to-jsx';
|
|
31
31
|
|
|
32
32
|
import { ADDITIONAL_PROPERTY_KEY_REMOVE } from '../constants';
|
|
33
33
|
|
|
@@ -7,12 +7,12 @@ import LayoutGridField from './LayoutGridField';
|
|
|
7
7
|
import LayoutHeaderField from './LayoutHeaderField';
|
|
8
8
|
import LayoutMultiSchemaField from './LayoutMultiSchemaField';
|
|
9
9
|
import MultiSchemaField from './MultiSchemaField';
|
|
10
|
+
import NullField from './NullField';
|
|
10
11
|
import NumberField from './NumberField';
|
|
11
12
|
import ObjectField from './ObjectField';
|
|
12
13
|
import OptionalDataControlsField from './OptionalDataControlsField';
|
|
13
14
|
import SchemaField from './SchemaField';
|
|
14
15
|
import StringField from './StringField';
|
|
15
|
-
import NullField from './NullField';
|
|
16
16
|
|
|
17
17
|
function fields<
|
|
18
18
|
T = any,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { FormContextType, RJSFSchema, StrictRJSFSchema, TemplatesType } from '@rjsf/utils';
|
|
2
2
|
|
|
3
|
-
import SubmitButton from './SubmitButton';
|
|
4
3
|
import AddButton from './AddButton';
|
|
5
4
|
import { CopyButton, MoveDownButton, MoveUpButton, RemoveButton, ClearButton } from './IconButton';
|
|
5
|
+
import SubmitButton from './SubmitButton';
|
|
6
6
|
|
|
7
7
|
function buttonTemplates<
|
|
8
8
|
T = any,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FormContextType, RJSFSchema, StrictRJSFSchema, TranslatableString, UnsupportedFieldProps } from '@rjsf/utils';
|
|
2
|
-
import Markdown from 'markdown-to-jsx';
|
|
2
|
+
import { Markdown } from 'markdown-to-jsx';
|
|
3
3
|
|
|
4
4
|
/** The `UnsupportedField` component is used to render a field in the schema is one that is not supported by
|
|
5
5
|
* react-jsonschema-form.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { FormContextType, RJSFSchema, StrictRJSFSchema, TemplatesType } from '@rjsf/utils';
|
|
2
2
|
|
|
3
3
|
import ArrayFieldDescriptionTemplate from './ArrayFieldDescriptionTemplate';
|
|
4
|
-
import ArrayFieldItemTemplate from './ArrayFieldItemTemplate';
|
|
5
4
|
import ArrayFieldItemButtonsTemplate from './ArrayFieldItemButtonsTemplate';
|
|
5
|
+
import ArrayFieldItemTemplate from './ArrayFieldItemTemplate';
|
|
6
6
|
import ArrayFieldTemplate from './ArrayFieldTemplate';
|
|
7
7
|
import ArrayFieldTitleTemplate from './ArrayFieldTitleTemplate';
|
|
8
8
|
import BaseInputTemplate from './BaseInputTemplate';
|
|
@@ -10,9 +10,9 @@ import ButtonTemplates from './ButtonTemplates';
|
|
|
10
10
|
import DescriptionField from './DescriptionField';
|
|
11
11
|
import ErrorList from './ErrorList';
|
|
12
12
|
import FallbackFieldTemplate from './FallbackFieldTemplate';
|
|
13
|
-
import FieldTemplate from './FieldTemplate';
|
|
14
13
|
import FieldErrorTemplate from './FieldErrorTemplate';
|
|
15
14
|
import FieldHelpTemplate from './FieldHelpTemplate';
|
|
15
|
+
import FieldTemplate from './FieldTemplate';
|
|
16
16
|
import GridTemplate from './GridTemplate';
|
|
17
17
|
import MultiSchemaFieldTemplate from './MultiSchemaFieldTemplate';
|
|
18
18
|
import ObjectFieldTemplate from './ObjectFieldTemplate';
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
useFileWidgetProps,
|
|
12
12
|
WidgetProps,
|
|
13
13
|
} from '@rjsf/utils';
|
|
14
|
-
import Markdown from 'markdown-to-jsx';
|
|
14
|
+
import { Markdown } from 'markdown-to-jsx';
|
|
15
15
|
|
|
16
16
|
function FileInfoPreview<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>({
|
|
17
17
|
fileInfo,
|
|
@@ -95,7 +95,8 @@ function FileWidget<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends
|
|
|
95
95
|
|
|
96
96
|
const handleOnChangeEvent = (event: ChangeEvent<HTMLInputElement>) => {
|
|
97
97
|
if (event.target.files) {
|
|
98
|
-
handleChange
|
|
98
|
+
// handleChange is async; DOM event handlers are void-returning, so we intentionally don't await
|
|
99
|
+
void handleChange(event.target.files);
|
|
99
100
|
}
|
|
100
101
|
};
|
|
101
102
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { FormContextType, RegistryWidgetsType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
|
|
2
2
|
|
|
3
|
-
import AltDateWidget from './AltDateWidget';
|
|
4
3
|
import AltDateTimeWidget from './AltDateTimeWidget';
|
|
5
|
-
import
|
|
4
|
+
import AltDateWidget from './AltDateWidget';
|
|
6
5
|
import CheckboxesWidget from './CheckboxesWidget';
|
|
6
|
+
import CheckboxWidget from './CheckboxWidget';
|
|
7
7
|
import ColorWidget from './ColorWidget';
|
|
8
|
-
import DateWidget from './DateWidget';
|
|
9
8
|
import DateTimeWidget from './DateTimeWidget';
|
|
9
|
+
import DateWidget from './DateWidget';
|
|
10
10
|
import EmailWidget from './EmailWidget';
|
|
11
11
|
import FileWidget from './FileWidget';
|
|
12
12
|
import HiddenWidget from './HiddenWidget';
|
|
@@ -18,8 +18,8 @@ import SelectWidget from './SelectWidget';
|
|
|
18
18
|
import TextareaWidget from './TextareaWidget';
|
|
19
19
|
import TextWidget from './TextWidget';
|
|
20
20
|
import TimeWidget from './TimeWidget';
|
|
21
|
-
import URLWidget from './URLWidget';
|
|
22
21
|
import UpDownWidget from './UpDownWidget';
|
|
22
|
+
import URLWidget from './URLWidget';
|
|
23
23
|
|
|
24
24
|
function widgets<
|
|
25
25
|
T = any,
|
package/src/index.ts
CHANGED
|
@@ -2,9 +2,9 @@ import Form, { FormProps, FormState, IChangeEvent } from './components/Form';
|
|
|
2
2
|
import RichDescription, { RichDescriptionProps } from './components/RichDescription';
|
|
3
3
|
import RichHelp, { RichHelpProps } from './components/RichHelp';
|
|
4
4
|
import SchemaExamples, { SchemaExamplesProps } from './components/SchemaExamples';
|
|
5
|
-
import withTheme, { ThemeProps } from './withTheme';
|
|
6
5
|
import getDefaultRegistry from './getDefaultRegistry';
|
|
7
6
|
import getTestRegistry from './getTestRegistry';
|
|
7
|
+
import withTheme, { ThemeProps } from './withTheme';
|
|
8
8
|
|
|
9
9
|
export type {
|
|
10
10
|
FormProps,
|
package/src/tsconfig.json
CHANGED
package/src/withTheme.tsx
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { ComponentType, ForwardedRef, forwardRef } from 'react';
|
|
2
|
-
import Form, { FormProps } from './components/Form';
|
|
3
2
|
import { FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
|
|
4
3
|
|
|
4
|
+
import Form, { FormProps } from './components/Form';
|
|
5
|
+
|
|
5
6
|
/** The properties for the `withTheme` function, essentially a subset of properties from the `FormProps` that can be
|
|
6
7
|
* overridden while creating a theme
|
|
7
8
|
*/
|