@rjsf/core 6.0.1 → 6.1.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 +139 -91
- package/dist/index.cjs +369 -312
- package/dist/index.cjs.map +4 -4
- package/dist/index.esm.js +248 -188
- package/dist/index.esm.js.map +4 -4
- package/lib/components/Form.d.ts.map +1 -1
- package/lib/components/Form.js +7 -3
- package/lib/components/RichHelp.d.ts +20 -0
- package/lib/components/RichHelp.d.ts.map +1 -0
- package/lib/components/RichHelp.js +17 -0
- package/lib/components/constants.d.ts +5 -0
- package/lib/components/constants.d.ts.map +1 -0
- package/lib/components/constants.js +4 -0
- package/lib/components/fields/ArrayField.d.ts.map +1 -1
- package/lib/components/fields/ArrayField.js +39 -17
- package/lib/components/fields/FallbackField.d.ts.map +1 -1
- package/lib/components/fields/FallbackField.js +11 -3
- package/lib/components/fields/ObjectField.d.ts.map +1 -1
- package/lib/components/fields/ObjectField.js +7 -9
- package/lib/components/fields/StringField.d.ts.map +1 -1
- package/lib/components/fields/StringField.js +3 -3
- package/lib/components/templates/ArrayFieldItemTemplate.d.ts.map +1 -1
- package/lib/components/templates/ArrayFieldItemTemplate.js +5 -5
- package/lib/components/templates/ButtonTemplates/AddButton.d.ts.map +1 -1
- package/lib/components/templates/ButtonTemplates/AddButton.js +1 -1
- package/lib/components/templates/FieldHelpTemplate.d.ts.map +1 -1
- package/lib/components/templates/FieldHelpTemplate.js +3 -6
- package/lib/components/templates/FieldTemplate/FieldTemplate.d.ts.map +1 -1
- package/lib/components/templates/FieldTemplate/FieldTemplate.js +2 -1
- package/lib/components/templates/WrapIfAdditionalTemplate.d.ts.map +1 -1
- package/lib/components/templates/WrapIfAdditionalTemplate.js +4 -2
- package/lib/components/widgets/CheckboxWidget.d.ts.map +1 -1
- package/lib/components/widgets/CheckboxWidget.js +4 -2
- package/lib/index.d.ts +3 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/src/components/Form.tsx +6 -4
- package/src/components/RichHelp.tsx +46 -0
- package/src/components/constants.ts +5 -0
- package/src/components/fields/ArrayField.tsx +52 -29
- package/src/components/fields/FallbackField.tsx +18 -10
- package/src/components/fields/ObjectField.tsx +7 -12
- package/src/components/fields/StringField.tsx +3 -2
- package/src/components/templates/ArrayFieldItemTemplate.tsx +8 -11
- package/src/components/templates/ButtonTemplates/AddButton.tsx +3 -1
- package/src/components/templates/FieldHelpTemplate.tsx +5 -11
- package/src/components/templates/FieldTemplate/FieldTemplate.tsx +2 -1
- package/src/components/templates/WrapIfAdditionalTemplate.tsx +7 -3
- package/src/components/widgets/CheckboxWidget.tsx +4 -1
- package/src/index.ts +3 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Form.d.ts","sourceRoot":"","sources":["../../src/components/Form.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,EAAE,SAAS,EAAa,MAAM,OAAO,CAAC;AAChG,OAAO,EAEL,eAAe,EAEf,WAAW,EACX,kBAAkB,EAClB,gBAAgB,EAChB,WAAW,EACX,aAAa,EACb,eAAe,EAQf,UAAU,EACV,gBAAgB,EAChB,QAAQ,EACR,kBAAkB,EAClB,mBAAmB,EACnB,UAAU,EACV,mBAAmB,EAEnB,eAAe,EAGf,aAAa,EAGb,QAAQ,EAGR,cAAc,EAEd,aAAa,EACb,qCAAqC,EACrC,6BAA6B,EAM7B,qBAAqB,EACtB,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"Form.d.ts","sourceRoot":"","sources":["../../src/components/Form.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,EAAE,SAAS,EAAa,MAAM,OAAO,CAAC;AAChG,OAAO,EAEL,eAAe,EAEf,W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CAAC,KAAK,EAAE,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,WAAW,EAAE,eAAe,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;IAuB3G,iFAAiF;IACjF,MAAM,aASJ;IAEF;;;;;OAKG;IACH,YAAY,CAAC,KAAK,EAAE,mBAAmB;IA2BvC;;;;;OAKG;IACH,wBAAwB,GAAI,WAAW,CAAC,KAAG,OAAO,CA8ChD;IAEF;;;;;OAKG;IACH,YAAY;IASZ;;OAEG;IACH,MAAM;CAwEP"}
|
package/lib/components/Form.js
CHANGED
|
@@ -7,9 +7,9 @@ import _isEmpty from 'lodash-es/isEmpty.js';
|
|
|
7
7
|
import _pick from 'lodash-es/pick.js';
|
|
8
8
|
import _set from 'lodash-es/set.js';
|
|
9
9
|
import _toPath from 'lodash-es/toPath.js';
|
|
10
|
+
import _unset from 'lodash-es/unset.js';
|
|
10
11
|
import getDefaultRegistry from '../getDefaultRegistry.js';
|
|
11
|
-
|
|
12
|
-
const IS_RESET = Symbol('reset');
|
|
12
|
+
import { ADDITIONAL_PROPERTY_KEY_REMOVE, IS_RESET } from './constants.js';
|
|
13
13
|
/** Converts the full `FormState` into the `IChangeEvent` version by picking out the public values
|
|
14
14
|
*
|
|
15
15
|
* @param state - The state of the form
|
|
@@ -431,7 +431,11 @@ export default class Form extends Component {
|
|
|
431
431
|
let retrievedSchema = this.state.retrievedSchema;
|
|
432
432
|
let formData = isRootPath ? newValue : _cloneDeep(oldFormData);
|
|
433
433
|
if (isObject(formData) || Array.isArray(formData)) {
|
|
434
|
-
if (
|
|
434
|
+
if (newValue === ADDITIONAL_PROPERTY_KEY_REMOVE) {
|
|
435
|
+
// For additional properties, we were given the special remove this key value, so unset it
|
|
436
|
+
_unset(formData, path);
|
|
437
|
+
}
|
|
438
|
+
else if (!isRootPath) {
|
|
435
439
|
// If the newValue is not on the root path, then set it into the form data
|
|
436
440
|
_set(formData, path, newValue);
|
|
437
441
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import { FormContextType, Registry, RJSFSchema, StrictRJSFSchema, UiSchema } from '@rjsf/utils';
|
|
3
|
+
export interface RichHelpProps<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any> {
|
|
4
|
+
/** The description text for a field, potentially containing markdown */
|
|
5
|
+
help: string | ReactElement;
|
|
6
|
+
/** The uiSchema object for this base component */
|
|
7
|
+
uiSchema?: UiSchema<T, S, F>;
|
|
8
|
+
/** The `registry` object */
|
|
9
|
+
registry: Registry<T, S, F>;
|
|
10
|
+
}
|
|
11
|
+
/** Renders the given `description` in the props as
|
|
12
|
+
*
|
|
13
|
+
* @param props - The `RichHelpProps` for this component
|
|
14
|
+
*/
|
|
15
|
+
declare function RichHelp<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>({ help, registry, uiSchema, }: RichHelpProps<T, S, F>): string | import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
declare namespace RichHelp {
|
|
17
|
+
var TEST_IDS: import("@rjsf/utils").TestIdShape;
|
|
18
|
+
}
|
|
19
|
+
export default RichHelp;
|
|
20
|
+
//# sourceMappingURL=RichHelp.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RichHelp.d.ts","sourceRoot":"","sources":["../../src/components/RichHelp.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AACrC,OAAO,EACL,eAAe,EACf,QAAQ,EACR,UAAU,EACV,gBAAgB,EAChB,QAAQ,EAGT,MAAM,aAAa,CAAC;AAKrB,MAAM,WAAW,aAAa,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,SAAS,gBAAgB,GAAG,UAAU,EAAE,CAAC,SAAS,eAAe,GAAG,GAAG;IAC9G,wEAAwE;IACxE,IAAI,EAAE,MAAM,GAAG,YAAY,CAAC;IAC5B,kDAAkD;IAClD,QAAQ,CAAC,EAAE,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAC7B,4BAA4B;IAC5B,QAAQ,EAAE,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;CAC7B;AAED;;;GAGG;AACH,iBAAwB,QAAQ,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,SAAS,gBAAgB,GAAG,UAAU,EAAE,CAAC,SAAS,eAAe,GAAG,GAAG,EAAE,EAClH,IAAI,EACJ,QAAQ,EACR,QAAa,GACd,EAAE,aAAa,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,oDAYxB;kBAhBuB,QAAQ;;;eAAR,QAAQ"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { getTestIds, getUiOptions, } from '@rjsf/utils';
|
|
3
|
+
import Markdown from 'markdown-to-jsx';
|
|
4
|
+
const TEST_IDS = getTestIds();
|
|
5
|
+
/** Renders the given `description` in the props as
|
|
6
|
+
*
|
|
7
|
+
* @param props - The `RichHelpProps` for this component
|
|
8
|
+
*/
|
|
9
|
+
export default function RichHelp({ help, registry, uiSchema = {}, }) {
|
|
10
|
+
const { globalUiOptions } = registry;
|
|
11
|
+
const uiOptions = getUiOptions(uiSchema, globalUiOptions);
|
|
12
|
+
if (uiOptions.enableMarkdownInHelp && typeof help === 'string') {
|
|
13
|
+
return (_jsx(Markdown, { options: { disableParsingRawHTML: true }, "data-testid": TEST_IDS.markdown, children: help }));
|
|
14
|
+
}
|
|
15
|
+
return help;
|
|
16
|
+
}
|
|
17
|
+
RichHelp.TEST_IDS = TEST_IDS;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** Internal only symbol used by `Form` & `ObjectField` to mark an additional property element to be removed */
|
|
2
|
+
export declare const ADDITIONAL_PROPERTY_KEY_REMOVE: unique symbol;
|
|
3
|
+
/** Internal only symbol used by the `reset()` function to indicate that a reset operation is happening */
|
|
4
|
+
export declare const IS_RESET: unique symbol;
|
|
5
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/components/constants.ts"],"names":[],"mappings":"AAAA,+GAA+G;AAC/G,eAAO,MAAM,8BAA8B,eAA4B,CAAC;AAExE,0GAA0G;AAC1G,eAAO,MAAM,QAAQ,eAAkB,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** Internal only symbol used by `Form` & `ObjectField` to mark an additional property element to be removed */
|
|
2
|
+
export const ADDITIONAL_PROPERTY_KEY_REMOVE = Symbol('remove-this-key');
|
|
3
|
+
/** Internal only symbol used by the `reset()` function to indicate that a reset operation is happening */
|
|
4
|
+
export const IS_RESET = Symbol('reset');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ArrayField.d.ts","sourceRoot":"","sources":["../../../src/components/fields/ArrayField.tsx"],"names":[],"mappings":"AACA,OAAO,EAmBL,UAAU,EACV,eAAe,EAEf,UAAU,EACV,gBAAgB,EAIjB,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"ArrayField.d.ts","sourceRoot":"","sources":["../../../src/components/fields/ArrayField.tsx"],"names":[],"mappings":"AACA,OAAO,EAmBL,UAAU,EACV,eAAe,EAEf,UAAU,EACV,gBAAgB,EAIjB,MAAM,aAAa,CAAC;AAizBrB;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,SAAS,gBAAgB,GAAG,UAAU,EAAE,CAAC,SAAS,eAAe,GAAG,GAAG,EAClH,KAAK,EAAE,UAAU,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,2CAkP7B"}
|
|
@@ -107,9 +107,13 @@ function computeItemUiSchema(uiSchema, item, index, formContext) {
|
|
|
107
107
|
* that the schema is fixed and allows additional items.
|
|
108
108
|
*/
|
|
109
109
|
function getNewFormDataRow(registry, schema) {
|
|
110
|
-
const { schemaUtils } = registry;
|
|
110
|
+
const { schemaUtils, globalFormOptions } = registry;
|
|
111
111
|
let itemSchema = schema.items;
|
|
112
|
-
if (
|
|
112
|
+
if (globalFormOptions.useFallbackUiForUnsupportedType && !itemSchema) {
|
|
113
|
+
// If we don't have itemSchema and useFallbackUiForUnsupportedType is on, use an empty schema
|
|
114
|
+
itemSchema = {};
|
|
115
|
+
}
|
|
116
|
+
else if (isFixedItems(schema) && allowAdditionalItems(schema)) {
|
|
113
117
|
itemSchema = schema.additionalItems;
|
|
114
118
|
}
|
|
115
119
|
// Cast this as a T to work around schema utils being for T[] caused by the FieldProps<T[], S, F> call on the class
|
|
@@ -161,10 +165,13 @@ function ArrayAsFiles(props) {
|
|
|
161
165
|
*/
|
|
162
166
|
function ArrayFieldItem(props) {
|
|
163
167
|
const { itemKey, index, name, disabled, hideError, readonly, registry, uiOptions, parentUiSchema, canAdd, canRemove = true, canMoveUp, canMoveDown, itemSchema, itemData, itemUiSchema, itemFieldPathId, itemErrorSchema, autofocus, onBlur, onFocus, onChange, rawErrors, totalItems, title, handleAddItem, handleCopyItem, handleRemoveItem, handleReorderItems, } = props;
|
|
164
|
-
const { fields: { ArraySchemaField, SchemaField }, } = registry;
|
|
168
|
+
const { schemaUtils, fields: { ArraySchemaField, SchemaField }, globalUiOptions, } = registry;
|
|
165
169
|
const fieldPathId = useDeepCompareMemo(itemFieldPathId);
|
|
166
170
|
const ItemSchemaField = ArraySchemaField || SchemaField;
|
|
167
171
|
const ArrayFieldItemTemplate = getTemplate('ArrayFieldItemTemplate', registry, uiOptions);
|
|
172
|
+
const displayLabel = schemaUtils.getDisplayLabel(itemSchema, itemUiSchema, globalUiOptions);
|
|
173
|
+
const { description } = getUiOptions(itemUiSchema);
|
|
174
|
+
const hasDescription = !!description || !!itemSchema.description;
|
|
168
175
|
const { orderable = true, removable = true, copyable = false } = uiOptions;
|
|
169
176
|
const has = {
|
|
170
177
|
moveUp: orderable && canMoveUp,
|
|
@@ -222,6 +229,8 @@ function ArrayFieldItem(props) {
|
|
|
222
229
|
schema: itemSchema,
|
|
223
230
|
uiSchema: itemUiSchema,
|
|
224
231
|
parentUiSchema,
|
|
232
|
+
displayLabel,
|
|
233
|
+
hasDescription,
|
|
225
234
|
};
|
|
226
235
|
return _jsx(ArrayFieldItemTemplate, { ...templateProps });
|
|
227
236
|
}
|
|
@@ -453,7 +462,7 @@ function useKeyedFormData(formData = []) {
|
|
|
453
462
|
*/
|
|
454
463
|
export default function ArrayField(props) {
|
|
455
464
|
const { schema, uiSchema, errorSchema, fieldPathId, registry, formData, onChange } = props;
|
|
456
|
-
const { schemaUtils, translateString } = registry;
|
|
465
|
+
const { globalFormOptions, schemaUtils, translateString } = registry;
|
|
457
466
|
const { keyedFormData, updateKeyedFormData } = useKeyedFormData(formData);
|
|
458
467
|
// All the children will use childFieldPathId if present in the props, falling back to the fieldPathId
|
|
459
468
|
const childFieldPathId = props.childFieldPathId ?? fieldPathId;
|
|
@@ -611,12 +620,14 @@ export default function ArrayField(props) {
|
|
|
611
620
|
const onSelectChange = useCallback((value) => {
|
|
612
621
|
onChange(value, childFieldPathId.path, undefined, childFieldPathId?.[ID_KEY]);
|
|
613
622
|
}, [onChange, childFieldPathId]);
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
623
|
+
const arrayAsMultiProps = {
|
|
624
|
+
...props,
|
|
625
|
+
formData,
|
|
626
|
+
fieldPathId: childFieldPathId,
|
|
627
|
+
onSelectChange: onSelectChange,
|
|
628
|
+
};
|
|
619
629
|
const arrayProps = {
|
|
630
|
+
...props,
|
|
620
631
|
handleAddItem,
|
|
621
632
|
handleCopyItem,
|
|
622
633
|
handleRemoveItem,
|
|
@@ -624,18 +635,29 @@ export default function ArrayField(props) {
|
|
|
624
635
|
keyedFormData,
|
|
625
636
|
onChange: handleChange,
|
|
626
637
|
};
|
|
627
|
-
if (
|
|
638
|
+
if (!(ITEMS_KEY in schema)) {
|
|
639
|
+
if (!globalFormOptions.useFallbackUiForUnsupportedType) {
|
|
640
|
+
const uiOptions = getUiOptions(uiSchema);
|
|
641
|
+
const UnsupportedFieldTemplate = getTemplate('UnsupportedFieldTemplate', registry, uiOptions);
|
|
642
|
+
return (_jsx(UnsupportedFieldTemplate, { schema: schema, fieldPathId: fieldPathId, reason: translateString(TranslatableString.MissingItems), registry: registry }));
|
|
643
|
+
}
|
|
644
|
+
// Add an items schema with type as undefined so it triggers FallbackField later on
|
|
645
|
+
const fallbackSchema = { ...schema, [ITEMS_KEY]: { type: undefined } };
|
|
646
|
+
arrayAsMultiProps.schema = fallbackSchema;
|
|
647
|
+
arrayProps.schema = fallbackSchema;
|
|
648
|
+
}
|
|
649
|
+
if (schemaUtils.isMultiSelect(arrayAsMultiProps.schema)) {
|
|
628
650
|
// If array has enum or uniqueItems set to true, call renderMultiSelect() to render the default multiselect widget or a custom widget, if specified.
|
|
629
|
-
return _jsx(ArrayAsMultiSelect, { ...
|
|
651
|
+
return _jsx(ArrayAsMultiSelect, { ...arrayAsMultiProps });
|
|
630
652
|
}
|
|
631
653
|
if (isCustomWidget(uiSchema)) {
|
|
632
|
-
return _jsx(ArrayAsCustomWidget, { ...
|
|
654
|
+
return _jsx(ArrayAsCustomWidget, { ...arrayAsMultiProps });
|
|
633
655
|
}
|
|
634
|
-
if (isFixedItems(schema)) {
|
|
635
|
-
return _jsx(FixedArray, { ...
|
|
656
|
+
if (isFixedItems(arrayAsMultiProps.schema)) {
|
|
657
|
+
return _jsx(FixedArray, { ...arrayProps });
|
|
636
658
|
}
|
|
637
|
-
if (schemaUtils.isFilesArray(schema, uiSchema)) {
|
|
638
|
-
return _jsx(ArrayAsFiles, { ...
|
|
659
|
+
if (schemaUtils.isFilesArray(arrayAsMultiProps.schema, uiSchema)) {
|
|
660
|
+
return _jsx(ArrayAsFiles, { ...arrayAsMultiProps });
|
|
639
661
|
}
|
|
640
|
-
return _jsx(NormalArray, { ...
|
|
662
|
+
return _jsx(NormalArray, { ...arrayProps });
|
|
641
663
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FallbackField.d.ts","sourceRoot":"","sources":["../../../src/components/fields/FallbackField.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAElB,eAAe,EAIf,UAAU,EACV,gBAAgB,EAIjB,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"FallbackField.d.ts","sourceRoot":"","sources":["../../../src/components/fields/FallbackField.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAElB,eAAe,EAIf,UAAU,EACV,gBAAgB,EAIjB,MAAM,aAAa,CAAC;AAqDrB;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,aAAa,CACnC,CAAC,GAAG,GAAG,EACP,CAAC,SAAS,gBAAgB,GAAG,UAAU,EACvC,CAAC,SAAS,eAAe,GAAG,GAAG,EAC/B,KAAK,EAAE,kBAAkB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,2CA2FnC"}
|
|
@@ -8,7 +8,7 @@ import { useMemo, useState } from 'react';
|
|
|
8
8
|
function getFallbackTypeSelectionSchema(title) {
|
|
9
9
|
return {
|
|
10
10
|
type: 'string',
|
|
11
|
-
enum: ['string', 'number', 'boolean'],
|
|
11
|
+
enum: ['string', 'number', 'boolean', 'object', 'array'],
|
|
12
12
|
default: 'string',
|
|
13
13
|
title: title,
|
|
14
14
|
};
|
|
@@ -22,6 +22,9 @@ function getTypeOfFormData(formData) {
|
|
|
22
22
|
if (dataType === 'string' || dataType === 'number' || dataType === 'boolean') {
|
|
23
23
|
return dataType;
|
|
24
24
|
}
|
|
25
|
+
if (dataType === 'object') {
|
|
26
|
+
return Array.isArray(formData) ? 'array' : 'object';
|
|
27
|
+
}
|
|
25
28
|
// Treat everything else as a string
|
|
26
29
|
return 'string';
|
|
27
30
|
}
|
|
@@ -63,10 +66,15 @@ export default function FallbackField(props) {
|
|
|
63
66
|
}
|
|
64
67
|
};
|
|
65
68
|
if (!globalFormOptions.useFallbackUiForUnsupportedType) {
|
|
69
|
+
const { reason = translateString(TranslatableString.UnknownFieldType, [String(schema.type)]) } = props;
|
|
66
70
|
const UnsupportedFieldTemplate = getTemplate('UnsupportedFieldTemplate', registry, uiOptions);
|
|
67
|
-
return
|
|
71
|
+
return _jsx(UnsupportedFieldTemplate, { schema: schema, fieldPathId: fieldPathId, reason: reason, registry: registry });
|
|
68
72
|
}
|
|
69
73
|
const FallbackFieldTemplate = getTemplate('FallbackFieldTemplate', registry, uiOptions);
|
|
70
74
|
const { SchemaField } = fields;
|
|
71
|
-
return (_jsx(FallbackFieldTemplate, { schema: schema, registry: registry, typeSelector: _jsx(SchemaField, { fieldPathId: typeSelectorInnerFieldPathId, name: `${name}__fallback_type`, schema: typesOptionSchema, formData: type, onChange: onTypeChange, onBlur: onBlur, onFocus: onFocus, registry: registry, hideLabel: !displayLabel, disabled: disabled, readonly: readonly, required: required }, formData ? hashObject(formData) : '__empty__'), schemaField: _jsx(SchemaField, { ...props, schema: {
|
|
75
|
+
return (_jsx(FallbackFieldTemplate, { schema: schema, registry: registry, typeSelector: _jsx(SchemaField, { fieldPathId: typeSelectorInnerFieldPathId, name: `${name}__fallback_type`, schema: typesOptionSchema, formData: type, onChange: onTypeChange, onBlur: onBlur, onFocus: onFocus, registry: registry, hideLabel: !displayLabel, disabled: disabled, readonly: readonly, required: required }, formData ? hashObject(formData) : '__empty__'), schemaField: _jsx(SchemaField, { ...props, schema: {
|
|
76
|
+
type,
|
|
77
|
+
title: translateString(TranslatableString.Value),
|
|
78
|
+
...(type === 'object' && { additionalProperties: true }),
|
|
79
|
+
} }) }));
|
|
72
80
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ObjectField.d.ts","sourceRoot":"","sources":["../../../src/components/fields/ObjectField.tsx"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"ObjectField.d.ts","sourceRoot":"","sources":["../../../src/components/fields/ObjectField.tsx"],"names":[],"mappings":"AACA,OAAO,EAaL,UAAU,EACV,eAAe,EAMf,UAAU,EACV,gBAAgB,EAEjB,MAAM,aAAa,CAAC;AAwKrB;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,SAAS,gBAAgB,GAAG,UAAU,EAAE,CAAC,SAAS,eAAe,GAAG,GAAG,EACnH,KAAK,EAAE,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,2CAgN3B"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useCallback, useState } from 'react';
|
|
3
|
-
import { ADDITIONAL_PROPERTY_FLAG, ANY_OF_KEY, getTemplate, getUiOptions,
|
|
3
|
+
import { ADDITIONAL_PROPERTY_FLAG, ANY_OF_KEY, getTemplate, getUiOptions, isFormDataAvailable, orderProperties, shouldRenderOptionalField, toFieldPathId, useDeepCompareMemo, ONE_OF_KEY, PROPERTIES_KEY, REF_KEY, TranslatableString, } from '@rjsf/utils';
|
|
4
4
|
import Markdown from 'markdown-to-jsx';
|
|
5
5
|
import get from 'lodash-es/get.js';
|
|
6
6
|
import has from 'lodash-es/has.js';
|
|
7
7
|
import isObject from 'lodash-es/isObject.js';
|
|
8
8
|
import set from 'lodash-es/set.js';
|
|
9
|
-
import
|
|
9
|
+
import { ADDITIONAL_PROPERTY_KEY_REMOVE } from '../constants.js';
|
|
10
10
|
/** Returns a flag indicating whether the `name` field is required in the object schema
|
|
11
11
|
*
|
|
12
12
|
* @param schema - The schema to check
|
|
@@ -100,7 +100,6 @@ export default function ObjectField(props) {
|
|
|
100
100
|
const schema = schemaUtils.retrieveSchema(rawSchema, formData, true);
|
|
101
101
|
const uiOptions = getUiOptions(uiSchema, globalUiOptions);
|
|
102
102
|
const { properties: schemaProperties = {} } = schema;
|
|
103
|
-
const formDataHash = hashObject(formData || {});
|
|
104
103
|
// All the children will use childFieldPathId if present in the props, falling back to the fieldPathId
|
|
105
104
|
const childFieldPathId = props.childFieldPathId ?? fieldPathId;
|
|
106
105
|
const templateTitle = uiOptions.title ?? schema.title ?? title ?? name;
|
|
@@ -186,13 +185,12 @@ export default function ObjectField(props) {
|
|
|
186
185
|
onChange(renamedObj, childFieldPathId.path);
|
|
187
186
|
}
|
|
188
187
|
}, [formData, onChange, childFieldPathId, getAvailableKey]);
|
|
189
|
-
/** Handles the remove click which
|
|
188
|
+
/** Handles the remove click which calls the `onChange` callback with the special ADDITIONAL_PROPERTY_FIELD_REMOVE
|
|
189
|
+
* value for the path plus the key to be removed
|
|
190
190
|
*/
|
|
191
191
|
const handleRemoveProperty = useCallback((key) => {
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
onChange(copiedFormData, childFieldPathId.path);
|
|
195
|
-
}, [onChange, childFieldPathId, formData]);
|
|
192
|
+
onChange(ADDITIONAL_PROPERTY_KEY_REMOVE, [...childFieldPathId.path, key]);
|
|
193
|
+
}, [onChange, childFieldPathId]);
|
|
196
194
|
if (!renderOptionalField || hasFormData) {
|
|
197
195
|
try {
|
|
198
196
|
const properties = Object.keys(schemaProperties);
|
|
@@ -212,7 +210,7 @@ export default function ObjectField(props) {
|
|
|
212
210
|
const addedByAdditionalProperties = has(schema, [PROPERTIES_KEY, name, ADDITIONAL_PROPERTY_FLAG]);
|
|
213
211
|
const fieldUiSchema = addedByAdditionalProperties ? uiSchema.additionalProperties : uiSchema[name];
|
|
214
212
|
const hidden = getUiOptions(fieldUiSchema).widget === 'hidden';
|
|
215
|
-
const content = (_jsx(ObjectFieldProperty, { propertyName: name, required: isRequired(schema, name), schema: get(schema, [PROPERTIES_KEY, name], {}), uiSchema: fieldUiSchema, errorSchema: get(errorSchema, name), fieldPathId: childFieldPathId, formData: get(formData, name), handleKeyRename: handleKeyRename, handleRemoveProperty: handleRemoveProperty, addedByAdditionalProperties: addedByAdditionalProperties, onChange: onChange, onBlur: onBlur, onFocus: onFocus, registry: registry, disabled: disabled, readonly: readonly, hideError: hideError },
|
|
213
|
+
const content = (_jsx(ObjectFieldProperty, { propertyName: name, required: isRequired(schema, name), schema: get(schema, [PROPERTIES_KEY, name], {}), uiSchema: fieldUiSchema, errorSchema: get(errorSchema, name), fieldPathId: childFieldPathId, formData: get(formData, name), handleKeyRename: handleKeyRename, handleRemoveProperty: handleRemoveProperty, addedByAdditionalProperties: addedByAdditionalProperties, onChange: onChange, onBlur: onBlur, onFocus: onFocus, registry: registry, disabled: disabled, readonly: readonly, hideError: hideError }, name));
|
|
216
214
|
return {
|
|
217
215
|
content,
|
|
218
216
|
name,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StringField.d.ts","sourceRoot":"","sources":["../../../src/components/fields/StringField.tsx"],"names":[],"mappings":"AACA,OAAO,EAKL,UAAU,EACV,eAAe,EACf,UAAU,EACV,gBAAgB,EAEjB,MAAM,aAAa,CAAC;AAErB;;;GAGG;AACH,iBAAS,WAAW,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,SAAS,gBAAgB,GAAG,UAAU,EAAE,CAAC,SAAS,eAAe,GAAG,GAAG,EACpG,KAAK,EAAE,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"StringField.d.ts","sourceRoot":"","sources":["../../../src/components/fields/StringField.tsx"],"names":[],"mappings":"AACA,OAAO,EAKL,UAAU,EACV,eAAe,EACf,UAAU,EACV,gBAAgB,EAEjB,MAAM,aAAa,CAAC;AAErB;;;GAGG;AACH,iBAAS,WAAW,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,SAAS,gBAAgB,GAAG,UAAU,EAAE,CAAC,SAAS,eAAe,GAAG,GAAG,EACpG,KAAK,EAAE,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,2CA8D3B;AAED,eAAe,WAAW,CAAC"}
|
|
@@ -6,8 +6,8 @@ import { getWidget, getUiOptions, optionsList, hasWidget, } from '@rjsf/utils';
|
|
|
6
6
|
* @param props - The `FieldProps` for this template
|
|
7
7
|
*/
|
|
8
8
|
function StringField(props) {
|
|
9
|
-
const { schema, name, uiSchema, fieldPathId, formData, required, disabled = false, readonly = false, autofocus = false, onChange, onBlur, onFocus, registry, rawErrors, hideError, } = props;
|
|
10
|
-
const { title, format } = schema;
|
|
9
|
+
const { schema, name, uiSchema, fieldPathId, formData, required, disabled = false, readonly = false, autofocus = false, onChange, onBlur, onFocus, registry, rawErrors, hideError, title, } = props;
|
|
10
|
+
const { title: schemaTitle, format } = schema;
|
|
11
11
|
const { widgets, schemaUtils, globalUiOptions } = registry;
|
|
12
12
|
const enumOptions = schemaUtils.isSelect(schema) ? optionsList(schema, uiSchema) : undefined;
|
|
13
13
|
let defaultWidget = enumOptions ? 'select' : 'text';
|
|
@@ -16,7 +16,7 @@ function StringField(props) {
|
|
|
16
16
|
}
|
|
17
17
|
const { widget = defaultWidget, placeholder = '', title: uiTitle, ...options } = getUiOptions(uiSchema);
|
|
18
18
|
const displayLabel = schemaUtils.getDisplayLabel(schema, uiSchema, globalUiOptions);
|
|
19
|
-
const label = uiTitle ?? title ?? name;
|
|
19
|
+
const label = uiTitle ?? title ?? schemaTitle ?? name;
|
|
20
20
|
const Widget = getWidget(schema, widget, widgets);
|
|
21
21
|
const onWidgetChange = useCallback((value, errorSchema, id) => {
|
|
22
22
|
// String field change passes an empty path array to the parent field which adds the appropriate path
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ArrayFieldItemTemplate.d.ts","sourceRoot":"","sources":["../../../src/components/templates/ArrayFieldItemTemplate.tsx"],"names":[],"mappings":"AACA,OAAO,EACL,2BAA2B,EAC3B,eAAe,EAGf,UAAU,EACV,gBAAgB,EACjB,MAAM,aAAa,CAAC;AAErB;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAC5C,CAAC,GAAG,GAAG,EACP,CAAC,SAAS,gBAAgB,GAAG,UAAU,EACvC,CAAC,SAAS,eAAe,GAAG,GAAG,EAC/B,KAAK,EAAE,2BAA2B,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"ArrayFieldItemTemplate.d.ts","sourceRoot":"","sources":["../../../src/components/templates/ArrayFieldItemTemplate.tsx"],"names":[],"mappings":"AACA,OAAO,EACL,2BAA2B,EAC3B,eAAe,EAGf,UAAU,EACV,gBAAgB,EACjB,MAAM,aAAa,CAAC;AAErB;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAC5C,CAAC,GAAG,GAAG,EACP,CAAC,SAAS,gBAAgB,GAAG,UAAU,EACvC,CAAC,SAAS,eAAe,GAAG,GAAG,EAC/B,KAAK,EAAE,2BAA2B,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,2CA6B5C"}
|
|
@@ -5,7 +5,7 @@ import { getTemplate, getUiOptions, } from '@rjsf/utils';
|
|
|
5
5
|
* @param props - The `ArrayFieldItemTemplateProps` props for the component
|
|
6
6
|
*/
|
|
7
7
|
export default function ArrayFieldItemTemplate(props) {
|
|
8
|
-
const { children, className, buttonsProps, hasToolbar, registry, uiSchema } = props;
|
|
8
|
+
const { children, className, buttonsProps, displayLabel, hasDescription, hasToolbar, registry, uiSchema } = props;
|
|
9
9
|
const uiOptions = getUiOptions(uiSchema);
|
|
10
10
|
const ArrayFieldItemButtonsTemplate = getTemplate('ArrayFieldItemButtonsTemplate', registry, uiOptions);
|
|
11
11
|
const btnStyle = {
|
|
@@ -14,8 +14,8 @@ export default function ArrayFieldItemTemplate(props) {
|
|
|
14
14
|
paddingRight: 6,
|
|
15
15
|
fontWeight: 'bold',
|
|
16
16
|
};
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
const margin = hasDescription ? 31 : 9;
|
|
18
|
+
const containerStyle = { display: 'flex', alignItems: displayLabel ? 'center' : 'baseline' };
|
|
19
|
+
const toolbarStyle = { display: 'flex', justifyContent: 'flex-end', marginTop: displayLabel ? `${margin}px` : 0 };
|
|
20
|
+
return (_jsxs("div", { className: className, style: containerStyle, children: [_jsx("div", { className: hasToolbar ? 'col-xs-9 col-md-10 col-xl-11' : 'col-xs-12', children: children }), hasToolbar && (_jsx("div", { className: 'col-xs-3 col-md-2 col-xl-1 array-item-toolbox', children: _jsx("div", { className: 'btn-group', style: toolbarStyle, children: _jsx(ArrayFieldItemButtonsTemplate, { ...buttonsProps, style: btnStyle }) }) }))] }));
|
|
21
21
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AddButton.d.ts","sourceRoot":"","sources":["../../../../src/components/templates/ButtonTemplates/AddButton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,UAAU,EAAE,gBAAgB,EAAsB,MAAM,aAAa,CAAC;AAIjH;GACG;AACH,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,SAAS,gBAAgB,GAAG,UAAU,EAAE,CAAC,SAAS,eAAe,GAAG,GAAG,EAAE,EACnH,EAAE,EACF,SAAS,EACT,OAAO,EACP,QAAQ,EACR,QAAQ,GACT,EAAE,eAAe,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"AddButton.d.ts","sourceRoot":"","sources":["../../../../src/components/templates/ButtonTemplates/AddButton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,UAAU,EAAE,gBAAgB,EAAsB,MAAM,aAAa,CAAC;AAIjH;GACG;AACH,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,SAAS,gBAAgB,GAAG,UAAU,EAAE,CAAC,SAAS,eAAe,GAAG,GAAG,EAAE,EACnH,EAAE,EACF,SAAS,EACT,OAAO,EACP,QAAQ,EACR,QAAQ,GACT,EAAE,eAAe,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,2CAoB1B"}
|
|
@@ -5,5 +5,5 @@ import IconButton from './IconButton.js';
|
|
|
5
5
|
*/
|
|
6
6
|
export default function AddButton({ id, className, onClick, disabled, registry, }) {
|
|
7
7
|
const { translateString } = registry;
|
|
8
|
-
return (_jsx("div", { className: 'row', children: _jsx("p", { className: `col-xs-
|
|
8
|
+
return (_jsx("div", { className: 'row', children: _jsx("p", { className: `col-xs-4 col-sm-2 col-lg-1 col-xs-offset-8 col-sm-offset-10 col-lg-offset-11 text-right ${className}`, children: _jsx(IconButton, { id: id, iconType: 'info', icon: 'plus', className: 'btn-add col-xs-12', title: translateString(TranslatableString.AddButton), onClick: onClick, disabled: disabled, registry: registry }) }) }));
|
|
9
9
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FieldHelpTemplate.d.ts","sourceRoot":"","sources":["../../../src/components/templates/FieldHelpTemplate.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAU,cAAc,EAAE,eAAe,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"FieldHelpTemplate.d.ts","sourceRoot":"","sources":["../../../src/components/templates/FieldHelpTemplate.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAU,cAAc,EAAE,eAAe,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAGpG;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,iBAAiB,CACvC,CAAC,GAAG,GAAG,EACP,CAAC,SAAS,gBAAgB,GAAG,UAAU,EACvC,CAAC,SAAS,eAAe,GAAG,GAAG,EAC/B,KAAK,EAAE,cAAc,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,kDAW/B"}
|
|
@@ -1,17 +1,14 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { helpId } from '@rjsf/utils';
|
|
3
|
+
import RichHelp from '../RichHelp.js';
|
|
3
4
|
/** The `FieldHelpTemplate` component renders any help desired for a field
|
|
4
5
|
*
|
|
5
6
|
* @param props - The `FieldHelpProps` to be rendered
|
|
6
7
|
*/
|
|
7
8
|
export default function FieldHelpTemplate(props) {
|
|
8
|
-
const { fieldPathId, help } = props;
|
|
9
|
+
const { fieldPathId, help, uiSchema, registry } = props;
|
|
9
10
|
if (!help) {
|
|
10
11
|
return null;
|
|
11
12
|
}
|
|
12
|
-
|
|
13
|
-
if (typeof help === 'string') {
|
|
14
|
-
return (_jsx("p", { id: id, className: 'help-block', children: help }));
|
|
15
|
-
}
|
|
16
|
-
return (_jsx("div", { id: id, className: 'help-block', children: help }));
|
|
13
|
+
return (_jsx("div", { id: helpId(fieldPathId), className: 'help-block', children: _jsx(RichHelp, { help: help, registry: registry, uiSchema: uiSchema }) }));
|
|
17
14
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FieldTemplate.d.ts","sourceRoot":"","sources":["../../../../src/components/templates/FieldTemplate/FieldTemplate.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,UAAU,EACV,gBAAgB,EAGjB,MAAM,aAAa,CAAC;AAIrB;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,aAAa,CACnC,CAAC,GAAG,GAAG,EACP,CAAC,SAAS,gBAAgB,GAAG,UAAU,EACvC,CAAC,SAAS,eAAe,GAAG,GAAG,EAC/B,KAAK,EAAE,kBAAkB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"FieldTemplate.d.ts","sourceRoot":"","sources":["../../../../src/components/templates/FieldTemplate/FieldTemplate.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,UAAU,EACV,gBAAgB,EAGjB,MAAM,aAAa,CAAC;AAIrB;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,aAAa,CACnC,CAAC,GAAG,GAAG,EACP,CAAC,SAAS,gBAAgB,GAAG,UAAU,EACvC,CAAC,SAAS,eAAe,GAAG,GAAG,EAC/B,KAAK,EAAE,kBAAkB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,2CAqBnC"}
|
|
@@ -13,5 +13,6 @@ export default function FieldTemplate(props) {
|
|
|
13
13
|
if (hidden) {
|
|
14
14
|
return _jsx("div", { className: 'hidden', children: children });
|
|
15
15
|
}
|
|
16
|
-
|
|
16
|
+
const isCheckbox = uiOptions.widget === 'checkbox';
|
|
17
|
+
return (_jsxs(WrapIfAdditionalTemplate, { ...props, children: [displayLabel && !isCheckbox && _jsx(Label, { label: label, required: required, id: id }), displayLabel && description ? description : null, children, errors, help] }));
|
|
17
18
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WrapIfAdditionalTemplate.d.ts","sourceRoot":"","sources":["../../../src/components/templates/WrapIfAdditionalTemplate.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,eAAe,EACf,UAAU,EACV,gBAAgB,EAEhB,6BAA6B,EAC9B,MAAM,aAAa,CAAC;AAIrB;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,wBAAwB,CAC9C,CAAC,GAAG,GAAG,EACP,CAAC,SAAS,gBAAgB,GAAG,UAAU,EACvC,CAAC,SAAS,eAAe,GAAG,GAAG,EAC/B,KAAK,EAAE,6BAA6B,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"WrapIfAdditionalTemplate.d.ts","sourceRoot":"","sources":["../../../src/components/templates/WrapIfAdditionalTemplate.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,eAAe,EACf,UAAU,EACV,gBAAgB,EAEhB,6BAA6B,EAC9B,MAAM,aAAa,CAAC;AAIrB;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,wBAAwB,CAC9C,CAAC,GAAG,GAAG,EACP,CAAC,SAAS,gBAAgB,GAAG,UAAU,EACvC,CAAC,SAAS,eAAe,GAAG,GAAG,EAC/B,KAAK,EAAE,6BAA6B,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,2CAwE9C"}
|
|
@@ -7,12 +7,13 @@ import Label from './FieldTemplate/Label.js';
|
|
|
7
7
|
* @param props - The `WrapIfAdditionalProps` for this component
|
|
8
8
|
*/
|
|
9
9
|
export default function WrapIfAdditionalTemplate(props) {
|
|
10
|
-
const { id, classNames, style, disabled, label, onKeyRenameBlur, onRemoveProperty, readonly, required, schema, hideError, rawErrors, children, uiSchema, registry, } = props;
|
|
10
|
+
const { id, classNames, style, disabled, displayLabel, label, onKeyRenameBlur, onRemoveProperty, rawDescription, readonly, required, schema, hideError, rawErrors, children, uiSchema, registry, } = props;
|
|
11
11
|
const { templates, translateString } = registry;
|
|
12
12
|
// Button templates are not overridden in the uiSchema
|
|
13
13
|
const { RemoveButton } = templates.ButtonTemplates;
|
|
14
14
|
const keyLabel = translateString(TranslatableString.KeyLabel, [label]);
|
|
15
15
|
const additional = ADDITIONAL_PROPERTY_FLAG in schema;
|
|
16
|
+
const hasDescription = !!rawDescription;
|
|
16
17
|
const classNamesList = ['form-group', classNames];
|
|
17
18
|
if (!hideError && rawErrors && rawErrors.length > 0) {
|
|
18
19
|
classNamesList.push('has-error has-danger');
|
|
@@ -21,5 +22,6 @@ export default function WrapIfAdditionalTemplate(props) {
|
|
|
21
22
|
if (!additional) {
|
|
22
23
|
return (_jsx("div", { className: uiClassNames, style: style, children: children }));
|
|
23
24
|
}
|
|
24
|
-
|
|
25
|
+
const margin = hasDescription ? 46 : 26;
|
|
26
|
+
return (_jsx("div", { className: uiClassNames, style: style, children: _jsxs("div", { className: 'row', children: [_jsx("div", { className: 'col-xs-5 form-additional', children: _jsxs("div", { className: 'form-group', children: [displayLabel && _jsx(Label, { label: keyLabel, required: required, id: `${id}-key` }), displayLabel && rawDescription && _jsx("div", { children: "\u00A0" }), _jsx("input", { className: 'form-control', type: 'text', id: `${id}-key`, onBlur: onKeyRenameBlur, defaultValue: label })] }) }), _jsx("div", { className: 'form-additional form-group col-xs-5', children: children }), _jsx("div", { className: 'col-xs-2', style: { marginTop: displayLabel ? `${margin}px` : undefined }, children: _jsx(RemoveButton, { id: buttonId(id, 'remove'), className: 'rjsf-object-property-remove btn-block', style: { border: '0' }, disabled: disabled || readonly, onClick: onRemoveProperty, uiSchema: uiSchema, registry: registry }) })] }) }));
|
|
25
27
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckboxWidget.d.ts","sourceRoot":"","sources":["../../../src/components/widgets/CheckboxWidget.tsx"],"names":[],"mappings":"AACA,OAAO,EAML,eAAe,EACf,UAAU,EACV,gBAAgB,EAChB,WAAW,
|
|
1
|
+
{"version":3,"file":"CheckboxWidget.d.ts","sourceRoot":"","sources":["../../../src/components/widgets/CheckboxWidget.tsx"],"names":[],"mappings":"AACA,OAAO,EAML,eAAe,EACf,UAAU,EACV,gBAAgB,EAChB,WAAW,EAEZ,MAAM,aAAa,CAAC;AAErB;;;;GAIG;AACH,iBAAS,cAAc,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,SAAS,gBAAgB,GAAG,UAAU,EAAE,CAAC,SAAS,eAAe,GAAG,GAAG,EAAE,EACzG,MAAM,EACN,QAAQ,EACR,OAAO,EACP,EAAE,EACF,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,KAAK,EACL,SAAS,EACT,SAAiB,EACjB,MAAM,EACN,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,QAAQ,GACT,EAAE,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,2CA0DtB;AAED,eAAe,cAAc,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useCallback } from 'react';
|
|
3
|
-
import { ariaDescribedByIds, descriptionId, getTemplate, labelValue, schemaRequiresTrueValue, } from '@rjsf/utils';
|
|
3
|
+
import { ariaDescribedByIds, descriptionId, getTemplate, labelValue, schemaRequiresTrueValue, getUiOptions, } from '@rjsf/utils';
|
|
4
4
|
/** The `CheckBoxWidget` is a widget for rendering boolean properties.
|
|
5
5
|
* It is typically used to represent a boolean.
|
|
6
6
|
*
|
|
@@ -15,7 +15,9 @@ function CheckboxWidget({ schema, uiSchema, options, id, value, disabled, readon
|
|
|
15
15
|
const handleChange = useCallback((event) => onChange(event.target.checked), [onChange]);
|
|
16
16
|
const handleBlur = useCallback((event) => onBlur(id, event.target.checked), [onBlur, id]);
|
|
17
17
|
const handleFocus = useCallback((event) => onFocus(id, event.target.checked), [onFocus, id]);
|
|
18
|
-
const
|
|
18
|
+
const uiOptions = getUiOptions(uiSchema);
|
|
19
|
+
const isCheckboxWidget = uiOptions.widget === 'checkbox';
|
|
20
|
+
const description = isCheckboxWidget ? undefined : (options.description ?? schema.description);
|
|
19
21
|
return (_jsxs("div", { className: `checkbox ${disabled || readonly ? 'disabled' : ''}`, children: [!hideLabel && description && (_jsx(DescriptionFieldTemplate, { id: descriptionId(id), description: description, schema: schema, uiSchema: uiSchema, registry: registry })), _jsxs("label", { children: [_jsx("input", { type: 'checkbox', id: id, name: htmlName || id, checked: typeof value === 'undefined' ? false : value, required: required, disabled: disabled || readonly, autoFocus: autofocus, onChange: handleChange, onBlur: handleBlur, onFocus: handleFocus, "aria-describedby": ariaDescribedByIds(id) }), labelValue(_jsx("span", { children: label }), hideLabel)] })] }));
|
|
20
22
|
}
|
|
21
23
|
export default CheckboxWidget;
|
package/lib/index.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import Form, { FormProps, FormState, IChangeEvent } from './components/Form.js';
|
|
2
2
|
import RichDescription, { RichDescriptionProps } from './components/RichDescription.js';
|
|
3
|
+
import RichHelp, { RichHelpProps } from './components/RichHelp.js';
|
|
3
4
|
import withTheme, { ThemeProps } from './withTheme.js';
|
|
4
5
|
import getDefaultRegistry from './getDefaultRegistry.js';
|
|
5
6
|
import getTestRegistry from './getTestRegistry.js';
|
|
6
|
-
export type { FormProps, FormState, IChangeEvent, ThemeProps, RichDescriptionProps };
|
|
7
|
-
export { withTheme, getDefaultRegistry, getTestRegistry, RichDescription };
|
|
7
|
+
export type { FormProps, FormState, IChangeEvent, ThemeProps, RichDescriptionProps, RichHelpProps };
|
|
8
|
+
export { withTheme, getDefaultRegistry, getTestRegistry, RichDescription, RichHelp };
|
|
8
9
|
export default Form;
|
|
9
10
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAC7E,OAAO,eAAe,EAAE,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACrF,OAAO,SAAS,EAAE,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AACtD,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAEhD,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,EAAE,UAAU,EAAE,oBAAoB,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAC7E,OAAO,eAAe,EAAE,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACrF,OAAO,QAAQ,EAAE,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,SAAS,EAAE,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AACtD,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAEhD,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,EAAE,UAAU,EAAE,oBAAoB,EAAE,aAAa,EAAE,CAAC;AAEpG,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,eAAe,EAAE,eAAe,EAAE,QAAQ,EAAE,CAAC;AACrF,eAAe,IAAI,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import Form from './components/Form.js';
|
|
2
2
|
import RichDescription from './components/RichDescription.js';
|
|
3
|
+
import RichHelp from './components/RichHelp.js';
|
|
3
4
|
import withTheme from './withTheme.js';
|
|
4
5
|
import getDefaultRegistry from './getDefaultRegistry.js';
|
|
5
6
|
import getTestRegistry from './getTestRegistry.js';
|
|
6
|
-
export { withTheme, getDefaultRegistry, getTestRegistry, RichDescription };
|
|
7
|
+
export { withTheme, getDefaultRegistry, getTestRegistry, RichDescription, RichHelp };
|
|
7
8
|
export default Form;
|