@rjsf/core 6.0.0-beta.7 → 6.0.0-beta.8
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 +2 -3
- package/dist/index.esm.js +6 -6
- package/dist/index.esm.js.map +3 -3
- package/dist/index.js +2 -3
- package/dist/index.js.map +2 -2
- package/lib/components/fields/LayoutGridField.d.ts +0 -3
- package/lib/components/fields/LayoutGridField.d.ts.map +1 -1
- package/lib/components/fields/LayoutGridField.js +3 -6
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -4
- package/src/components/fields/LayoutGridField.tsx +3 -6
|
@@ -48,9 +48,6 @@ export declare const LAYOUT_GRID_UI_OPTION = "layoutGrid";
|
|
|
48
48
|
/** The constant representing the main layout grid schema option name in the `uiSchema`
|
|
49
49
|
*/
|
|
50
50
|
export declare const LAYOUT_GRID_OPTION = "ui:layoutGrid";
|
|
51
|
-
/** The constant representing the global UI Options object potentially contained within the `uiSchema`
|
|
52
|
-
*/
|
|
53
|
-
export declare const UI_GLOBAL_OPTIONS = "ui:global_options";
|
|
54
51
|
/** Type used to return options list and whether it has a discriminator */
|
|
55
52
|
type OneOfOptionsInfoType<S extends StrictRJSFSchema = RJSFSchema> = {
|
|
56
53
|
options: S[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LayoutGridField.d.ts","sourceRoot":"","sources":["../../../src/components/fields/LayoutGridField.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAChE,OAAO,EAEL,WAAW,EACX,UAAU,EACV,eAAe,EACf,iBAAiB,EAOjB,QAAQ,EAMR,UAAU,EACV,QAAQ,EACR,eAAe,EACf,gBAAgB,
|
|
1
|
+
{"version":3,"file":"LayoutGridField.d.ts","sourceRoot":"","sources":["../../../src/components/fields/LayoutGridField.tsx"],"names":[],"mappings":"AAAA,OAAO,EA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gBAAgB,EAAE,cAAc;IAehD;;;;;;OAMG;IACH,SAAS,CAAC,gBAAgB,EAAE,cAAc;IAiB1C;;;;;;OAMG;IACH,aAAa,CAAC,gBAAgB,EAAE,cAAc;IAsB9C;;;;;;OAMG;IACH,SAAS,CAAC,gBAAgB,EAAE,cAAc;IAiB1C;;;;;;;;OAQG;IACH,cAAc,CAAC,wBAAwB,EAAE,oBAAoB,EAAE;IAe/D;;;;;;;;;;;;;;OAcG;IACH,WAAW,CAAC,UAAU,CAAC,EAAE,YAAY,GAAG,MAAM;IAsG9C;;;;;;OAMG;IACH,MAAM;CAwBP"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createElement as _createElement } from "react";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import { PureComponent } from 'react';
|
|
4
|
-
import { ANY_OF_KEY, getDiscriminatorFieldFromSchema, getTemplate, getTestIds, getUiOptions, hashObject, ID_KEY, lookupFromFormContext, mergeObjects, ONE_OF_KEY, PROPERTIES_KEY, READONLY_KEY, UI_OPTIONS_KEY, } from '@rjsf/utils';
|
|
4
|
+
import { ANY_OF_KEY, getDiscriminatorFieldFromSchema, getTemplate, getTestIds, getUiOptions, hashObject, ID_KEY, lookupFromFormContext, mergeObjects, ONE_OF_KEY, PROPERTIES_KEY, READONLY_KEY, UI_OPTIONS_KEY, UI_GLOBAL_OPTIONS_KEY, } from '@rjsf/utils';
|
|
5
5
|
import cloneDeep from 'lodash-es/cloneDeep.js';
|
|
6
6
|
import each from 'lodash-es/each.js';
|
|
7
7
|
import flatten from 'lodash-es/flatten.js';
|
|
@@ -43,9 +43,6 @@ export const LAYOUT_GRID_UI_OPTION = 'layoutGrid';
|
|
|
43
43
|
/** The constant representing the main layout grid schema option name in the `uiSchema`
|
|
44
44
|
*/
|
|
45
45
|
export const LAYOUT_GRID_OPTION = `ui:${LAYOUT_GRID_UI_OPTION}`;
|
|
46
|
-
/** The constant representing the global UI Options object potentially contained within the `uiSchema`
|
|
47
|
-
*/
|
|
48
|
-
export const UI_GLOBAL_OPTIONS = 'ui:global_options';
|
|
49
46
|
/** Returns either the `value` if it is non-nullish or the fallback
|
|
50
47
|
*
|
|
51
48
|
* @param [value] - The potential value to return if it is non-nullish
|
|
@@ -297,7 +294,7 @@ export default class LayoutGridField extends PureComponent {
|
|
|
297
294
|
* @param [forceReadonly] - Optional flag indicating whether the Form itself is in readonly mode
|
|
298
295
|
*/
|
|
299
296
|
static computeFieldUiSchema(field, uiProps, uiSchema, schemaReadonly, forceReadonly) {
|
|
300
|
-
const globalUiOptions = get(uiSchema, [
|
|
297
|
+
const globalUiOptions = get(uiSchema, [UI_GLOBAL_OPTIONS_KEY], {});
|
|
301
298
|
const localUiSchema = get(uiSchema, field);
|
|
302
299
|
const localUiOptions = { ...get(localUiSchema, [UI_OPTIONS_KEY], {}), ...uiProps, ...globalUiOptions };
|
|
303
300
|
const fieldUiSchema = { ...localUiSchema };
|
|
@@ -306,7 +303,7 @@ export default class LayoutGridField extends PureComponent {
|
|
|
306
303
|
}
|
|
307
304
|
if (!isEmpty(globalUiOptions)) {
|
|
308
305
|
// pass the global uiOptions down to the field uiSchema so that they can be applied to all nested fields
|
|
309
|
-
set(fieldUiSchema, [
|
|
306
|
+
set(fieldUiSchema, [UI_GLOBAL_OPTIONS_KEY], globalUiOptions);
|
|
310
307
|
}
|
|
311
308
|
let { readonly: uiReadonly } = getUiOptions(fieldUiSchema);
|
|
312
309
|
if (forceReadonly === true || (isUndefined(uiReadonly) && schemaReadonly === true)) {
|