diff --git a/packages/core/lib/jsonforms-core.cjs.js b/packages/core/lib/jsonforms-core.cjs.js index 58811c8818..b0ddfafc97 100644 --- a/packages/core/lib/jsonforms-core.cjs.js +++ b/packages/core/lib/jsonforms-core.cjs.js @@ -1737,6 +1737,19 @@ var labelDescription = function (text, show) { return ({ show: show, }); }; +var dataPathToJsonPointer = function (dataPath) { + var parts = dataPath.split('.'); + var jsonPointer = '#'; + parts.forEach(function (part) { + if (part.match(/^\d+$/)) { + jsonPointer += '/items'; + } + else { + jsonPointer += "/properties/".concat(part); + } + }); + return jsonPointer; +}; var checkDataCondition = function (propertyCondition, property, data) { if (has__default["default"](propertyCondition, 'const')) { return (has__default["default"](data, property) && @@ -1760,7 +1773,7 @@ var checkPropertyCondition = function (propertiesCondition, property, data) { if (has__default["default"](propertiesCondition[property], 'not')) { return !checkDataCondition(get__default["default"](propertiesCondition[property], 'not'), property, data); } - if (has__default["default"](propertiesCondition[property], 'properties')) { + if (has__default["default"](propertiesCondition[property], 'properties') && has__default["default"](data, property)) { var nextPropertyConditions_1 = get__default["default"](propertiesCondition[property], 'properties'); return all__default["default"](function (prop) { return checkPropertyCondition(nextPropertyConditions_1, prop, data[property]); @@ -1805,9 +1818,13 @@ var extractRequired = function (schema, segment, prevSegments) { var i = 0; var currentSchema = schema; while (i < prevSegments.length && - has__default["default"](currentSchema, 'properties') && - has__default["default"](get__default["default"](currentSchema, 'properties'), prevSegments[i])) { - currentSchema = get__default["default"](get__default["default"](currentSchema, 'properties'), prevSegments[i]); + (has__default["default"](currentSchema, prevSegments[i]) || + (has__default["default"](currentSchema, 'properties') && + has__default["default"](get__default["default"](currentSchema, 'properties'), prevSegments[i])))) { + if (has__default["default"](currentSchema, 'properties')) { + currentSchema = get__default["default"](currentSchema, 'properties'); + } + currentSchema = get__default["default"](currentSchema, prevSegments[i]); ++i; } if (i < prevSegments.length) { @@ -1850,43 +1867,59 @@ var conditionallyRequired = function (schema, segment, prevSegments, data) { conditionallyRequired(subschema, segment, prevSegments, data)); }, nestedAllOfSchema); }; -var isRequiredInParent = function (schema, rootSchema, path, segment, prevSegments, data) { - var pathSegments = path.split('/'); - var lastSegment = pathSegments[pathSegments.length - 3]; - var nextHigherSchemaSegments = pathSegments.slice(0, pathSegments.length - 4); - if (!nextHigherSchemaSegments.length) { +var getNextHigherSchemaPath = function (schemaPath) { + var pathSegments = schemaPath.split('/'); + var lastSegment = pathSegments[pathSegments.length - 1]; + var nextHigherSegmentIndexDifference = lastSegment === 'items' ? 1 : 2; + var nextHigherSchemaSegments = pathSegments.slice(0, pathSegments.length - nextHigherSegmentIndexDifference); + return nextHigherSchemaSegments.join('/'); +}; +var getNextHigherDataPath = function (dataPath) { + var dataPathSegments = dataPath.split('.'); + return dataPathSegments.slice(0, dataPathSegments.length - 1).join('.'); +}; +var isRequiredInParent = function (schema, schemaPath, segment, prevSegments, data, dataPath) { + var pathSegments = schemaPath.split('/'); + var lastSegment = pathSegments[pathSegments.length - 1]; + var nextHigherSchemaPath = getNextHigherSchemaPath(schemaPath); + if (!nextHigherSchemaPath) { return false; } - var nextHigherSchemaPath = nextHigherSchemaSegments.join('/'); - var nextHigherSchema = Resolve.schema(schema, nextHigherSchemaPath, rootSchema); - var currentData = Resolve.data(data, toDataPath(nextHigherSchemaPath)); + var nextHigherSchema = Resolve.schema(schema, nextHigherSchemaPath, schema); + var nextHigherDataPath = getNextHigherDataPath(dataPath); + var currentData = Resolve.data(data, nextHigherDataPath); return (conditionallyRequired(nextHigherSchema, segment, __spreadArray([lastSegment], prevSegments, true), currentData) || (has__default["default"](nextHigherSchema, 'if') && checkRequiredInIf(nextHigherSchema, segment, __spreadArray([lastSegment], prevSegments, true), currentData)) || - isRequiredInParent(schema, rootSchema, nextHigherSchemaPath, segment, __spreadArray([lastSegment], prevSegments, true), currentData)); + isRequiredInParent(schema, nextHigherSchemaPath, segment, __spreadArray([lastSegment], prevSegments, true), + data, nextHigherDataPath)); }; -var isRequired = function (schema, schemaPath, rootSchema, data, config) { +var isRequiredInSchema = function (schema, segment) { + return (schema !== undefined && + schema.required !== undefined && + schema.required.indexOf(segment) !== -1); +}; +var isRequired = function (schema, schemaPath, rootSchema) { var pathSegments = schemaPath.split('/'); var lastSegment = pathSegments[pathSegments.length - 1]; var nextHigherSchemaSegments = pathSegments.slice(0, pathSegments.length - 2); var nextHigherSchemaPath = nextHigherSchemaSegments.join('/'); var nextHigherSchema = Resolve.schema(schema, nextHigherSchemaPath, rootSchema); - var currentData = Resolve.data(data, toDataPath(nextHigherSchemaPath)); - if (!(config === null || config === void 0 ? void 0 : config.allowDynamicCheck)) { - return (nextHigherSchema !== undefined && - nextHigherSchema.required !== undefined && - nextHigherSchema.required.indexOf(lastSegment) !== -1); - } + return isRequiredInSchema(nextHigherSchema, lastSegment); +}; +var isConditionallyRequired = function (rootSchema, schemaPath, data, dataPath) { + var pathSegments = schemaPath.split('/'); + var lastSegment = pathSegments[pathSegments.length - 1]; + var nextHigherSchemaPath = getNextHigherSchemaPath(schemaPath); + var nextHigherSchema = Resolve.schema(rootSchema, nextHigherSchemaPath, rootSchema); + var nextHigherDataPath = getNextHigherDataPath(dataPath); + var currentData = Resolve.data(data, nextHigherDataPath); var requiredInIf = has__default["default"](nextHigherSchema, 'if') && checkRequiredInIf(nextHigherSchema, lastSegment, [], currentData); var requiredConditionally = conditionallyRequired(nextHigherSchema, lastSegment, [], currentData); - var requiredConditionallyInParent = isRequiredInParent(rootSchema, rootSchema, schemaPath, lastSegment, [], data); - return ((nextHigherSchema !== undefined && - nextHigherSchema.required !== undefined && - nextHigherSchema.required.indexOf(lastSegment) !== -1) || - requiredInIf || - requiredConditionally || - requiredConditionallyInParent); + var requiredConditionallyInParent = isRequiredInParent(rootSchema, + nextHigherSchemaPath, lastSegment, [], data, nextHigherDataPath); + return requiredInIf || requiredConditionally || requiredConditionallyInParent; }; var computeLabel = function (label, required, hideRequiredAsterisk) { return "".concat(label !== null && label !== void 0 ? label : '').concat(required && !hideRequiredAsterisk ? '*' : ''); @@ -1991,7 +2024,8 @@ var mapStateToControlProps = function (state, ownProps) { var rootSchema = getSchema(state); var config = getConfig(state); var required = controlElement.scope !== undefined && - isRequired(ownProps.schema, controlElement.scope, rootSchema, rootData, config); + !!(isRequired(ownProps.schema, controlElement.scope, rootSchema) || + isConditionallyRequired(rootSchema, dataPathToJsonPointer(path), rootData, path)); var resolvedSchema = Resolve.schema(ownProps.schema || rootSchema, controlElement.scope, rootSchema); var errors = getErrorAt(path, resolvedSchema)(state); var description = resolvedSchema !== undefined ? resolvedSchema.description : ''; diff --git a/packages/core/lib/jsonforms-core.cjs.js.map b/packages/core/lib/jsonforms-core.cjs.js.map index 00b39fe3c4..add373e928 100644 --- a/packages/core/lib/jsonforms-core.cjs.js.map +++ b/packages/core/lib/jsonforms-core.cjs.js.map @@ -1 +1 @@ -{"version":3,"file":"jsonforms-core.cjs.js","sources":["../src/generators/schema.ts","../src/models/draft4.ts","../src/models/uischema.ts","../src/util/array.ts","../src/reducers/cells.ts","../src/configDefault.ts","../src/reducers/config.ts","../src/reducers/core.ts","../src/reducers/default-data.ts","../src/i18n/i18nUtil.ts","../src/i18n/arrayTranslations.ts","../src/i18n/combinatorTranslations.ts","../src/reducers/i18n.ts","../src/reducers/renderers.ts","../src/testers/testers.ts","../src/reducers/uischemas.ts","../src/reducers/reducers.ts","../src/reducers/selectors.ts","../src/reducers/middleware.ts","../src/util/path.ts","../src/util/resolvers.ts","../src/util/runtime.ts","../src/util/util.ts","../src/util/label.ts","../src/util/renderer.ts","../src/util/cell.ts","../src/util/combinators.ts","../src/util/ids.ts","../src/util/schema.ts","../src/util/uischema.ts","../src/util/validator.ts","../src/util/defaultDateFormat.ts","../src/generators/uischema.ts","../src/generators/Generate.ts","../src/actions/actions.ts","../src/Helpers.ts"],"sourcesContent":["/*\n The MIT License\n \n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport type { JsonSchema4 } from '../models';\n\nconst ADDITIONAL_PROPERTIES = 'additionalProperties';\nconst REQUIRED_PROPERTIES = 'required';\n\ntype Properties = { [property: string]: JsonSchema4 };\n\nconst distinct = (\n properties: any[],\n discriminator: (item: any) => string\n): JsonSchema4[] => {\n const known: { [property: string]: boolean } = {};\n\n return properties.filter((item) => {\n const discriminatorValue = discriminator(item);\n if (Object.prototype.hasOwnProperty.call(known, discriminatorValue)) {\n return false;\n } else {\n known[discriminatorValue] = true;\n return true;\n }\n });\n};\n\nclass Gen {\n constructor(\n private findOption: (props: Properties) => (optionName: string) => any\n ) {}\n\n // TODO fix @typescript-eslint/ban-types\n // eslint-disable-next-line @typescript-eslint/ban-types\n schemaObject = (data: Object): JsonSchema4 => {\n const props: Properties = this.properties(data);\n const schema: JsonSchema4 = {\n type: 'object',\n properties: props,\n additionalProperties: this.findOption(props)(ADDITIONAL_PROPERTIES),\n };\n const required = this.findOption(props)(REQUIRED_PROPERTIES);\n if (required.length > 0) {\n schema.required = required;\n }\n\n return schema;\n };\n\n properties = (data: any): Properties => {\n const emptyProps: Properties = {};\n\n return Object.keys(data).reduce((acc: Properties, propName: string) => {\n acc[propName] = this.property(data[propName]);\n\n return acc;\n }, emptyProps);\n };\n\n property = (data: any): JsonSchema4 => {\n switch (typeof data) {\n case 'string':\n return { type: 'string' };\n case 'boolean':\n return { type: 'boolean' };\n case 'number':\n if (Number.isInteger(data)) {\n return { type: 'integer' };\n }\n\n return { type: 'number' };\n case 'object':\n if (data == null) {\n return { type: 'null' };\n }\n\n return this.schemaObjectOrArray(data);\n default:\n return {};\n }\n };\n\n schemaObjectOrArray = (data: any): JsonSchema4 => {\n if (data instanceof Array) {\n return this.schemaArray(data as any[]);\n } else {\n return this.schemaObject(data);\n }\n };\n\n schemaArray = (data: any[]): JsonSchema4 => {\n if (data.length > 0) {\n const allProperties: JsonSchema4[] = data.map(this.property);\n const uniqueProperties = distinct(allProperties, (prop) =>\n JSON.stringify(prop)\n );\n if (uniqueProperties.length === 1) {\n return {\n type: 'array',\n items: uniqueProperties[0],\n };\n } else {\n return {\n type: 'array',\n items: {\n oneOf: uniqueProperties,\n },\n };\n }\n } else {\n return {\n type: 'array',\n items: {},\n };\n }\n };\n}\n\n/**\n * Generate a JSON schema based on the given data and any additional options.\n * @param {Object} instance the data to create a JSON schema for\n * @param {any} options any additional options that may alter the generated JSON schema\n * @returns {JsonSchema} the generated schema\n */\nexport const generateJsonSchema = (\n // TODO fix @typescript-eslint/ban-types\n // eslint-disable-next-line @typescript-eslint/ban-types\n instance: Object,\n options: any = {}\n): JsonSchema4 => {\n const findOption =\n (props: Properties) =>\n (optionName: string): boolean | string[] => {\n switch (optionName) {\n case ADDITIONAL_PROPERTIES:\n if (\n Object.prototype.hasOwnProperty.call(options, ADDITIONAL_PROPERTIES)\n ) {\n return options[ADDITIONAL_PROPERTIES];\n }\n\n return true;\n case REQUIRED_PROPERTIES:\n if (\n Object.prototype.hasOwnProperty.call(options, REQUIRED_PROPERTIES)\n ) {\n return options[REQUIRED_PROPERTIES](props);\n }\n\n return Object.keys(props);\n default:\n return;\n }\n };\n\n const gen = new Gen(findOption);\n\n return gen.schemaObject(instance);\n};\n","/*\n The MIT License\n \n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nexport const Draft4 = {\n id: 'http://json-schema.org/draft-04/schema#',\n $schema: 'http://json-schema.org/draft-04/schema#',\n description: 'Core schema meta-schema',\n definitions: {\n schemaArray: {\n type: 'array',\n minItems: 1,\n items: { $ref: '#' },\n },\n positiveInteger: {\n type: 'integer',\n minimum: 0,\n },\n positiveIntegerDefault0: {\n allOf: [{ $ref: '#/definitions/positiveInteger' }, { default: 0 }],\n },\n simpleTypes: {\n enum: [\n 'array',\n 'boolean',\n 'integer',\n 'null',\n 'number',\n 'object',\n 'string',\n ],\n },\n stringArray: {\n type: 'array',\n items: { type: 'string' },\n minItems: 1,\n uniqueItems: true,\n },\n },\n type: 'object',\n properties: {\n id: {\n type: 'string',\n format: 'uri',\n },\n $schema: {\n type: 'string',\n format: 'uri',\n },\n title: {\n type: 'string',\n },\n description: {\n type: 'string',\n },\n default: {},\n multipleOf: {\n type: 'number',\n minimum: 0,\n exclusiveMinimum: true,\n },\n maximum: {\n type: 'number',\n },\n exclusiveMaximum: {\n type: 'boolean',\n default: false,\n },\n minimum: {\n type: 'number',\n },\n exclusiveMinimum: {\n type: 'boolean',\n default: false,\n },\n maxLength: { $ref: '#/definitions/positiveInteger' },\n minLength: { $ref: '#/definitions/positiveIntegerDefault0' },\n pattern: {\n type: 'string',\n format: 'regex',\n },\n additionalItems: {\n anyOf: [{ type: 'boolean' }, { $ref: '#' }],\n default: {},\n },\n items: {\n anyOf: [{ $ref: '#' }, { $ref: '#/definitions/schemaArray' }],\n default: {},\n },\n maxItems: { $ref: '#/definitions/positiveInteger' },\n minItems: { $ref: '#/definitions/positiveIntegerDefault0' },\n uniqueItems: {\n type: 'boolean',\n default: false,\n },\n maxProperties: { $ref: '#/definitions/positiveInteger' },\n minProperties: { $ref: '#/definitions/positiveIntegerDefault0' },\n required: { $ref: '#/definitions/stringArray' },\n additionalProperties: {\n anyOf: [{ type: 'boolean' }, { $ref: '#' }],\n default: {},\n },\n definitions: {\n type: 'object',\n additionalProperties: { $ref: '#' },\n default: {},\n },\n properties: {\n type: 'object',\n additionalProperties: { $ref: '#' },\n default: {},\n },\n patternProperties: {\n type: 'object',\n additionalProperties: { $ref: '#' },\n default: {},\n },\n dependencies: {\n type: 'object',\n additionalProperties: {\n anyOf: [{ $ref: '#' }, { $ref: '#/definitions/stringArray' }],\n },\n },\n enum: {\n type: 'array',\n minItems: 1,\n uniqueItems: true,\n },\n type: {\n anyOf: [\n { $ref: '#/definitions/simpleTypes' },\n {\n type: 'array',\n items: { $ref: '#/definitions/simpleTypes' },\n minItems: 1,\n uniqueItems: true,\n },\n ],\n },\n allOf: { $ref: '#/definitions/schemaArray' },\n anyOf: { $ref: '#/definitions/schemaArray' },\n oneOf: { $ref: '#/definitions/schemaArray' },\n not: { $ref: '#' },\n },\n dependencies: {\n exclusiveMaximum: ['maximum'],\n exclusiveMinimum: ['minimum'],\n },\n default: {},\n};\n","/*\n The MIT License\n \n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport type { JsonSchema } from './jsonSchema';\n\n/**\n * Interface for describing an UI schema element that is referencing\n * a subschema. The value of the scope may be a JSON Pointer.\n */\nexport interface Scopable {\n /**\n * The scope that determines to which part this element should be bound to.\n */\n scope?: string;\n}\n\n/**\n * Interface for describing an UI schema element that is referencing\n * a subschema. The value of the scope must be a JSON Pointer.\n */\nexport interface Scoped extends Scopable {\n /**\n * The scope that determines to which part this element should be bound to.\n */\n scope: string;\n}\n\n/**\n * Interface for describing an UI schema element that may be labeled.\n */\nexport interface Labelable {\n /**\n * Label for UI schema element.\n */\n label?: string | T;\n}\n\n/**\n * Interface for describing an UI schema element that is labeled.\n */\nexport interface Labeled extends Labelable {\n label: string | T;\n}\n\n/*\n * Interface for describing an UI schema element that can provide an internationalization base key.\n * If defined, this key is suffixed to derive applicable message keys for the UI schema element.\n * For example, such suffixes are `.label` or `.description` to derive the corresponding message keys for a control element.\n */\nexport interface Internationalizable {\n i18n?: string;\n}\n\n/**\n * A rule that may be attached to any UI schema element.\n */\nexport interface Rule {\n /**\n * The effect of the rule\n */\n effect: RuleEffect;\n\n /**\n * The condition of the rule that must evaluate to true in order\n * to trigger the effect.\n */\n condition: Condition;\n}\n\n/**\n * The different rule effects.\n */\nexport enum RuleEffect {\n /**\n * Effect that hides the associated element.\n */\n HIDE = 'HIDE',\n /**\n * Effect that shows the associated element.\n */\n SHOW = 'SHOW',\n /**\n * Effect that enables the associated element.\n */\n ENABLE = 'ENABLE',\n /**\n * Effect that disables the associated element.\n */\n DISABLE = 'DISABLE',\n}\n\n/**\n * Represents a condition to be evaluated.\n */\nexport interface Condition {\n /**\n * The type of condition.\n */\n readonly type?: string;\n}\n\n/**\n * A leaf condition.\n */\nexport interface LeafCondition extends Condition, Scoped {\n type: 'LEAF';\n\n /**\n * The expected value when evaluating the condition\n */\n expectedValue: any;\n}\n\nexport interface SchemaBasedCondition extends Condition, Scoped {\n schema: JsonSchema;\n\n /**\n * When the scope resolves to undefined and `failWhenUndefined` is set to `true`, the condition\n * will fail. Therefore the reverse effect will be applied.\n *\n * Background:\n * Most JSON Schemas will successfully validate against `undefined` data. Specifying that a\n * condition shall fail when data is `undefined` requires to lift the scope to being able to use\n * JSON Schema's `required`.\n *\n * Using `failWhenUndefined` allows to more conveniently express this condition.\n */\n failWhenUndefined?: boolean;\n}\n\n/**\n * A composable condition.\n */\nexport interface ComposableCondition extends Condition {\n conditions: Condition[];\n}\n\n/**\n * An or condition.\n */\nexport interface OrCondition extends ComposableCondition {\n type: 'OR';\n}\n\n/**\n * An and condition.\n */\nexport interface AndCondition extends ComposableCondition {\n type: 'AND';\n}\n\n/**\n * Common base interface for any UI schema element.\n */\nexport interface UISchemaElement {\n /**\n * The type of this UI schema element.\n */\n type: string;\n\n /**\n * An optional rule.\n */\n rule?: Rule;\n\n /**\n * Any additional options.\n */\n options?: { [key: string]: any };\n}\n\n/**\n * Represents a layout element which can order its children\n * in a specific way.\n */\nexport interface Layout extends UISchemaElement {\n /**\n * The child elements of this layout.\n */\n elements: UISchemaElement[];\n}\n\n/**\n * A layout which orders its child elements vertically (i.e. from top to bottom).\n */\nexport interface VerticalLayout extends Layout {\n type: 'VerticalLayout';\n}\n\n/**\n * A layout which orders its children horizontally (i.e. from left to right).\n */\nexport interface HorizontalLayout extends Layout {\n type: 'HorizontalLayout';\n}\n\n/**\n * A group resembles a vertical layout, but additionally might have a label.\n * This layout is useful when grouping different elements by a certain criteria.\n */\nexport interface GroupLayout extends Layout, Labelable, Internationalizable {\n type: 'Group';\n}\n\n/**\n * Represents an object that can be used to configure a label.\n */\nexport interface LabelDescription {\n /**\n * An optional text to be displayed.\n */\n text?: string;\n /**\n * Optional property that determines whether to show this label.\n */\n show?: boolean;\n}\n\n/**\n * A label element.\n */\nexport interface LabelElement extends UISchemaElement, Internationalizable {\n type: 'Label';\n /**\n * The text of label.\n */\n text: string;\n}\n\n/**\n * A control element. The scope property of the control determines\n * to which part of the schema the control should be bound.\n */\nexport interface ControlElement\n extends UISchemaElement,\n Scoped,\n Labelable,\n Internationalizable {\n type: 'Control';\n}\n\n/**\n * The category layout.\n */\nexport interface Category extends Layout, Labeled, Internationalizable {\n type: 'Category';\n}\n\n/**\n * The categorization element, which may have children elements.\n * A child element may either be itself a Categorization or a Category, hence\n * the categorization element can be used to represent recursive structures like trees.\n */\nexport interface Categorization\n extends UISchemaElement,\n Labeled,\n Internationalizable {\n type: 'Categorization';\n /**\n * The child elements of this categorization which are either of type\n * {@link Category} or {@link Categorization}.\n */\n elements: (Category | Categorization)[];\n}\n\nexport const isInternationalized = (\n element: unknown\n): element is Required =>\n typeof element === 'object' &&\n element !== null &&\n typeof (element as Internationalizable).i18n === 'string';\n\nexport const isGroup = (layout: Layout): layout is GroupLayout =>\n layout.type === 'Group';\n\nexport const isLayout = (uischema: UISchemaElement): uischema is Layout =>\n (uischema as Layout).elements !== undefined;\n\nexport const isScopable = (obj: unknown): obj is Scopable =>\n !!obj && typeof obj === 'object';\n\nexport const isScoped = (obj: unknown): obj is Scoped =>\n isScopable(obj) && typeof obj.scope === 'string';\n\nexport const isLabelable = (obj: unknown): obj is Labelable =>\n !!obj && typeof obj === 'object';\n\nexport const isLabeled = (obj: unknown): obj is Labeled =>\n isLabelable(obj) && ['string', 'boolean'].includes(typeof obj.label);\n","/*\n The MIT License\n\n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nconst move = (array: any[], index: number, delta: number) => {\n const newIndex: number = index + delta;\n if (newIndex < 0 || newIndex >= array.length) {\n return;\n } // Already at the top or bottom.\n const indexes: number[] = [index, newIndex].sort((a, b) => a - b); // Sort the indixes\n array.splice(indexes[0], 2, array[indexes[1]], array[indexes[0]]);\n};\n\nconst moveUp = (array: any[], toMove: number) => {\n move(array, toMove, -1);\n};\n\nconst moveDown = (array: any[], toMove: number) => {\n move(array, toMove, 1);\n};\n\nexport { moveUp, moveDown };\n","/*\n The MIT License\n \n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport type { RankedTester } from '../testers';\nimport {\n ADD_CELL,\n AddCellRendererAction,\n REMOVE_CELL,\n RemoveCellRendererAction,\n} from '../actions';\nimport type { Reducer } from '../util';\n\ntype ValidCellReducerActions = AddCellRendererAction | RemoveCellRendererAction;\n\nexport type JsonFormsCellRendererRegistryState =\n JsonFormsCellRendererRegistryEntry[];\n\nexport interface JsonFormsCellRendererRegistryEntry {\n tester: RankedTester;\n cell: any;\n}\n\nexport const cellReducer: Reducer<\n JsonFormsCellRendererRegistryState,\n ValidCellReducerActions\n> = (state = [], { type, tester, cell }) => {\n switch (type) {\n case ADD_CELL:\n return state.concat([{ tester, cell }]);\n case REMOVE_CELL:\n return state.filter((t) => t.tester !== tester);\n default:\n return state;\n }\n};\n","/*\n The MIT License\n\n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nexport const configDefault = {\n /*\n * [text] whether to restrict the number of characters to maxLength,\n * if specified in the JSON schema\n */\n restrict: false,\n\n /*\n * [text] whether to resize the input's width to maxLength,\n * if specified in the JSON schema\n */\n trim: false,\n\n /*\n * [text] if input descriptions should hide when not focused\n */\n showUnfocusedDescription: false,\n\n /*\n * [text] if asterisks in labels for required fields should be hidden\n */\n hideRequiredAsterisk: false,\n\n /**\n * [text] if dynamic checks for conditional application of properties\n * should be performed (e.g. check for conditional required)\n */\n allowDynamicCheck: false,\n};\n","/*\n The MIT License\n \n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport merge from 'lodash/merge';\nimport { SET_CONFIG, SetConfigAction } from '../actions';\nimport { configDefault } from '../configDefault';\nimport type { Reducer } from '../util';\n\nconst applyDefaultConfiguration = (config: any = {}) =>\n merge({}, configDefault, config);\n\nexport const configReducer: Reducer = (\n state = applyDefaultConfiguration(),\n action\n) => {\n switch (action.type) {\n case SET_CONFIG:\n return applyDefaultConfiguration(action.config);\n default:\n return state;\n }\n};\n","/*\n The MIT License\n\n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport cloneDeep from 'lodash/cloneDeep';\nimport setFp from 'lodash/fp/set';\nimport unsetFp from 'lodash/fp/unset';\nimport get from 'lodash/get';\nimport filter from 'lodash/filter';\nimport isEqual from 'lodash/isEqual';\nimport isFunction from 'lodash/isFunction';\nimport type Ajv from 'ajv';\nimport type { ErrorObject, ValidateFunction } from 'ajv';\nimport {\n CoreActions,\n INIT,\n InitAction,\n InitActionOptions,\n SET_AJV,\n SET_SCHEMA,\n SET_UISCHEMA,\n SET_VALIDATION_MODE,\n UPDATE_DATA,\n UPDATE_ERRORS,\n UPDATE_CORE,\n UpdateCoreAction,\n} from '../actions';\nimport { createAjv, decode, isOneOfEnumSchema, Reducer } from '../util';\nimport type { JsonSchema, UISchemaElement } from '../models';\n\nexport const validate = (\n validator: ValidateFunction | undefined,\n data: any\n): ErrorObject[] => {\n if (validator === undefined) {\n return [];\n }\n const valid = validator(data);\n if (valid) {\n return [];\n }\n return validator.errors;\n};\n\nexport type ValidationMode =\n | 'ValidateAndShow'\n | 'ValidateAndHide'\n | 'NoValidation';\n\nexport interface JsonFormsCore {\n data: any;\n schema: JsonSchema;\n uischema: UISchemaElement;\n errors?: ErrorObject[];\n additionalErrors?: ErrorObject[];\n validator?: ValidateFunction;\n ajv?: Ajv;\n validationMode?: ValidationMode;\n}\n\nconst initState: JsonFormsCore = {\n data: {},\n schema: {},\n uischema: undefined,\n errors: [],\n validator: undefined,\n ajv: undefined,\n validationMode: 'ValidateAndShow',\n additionalErrors: [],\n};\n\nconst getOrCreateAjv = (\n state: JsonFormsCore,\n action?: InitAction | UpdateCoreAction\n): Ajv => {\n if (action) {\n if (hasAjvOption(action.options)) {\n // options object with ajv\n return action.options.ajv;\n } else if (action.options !== undefined) {\n // it is not an option object => should be ajv itself => check for compile function\n if (isFunction(action.options.compile)) {\n return action.options;\n }\n }\n }\n return state.ajv ? state.ajv : createAjv();\n};\n\nconst hasAjvOption = (option: any): option is InitActionOptions => {\n if (option) {\n return option.ajv !== undefined;\n }\n return false;\n};\n\nconst getValidationMode = (\n state: JsonFormsCore,\n action?: InitAction | UpdateCoreAction\n): ValidationMode => {\n if (action && hasValidationModeOption(action.options)) {\n return action.options.validationMode;\n }\n return state.validationMode;\n};\n\nconst hasValidationModeOption = (option: any): option is InitActionOptions => {\n if (option) {\n return option.validationMode !== undefined;\n }\n return false;\n};\n\nconst hasAdditionalErrorsOption = (\n option: any\n): option is InitActionOptions => {\n if (option) {\n return option.additionalErrors !== undefined;\n }\n return false;\n};\n\nconst getAdditionalErrors = (\n state: JsonFormsCore,\n action?: InitAction | UpdateCoreAction\n): ErrorObject[] => {\n if (action && hasAdditionalErrorsOption(action.options)) {\n return action.options.additionalErrors;\n }\n return state.additionalErrors;\n};\n\nexport const coreReducer: Reducer = (\n state = initState,\n action\n) => {\n switch (action.type) {\n case INIT: {\n const thisAjv = getOrCreateAjv(state, action);\n\n const validationMode = getValidationMode(state, action);\n const v =\n validationMode === 'NoValidation'\n ? undefined\n : thisAjv.compile(action.schema);\n const e = validate(v, action.data);\n const additionalErrors = getAdditionalErrors(state, action);\n\n return {\n ...state,\n data: action.data,\n schema: action.schema,\n uischema: action.uischema,\n additionalErrors,\n errors: e,\n validator: v,\n ajv: thisAjv,\n validationMode,\n };\n }\n case UPDATE_CORE: {\n const thisAjv = getOrCreateAjv(state, action);\n const validationMode = getValidationMode(state, action);\n let validator = state.validator;\n let errors = state.errors;\n if (\n state.schema !== action.schema ||\n state.validationMode !== validationMode ||\n state.ajv !== thisAjv\n ) {\n // revalidate only if necessary\n validator =\n validationMode === 'NoValidation'\n ? undefined\n : thisAjv.compile(action.schema);\n errors = validate(validator, action.data);\n } else if (state.data !== action.data) {\n errors = validate(validator, action.data);\n }\n const additionalErrors = getAdditionalErrors(state, action);\n\n const stateChanged =\n state.data !== action.data ||\n state.schema !== action.schema ||\n state.uischema !== action.uischema ||\n state.ajv !== thisAjv ||\n state.errors !== errors ||\n state.validator !== validator ||\n state.validationMode !== validationMode ||\n state.additionalErrors !== additionalErrors;\n return stateChanged\n ? {\n ...state,\n data: action.data,\n schema: action.schema,\n uischema: action.uischema,\n ajv: thisAjv,\n errors: isEqual(errors, state.errors) ? state.errors : errors,\n validator: validator,\n validationMode: validationMode,\n additionalErrors,\n }\n : state;\n }\n case SET_AJV: {\n const currentAjv = action.ajv;\n const validator =\n state.validationMode === 'NoValidation'\n ? undefined\n : currentAjv.compile(state.schema);\n const errors = validate(validator, state.data);\n return {\n ...state,\n validator,\n errors,\n };\n }\n case SET_SCHEMA: {\n const needsNewValidator =\n action.schema && state.ajv && state.validationMode !== 'NoValidation';\n const v = needsNewValidator\n ? state.ajv.compile(action.schema)\n : state.validator;\n const errors = validate(v, state.data);\n return {\n ...state,\n validator: v,\n schema: action.schema,\n errors,\n };\n }\n case SET_UISCHEMA: {\n return {\n ...state,\n uischema: action.uischema,\n };\n }\n case UPDATE_DATA: {\n if (action.path === undefined || action.path === null) {\n return state;\n } else if (action.path === '') {\n // empty path is ok\n const result = action.updater(cloneDeep(state.data));\n const errors = validate(state.validator, result);\n return {\n ...state,\n data: result,\n errors,\n };\n } else {\n const oldData: any = get(state.data, action.path);\n const newData = action.updater(cloneDeep(oldData));\n let newState: any;\n if (newData !== undefined) {\n newState = setFp(\n action.path,\n newData,\n state.data === undefined ? {} : state.data\n );\n } else {\n newState = unsetFp(\n action.path,\n state.data === undefined ? {} : state.data\n );\n }\n const errors = validate(state.validator, newState);\n return {\n ...state,\n data: newState,\n errors,\n };\n }\n }\n case UPDATE_ERRORS: {\n return {\n ...state,\n errors: action.errors,\n };\n }\n case SET_VALIDATION_MODE: {\n if (state.validationMode === action.validationMode) {\n return state;\n }\n if (action.validationMode === 'NoValidation') {\n const errors = validate(undefined, state.data);\n return {\n ...state,\n errors,\n validationMode: action.validationMode,\n };\n }\n if (state.validationMode === 'NoValidation') {\n const validator = state.ajv.compile(state.schema);\n const errors = validate(validator, state.data);\n return {\n ...state,\n validator,\n errors,\n validationMode: action.validationMode,\n };\n }\n return {\n ...state,\n validationMode: action.validationMode,\n };\n }\n default:\n return state;\n }\n};\n\nexport const extractData = (state: JsonFormsCore) => get(state, 'data');\nexport const extractSchema = (state: JsonFormsCore) => get(state, 'schema');\nexport const extractUiSchema = (state: JsonFormsCore) => get(state, 'uischema');\nexport const extractAjv = (state: JsonFormsCore) => get(state, 'ajv');\n\nconst getInvalidProperty = (error: ErrorObject): string | undefined => {\n switch (error.keyword) {\n case 'required':\n case 'dependencies':\n return error.params.missingProperty;\n case 'additionalProperties':\n return error.params.additionalProperty;\n default:\n return undefined;\n }\n};\n\nexport const getControlPath = (error: ErrorObject) => {\n // Up until AJV v7 the path property was called 'dataPath'\n // With AJV v8 the property was renamed to 'instancePath'\n let controlPath = (error as any).dataPath || error.instancePath || '';\n\n // change '/' chars to '.'\n controlPath = controlPath.replace(/\\//g, '.');\n\n const invalidProperty = getInvalidProperty(error);\n if (invalidProperty !== undefined && !controlPath.endsWith(invalidProperty)) {\n controlPath = `${controlPath}.${invalidProperty}`;\n }\n\n // remove '.' chars at the beginning of paths\n controlPath = controlPath.replace(/^./, '');\n\n // decode JSON Pointer escape sequences\n controlPath = decode(controlPath);\n return controlPath;\n};\n\nexport const errorsAt =\n (\n instancePath: string,\n schema: JsonSchema,\n matchPath: (path: string) => boolean\n ) =>\n (errors: ErrorObject[]): ErrorObject[] => {\n // Get data paths of oneOf and anyOf errors to later determine whether an error occurred inside a subschema of oneOf or anyOf.\n const combinatorPaths = filter(\n errors,\n (error) => error.keyword === 'oneOf' || error.keyword === 'anyOf'\n ).map((error) => getControlPath(error));\n\n return filter(errors, (error) => {\n // Filter errors that match any keyword that we don't want to show in the UI\n // but keep the errors for oneOf enums\n if (\n filteredErrorKeywords.indexOf(error.keyword) !== -1 &&\n !isOneOfEnumSchema(error.parentSchema)\n ) {\n return false;\n }\n const controlPath = getControlPath(error);\n let result = matchPath(controlPath);\n // In anyOf and oneOf blocks with \"primitive\" (i.e. string, number etc.) or array subschemas,\n // we want to make sure that errors are only shown for the correct subschema.\n // Therefore, we compare the error's parent schema with the property's schema.\n // In the primitive case the error's data path is the same for all subschemas:\n // It directly points to the property defining the anyOf/oneOf.\n // The same holds true for errors on the array level (e.g. min item amount).\n // In contrast, this comparison must not be done for errors whose parent schema defines an object or a oneOf enum,\n // because the parent schema can never match the property schema (e.g. for 'required' checks).\n const parentSchema: JsonSchema | undefined = error.parentSchema;\n if (\n result &&\n !isObjectSchema(parentSchema) &&\n !isOneOfEnumSchema(parentSchema) &&\n combinatorPaths.findIndex((p) => instancePath.startsWith(p)) !== -1\n ) {\n result = result && isEqual(parentSchema, schema);\n }\n return result;\n });\n };\n\n/**\n * @returns true if the schema describes an object.\n */\nconst isObjectSchema = (schema?: JsonSchema): boolean => {\n return schema?.type === 'object' || !!schema?.properties;\n};\n\n/**\n * The error-type of an AJV error is defined by its `keyword` property.\n * Certain errors are filtered because they don't fit to any rendered control.\n * All of them have in common that we don't want to show them in the UI\n * because controls will show the actual reason why they don't match their correponding sub schema.\n * - additionalProperties: Indicates that a property is present that is not defined in the schema.\n * Jsonforms only allows to edit defined properties. These errors occur if an oneOf doesn't match.\n * - allOf: Indicates that not all of the allOf definitions match as a whole.\n * - anyOf: Indicates that an anyOf definition itself is not valid because none of its subschemas matches.\n * - oneOf: Indicates that an oneOf definition itself is not valid because not exactly one of its subschemas matches.\n */\nconst filteredErrorKeywords = [\n 'additionalProperties',\n 'allOf',\n 'anyOf',\n 'oneOf',\n];\n\nconst getErrorsAt =\n (\n instancePath: string,\n schema: JsonSchema,\n matchPath: (path: string) => boolean\n ) =>\n (state: JsonFormsCore): ErrorObject[] => {\n const errors = state.errors ?? [];\n const additionalErrors = state.additionalErrors ?? [];\n return errorsAt(\n instancePath,\n schema,\n matchPath\n )(\n state.validationMode === 'ValidateAndHide'\n ? additionalErrors\n : [...errors, ...additionalErrors]\n );\n };\n\nexport const errorAt = (instancePath: string, schema: JsonSchema) =>\n getErrorsAt(instancePath, schema, (path) => path === instancePath);\nexport const subErrorsAt = (instancePath: string, schema: JsonSchema) =>\n getErrorsAt(instancePath, schema, (path) =>\n path.startsWith(instancePath + '.')\n );\n","/*\n The MIT License\n\n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport {\n ADD_DEFAULT_DATA,\n RegisterDefaultDataAction,\n REMOVE_DEFAULT_DATA,\n UnregisterDefaultDataAction,\n} from '../actions';\nimport type { Reducer } from '../util';\n\nexport interface JsonFormsDefaultDataRegistryEntry {\n schemaPath: string;\n data: any;\n}\n\ntype ValidDefaultDataActions =\n | RegisterDefaultDataAction\n | UnregisterDefaultDataAction;\n\nexport const defaultDataReducer: Reducer<\n JsonFormsDefaultDataRegistryEntry[],\n ValidDefaultDataActions\n> = (state = [], action) => {\n switch (action.type) {\n case ADD_DEFAULT_DATA:\n return state.concat([\n { schemaPath: action.schemaPath, data: action.data },\n ]);\n case REMOVE_DEFAULT_DATA:\n return state.filter((t) => t.schemaPath !== action.schemaPath);\n default:\n return state;\n }\n};\n\nexport const extractDefaultData = (\n state: JsonFormsDefaultDataRegistryEntry[]\n): JsonFormsDefaultDataRegistryEntry[] => state;\n","import type { ErrorObject } from 'ajv';\nimport { isInternationalized, Labelable, UISchemaElement } from '../models';\nimport { getControlPath } from '../reducers';\nimport { formatErrorMessage } from '../util';\nimport type { i18nJsonSchema, ErrorTranslator, Translator } from './i18nTypes';\nimport {\n ArrayDefaultTranslation,\n ArrayTranslations,\n} from './arrayTranslations';\nimport {\n CombinatorDefaultTranslation,\n CombinatorTranslations,\n} from './combinatorTranslations';\n\nexport const getI18nKeyPrefixBySchema = (\n schema: i18nJsonSchema | undefined,\n uischema: unknown | undefined\n): string | undefined => {\n if (isInternationalized(uischema)) {\n return uischema.i18n;\n }\n return schema?.i18n ?? undefined;\n};\n\n/**\n * Transforms a given path to a prefix which can be used for i18n keys.\n * Returns 'root' for empty paths and removes array indices\n */\nexport const transformPathToI18nPrefix = (path: string): string => {\n return (\n path\n ?.split('.')\n .filter((segment) => !/^\\d+$/.test(segment))\n .join('.') || 'root'\n );\n};\n\nexport const getI18nKeyPrefix = (\n schema: i18nJsonSchema | undefined,\n uischema: unknown | undefined,\n path: string | undefined\n): string => {\n return (\n getI18nKeyPrefixBySchema(schema, uischema) ??\n transformPathToI18nPrefix(path)\n );\n};\n\nexport const getI18nKey = (\n schema: i18nJsonSchema | undefined,\n uischema: unknown | undefined,\n path: string | undefined,\n key: string\n): string => {\n return `${getI18nKeyPrefix(schema, uischema, path)}.${key}`;\n};\n\nexport const addI18nKeyToPrefix = (\n i18nKeyPrefix: string,\n key: string\n): string => {\n return `${i18nKeyPrefix}.${key}`;\n};\n\nexport const defaultTranslator: Translator = (\n _id: string,\n defaultMessage: string | undefined\n) => defaultMessage;\n\nexport const defaultErrorTranslator: ErrorTranslator = (error, t, uischema) => {\n // check whether there is a special keyword message\n const i18nKey = getI18nKey(\n error.parentSchema,\n uischema,\n getControlPath(error),\n `error.${error.keyword}`\n );\n const specializedKeywordMessage = t(i18nKey, undefined, { error });\n if (specializedKeywordMessage !== undefined) {\n return specializedKeywordMessage;\n }\n\n // check whether there is a generic keyword message\n const genericKeywordMessage = t(`error.${error.keyword}`, undefined, {\n error,\n });\n if (genericKeywordMessage !== undefined) {\n return genericKeywordMessage;\n }\n\n // check whether there is a customization for the default message\n const messageCustomization = t(error.message, undefined, { error });\n if (messageCustomization !== undefined) {\n return messageCustomization;\n }\n\n // rewrite required property messages (if they were not customized) as we place them next to the respective input\n if (\n error.keyword === 'required' &&\n error.message?.startsWith('must have required property')\n ) {\n return t('is a required property', 'is a required property', { error });\n }\n\n return error.message;\n};\n\n/**\n * Returns the determined error message for the given errors.\n * All errors must correspond to the given schema, uischema or path.\n */\nexport const getCombinedErrorMessage = (\n errors: ErrorObject[],\n et: ErrorTranslator,\n t: Translator,\n schema?: i18nJsonSchema,\n uischema?: UISchemaElement,\n path?: string\n) => {\n if (errors.length > 0 && t) {\n // check whether there is a special message which overwrites all others\n const customErrorKey = getI18nKey(schema, uischema, path, 'error.custom');\n const specializedErrorMessage = t(customErrorKey, undefined, {\n schema,\n uischema,\n path,\n errors,\n });\n if (specializedErrorMessage !== undefined) {\n return specializedErrorMessage;\n }\n }\n return formatErrorMessage(errors.map((error) => et(error, t, uischema)));\n};\n\n/**\n * This can be used to internationalize the label of the given Labelable (e.g. UI Schema elements).\n * This should not be used for controls as there we have additional context in the form of the JSON Schema available.\n */\nexport const deriveLabelForUISchemaElement = (\n uischema: Labelable,\n t: Translator\n): string | undefined => {\n if (uischema.label === false) {\n return undefined;\n }\n if (\n (uischema.label === undefined ||\n uischema.label === null ||\n uischema.label === true) &&\n !isInternationalized(uischema)\n ) {\n return undefined;\n }\n const stringifiedLabel =\n typeof uischema.label === 'string'\n ? uischema.label\n : JSON.stringify(uischema.label);\n const i18nKeyPrefix = getI18nKeyPrefixBySchema(undefined, uischema);\n const i18nKey =\n typeof i18nKeyPrefix === 'string'\n ? `${i18nKeyPrefix}.label`\n : stringifiedLabel;\n return t(i18nKey, stringifiedLabel, { uischema: uischema });\n};\n\nexport const getArrayTranslations = (\n t: Translator,\n defaultTranslations: ArrayDefaultTranslation[],\n i18nKeyPrefix: string,\n label: string\n): ArrayTranslations => {\n const translations: ArrayTranslations = {};\n defaultTranslations.forEach((controlElement) => {\n const key = addI18nKeyToPrefix(i18nKeyPrefix, controlElement.key);\n translations[controlElement.key] = t(key, controlElement.default(label));\n });\n return translations;\n};\n\nexport const getCombinatorTranslations = (\n t: Translator,\n defaultTranslations: CombinatorDefaultTranslation[],\n i18nKeyPrefix: string,\n label: string\n): CombinatorTranslations => {\n const translations: CombinatorTranslations = {};\n defaultTranslations.forEach((controlElement) => {\n const key = addI18nKeyToPrefix(i18nKeyPrefix, controlElement.key);\n translations[controlElement.key] = t(key, controlElement.default(label));\n });\n return translations;\n};\n","export interface ArrayDefaultTranslation {\n key: ArrayTranslationEnum;\n default: (variable?: string) => string;\n}\n\nexport enum ArrayTranslationEnum {\n addTooltip = 'addTooltip',\n addAriaLabel = 'addAriaLabel',\n removeTooltip = 'removeTooltip',\n upAriaLabel = 'upAriaLabel',\n downAriaLabel = 'downAriaLabel',\n noSelection = 'noSelection',\n removeAriaLabel = 'removeAriaLabel',\n noDataMessage = 'noDataMessage',\n deleteDialogTitle = 'deleteDialogTitle',\n deleteDialogMessage = 'deleteDialogMessage',\n deleteDialogAccept = 'deleteDialogAccept',\n deleteDialogDecline = 'deleteDialogDecline',\n up = 'up',\n down = 'down',\n}\n\nexport type ArrayTranslations = {\n [key in ArrayTranslationEnum]?: string;\n};\n\nexport const arrayDefaultTranslations: ArrayDefaultTranslation[] = [\n {\n key: ArrayTranslationEnum.addTooltip,\n default: (input) => (input ? `Add to ${input}` : 'Add'),\n },\n {\n key: ArrayTranslationEnum.addAriaLabel,\n default: (input) => (input ? `Add to ${input} button` : 'Add button'),\n },\n { key: ArrayTranslationEnum.removeTooltip, default: () => 'Delete' },\n { key: ArrayTranslationEnum.removeAriaLabel, default: () => 'Delete button' },\n { key: ArrayTranslationEnum.upAriaLabel, default: () => `Move item up` },\n { key: ArrayTranslationEnum.up, default: () => 'Up' },\n { key: ArrayTranslationEnum.down, default: () => 'Down' },\n { key: ArrayTranslationEnum.downAriaLabel, default: () => `Move item down` },\n { key: ArrayTranslationEnum.noDataMessage, default: () => 'No data' },\n { key: ArrayTranslationEnum.noSelection, default: () => 'No selection' },\n {\n key: ArrayTranslationEnum.deleteDialogTitle,\n default: () => 'Confirm Deletion',\n },\n {\n key: ArrayTranslationEnum.deleteDialogMessage,\n default: () => 'Are you sure you want to delete the selected entry?',\n },\n { key: ArrayTranslationEnum.deleteDialogAccept, default: () => 'Yes' },\n { key: ArrayTranslationEnum.deleteDialogDecline, default: () => 'No' },\n];\n","export interface CombinatorDefaultTranslation {\n key: CombinatorTranslationEnum;\n default: (variable?: string) => string;\n}\n\nexport enum CombinatorTranslationEnum {\n clearDialogTitle = 'clearDialogTitle',\n clearDialogMessage = 'clearDialogMessage',\n clearDialogAccept = 'clearDialogAccept',\n clearDialogDecline = 'clearDialogDecline',\n}\n\nexport type CombinatorTranslations = {\n [key in CombinatorTranslationEnum]?: string;\n};\n\nexport const combinatorDefaultTranslations: CombinatorDefaultTranslation[] = [\n {\n key: CombinatorTranslationEnum.clearDialogTitle,\n default: () => 'Clear form?',\n },\n {\n key: CombinatorTranslationEnum.clearDialogMessage,\n default: () => 'Your data will be cleared. Do you want to proceed?',\n },\n { key: CombinatorTranslationEnum.clearDialogAccept, default: () => 'Yes' },\n { key: CombinatorTranslationEnum.clearDialogDecline, default: () => 'No' },\n];\n","/*\n The MIT License\n\n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport {\n defaultErrorTranslator,\n defaultTranslator,\n JsonFormsI18nState,\n} from '../i18n';\nimport {\n I18nActions,\n SET_LOCALE,\n SET_TRANSLATOR,\n UPDATE_I18N,\n} from '../actions';\nimport type { Reducer } from '../util';\n\nexport const defaultJsonFormsI18nState: Required = {\n locale: 'en',\n translate: defaultTranslator,\n translateError: defaultErrorTranslator,\n};\n\nexport const i18nReducer: Reducer = (\n state = defaultJsonFormsI18nState,\n action\n) => {\n switch (action.type) {\n case UPDATE_I18N: {\n const locale = action.locale ?? defaultJsonFormsI18nState.locale;\n const translate =\n action.translator ?? defaultJsonFormsI18nState.translate;\n const translateError =\n action.errorTranslator ?? defaultJsonFormsI18nState.translateError;\n\n if (\n locale !== state.locale ||\n translate !== state.translate ||\n translateError !== state.translateError\n ) {\n return {\n ...state,\n locale,\n translate,\n translateError,\n };\n }\n return state;\n }\n case SET_TRANSLATOR:\n return {\n ...state,\n translate: action.translator ?? defaultTranslator,\n translateError: action.errorTranslator ?? defaultErrorTranslator,\n };\n case SET_LOCALE:\n return {\n ...state,\n locale: action.locale ?? navigator.languages[0],\n };\n default:\n return state;\n }\n};\n\nexport const fetchLocale = (state?: JsonFormsI18nState) => {\n if (state === undefined) {\n return undefined;\n }\n return state.locale;\n};\n\nexport const fetchTranslator = (state?: JsonFormsI18nState) => {\n if (state === undefined) {\n return defaultTranslator;\n }\n return state.translate;\n};\n\nexport const fetchErrorTranslator = (state?: JsonFormsI18nState) => {\n if (state === undefined) {\n return defaultErrorTranslator;\n }\n return state.translateError;\n};\n","/*\n The MIT License\n \n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport type { RankedTester } from '../testers';\nimport {\n ADD_RENDERER,\n AddRendererAction,\n REMOVE_RENDERER,\n RemoveRendererAction,\n} from '../actions';\nimport type { Reducer } from '../util';\n\nexport interface JsonFormsRendererRegistryEntry {\n tester: RankedTester;\n renderer: any;\n}\n\ntype ValidRendererReducerActions = AddRendererAction | RemoveRendererAction;\n\nexport const rendererReducer: Reducer<\n JsonFormsRendererRegistryEntry[],\n ValidRendererReducerActions\n> = (state = [], action) => {\n switch (action.type) {\n case ADD_RENDERER:\n return state.concat([\n { tester: action.tester, renderer: action.renderer },\n ]);\n case REMOVE_RENDERER:\n return state.filter((t) => t.tester !== action.tester);\n default:\n return state;\n }\n};\n","/*\n The MIT License\n\n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport isEmpty from 'lodash/isEmpty';\nimport get from 'lodash/get';\nimport endsWith from 'lodash/endsWith';\nimport last from 'lodash/last';\nimport isArray from 'lodash/isArray';\nimport reduce from 'lodash/reduce';\nimport toPairs from 'lodash/toPairs';\nimport includes from 'lodash/includes';\nimport type {\n Categorization,\n ControlElement,\n JsonSchema,\n UISchemaElement,\n} from '../models';\nimport {\n deriveTypes,\n hasType,\n isOneOfEnumSchema,\n resolveSchema,\n} from '../util';\n\n/**\n * Constant that indicates that a tester is not capable of handling\n * a combination of schema/data.\n * @type {number}\n */\nexport const NOT_APPLICABLE = -1;\n/**\n * A tester is a function that receives an UI schema and a JSON schema and returns a boolean.\n * The rootSchema is handed over as context. Can be used to resolve references.\n */\nexport type Tester = (\n uischema: UISchemaElement,\n schema: JsonSchema,\n context: TesterContext\n) => boolean;\n\n/**\n * A ranked tester associates a tester with a number.\n */\nexport type RankedTester = (\n uischema: UISchemaElement,\n schema: JsonSchema,\n context: TesterContext\n) => number;\n\n/**\n * Additional context given to a tester in addition to UISchema and JsonSchema.\n */\nexport interface TesterContext {\n /** The root JsonSchema of the form. Can be used to resolve references. */\n rootSchema: JsonSchema;\n /** The form wide configuration object given to JsonForms. */\n config: any;\n}\n\nexport const isControl = (uischema: any): uischema is ControlElement =>\n !isEmpty(uischema) && uischema.scope !== undefined;\n\n/**\n * Only applicable for Controls.\n *\n * This function checks whether the given UI schema is of type Control\n * and if so, resolves the sub-schema referenced by the control and applies\n * the given predicate\n *\n * @param {(JsonSchema) => boolean} predicate the predicate that should be\n * applied to the resolved sub-schema\n */\nexport const schemaMatches =\n (\n predicate: (schema: JsonSchema, rootSchema: JsonSchema) => boolean\n ): Tester =>\n (\n uischema: UISchemaElement,\n schema: JsonSchema,\n context: TesterContext\n ): boolean => {\n if (isEmpty(uischema) || !isControl(uischema)) {\n return false;\n }\n if (isEmpty(schema)) {\n return false;\n }\n const schemaPath = uischema.scope;\n if (isEmpty(schemaPath)) {\n return false;\n }\n let currentDataSchema = schema;\n if (hasType(schema, 'object')) {\n currentDataSchema = resolveSchema(\n schema,\n schemaPath,\n context?.rootSchema\n );\n }\n if (currentDataSchema === undefined) {\n return false;\n }\n\n return predicate(currentDataSchema, context?.rootSchema);\n };\n\nexport const schemaSubPathMatches =\n (\n subPath: string,\n predicate: (schema: JsonSchema, rootSchema: JsonSchema) => boolean\n ): Tester =>\n (\n uischema: UISchemaElement,\n schema: JsonSchema,\n context: TesterContext\n ): boolean => {\n if (isEmpty(uischema) || !isControl(uischema)) {\n return false;\n }\n const schemaPath = uischema.scope;\n let currentDataSchema: JsonSchema = schema;\n if (hasType(schema, 'object')) {\n currentDataSchema = resolveSchema(\n schema,\n schemaPath,\n context?.rootSchema\n );\n }\n currentDataSchema = get(currentDataSchema, subPath);\n\n if (currentDataSchema === undefined) {\n return false;\n }\n\n return predicate(currentDataSchema, context?.rootSchema);\n };\n\n/**\n * Only applicable for Controls.\n *\n * This function checks whether the given UI schema is of type Control\n * and if so, resolves the sub-schema referenced by the control and checks\n * whether the type of the sub-schema matches the expected one.\n *\n * @param {string} expectedType the expected type of the resolved sub-schema\n */\nexport const schemaTypeIs = (expectedType: string): Tester =>\n schemaMatches((schema) => !isEmpty(schema) && hasType(schema, expectedType));\n\n/**\n * Only applicable for Controls.\n *\n * This function checks whether the given UI schema is of type Control\n * and if so, resolves the sub-schema referenced by the control and checks\n * whether the format of the sub-schema matches the expected one.\n *\n * @param {string} expectedFormat the expected format of the resolved sub-schema\n */\nexport const formatIs = (expectedFormat: string): Tester =>\n schemaMatches(\n (schema) =>\n !isEmpty(schema) &&\n schema.format === expectedFormat &&\n hasType(schema, 'string')\n );\n\n/**\n * Checks whether the given UI schema has the expected type.\n *\n * @param {string} expected the expected UI schema type\n */\nexport const uiTypeIs =\n (expected: string): Tester =>\n (uischema: UISchemaElement): boolean =>\n !isEmpty(uischema) && uischema.type === expected;\n\n/**\n * Checks whether the given UI schema has an option with the given\n * name and whether it has the expected value. If no options property\n * is set, returns false.\n *\n * @param {string} optionName the name of the option to check\n * @param {any} optionValue the expected value of the option\n */\nexport const optionIs =\n (optionName: string, optionValue: any): Tester =>\n (uischema: UISchemaElement): boolean => {\n if (isEmpty(uischema)) {\n return false;\n }\n\n const options = uischema.options;\n return !isEmpty(options) && options[optionName] === optionValue;\n };\n\n/**\n * Only applicable for Controls.\n *\n * Checks whether the scope of a control ends with the expected string.\n *\n * @param {string} expected the expected ending of the reference\n */\nexport const scopeEndsWith =\n (expected: string): Tester =>\n (uischema: UISchemaElement): boolean => {\n if (isEmpty(expected) || !isControl(uischema)) {\n return false;\n }\n\n return endsWith(uischema.scope, expected);\n };\n\n/**\n * Only applicable for Controls.\n *\n * Checks whether the last segment of the scope matches the expected string.\n *\n * @param {string} expected the expected ending of the reference\n */\nexport const scopeEndIs =\n (expected: string): Tester =>\n (uischema: UISchemaElement): boolean => {\n if (isEmpty(expected) || !isControl(uischema)) {\n return false;\n }\n const schemaPath = uischema.scope;\n\n return !isEmpty(schemaPath) && last(schemaPath.split('/')) === expected;\n };\n\n/**\n * A tester that allow composing other testers by && them.\n *\n * @param {Array} testers the testers to be composed\n */\nexport const and =\n (...testers: Tester[]): Tester =>\n (uischema: UISchemaElement, schema: JsonSchema, context: TesterContext) =>\n testers.reduce(\n (acc, tester) => acc && tester(uischema, schema, context),\n true\n );\n\n/**\n * A tester that allow composing other testers by || them.\n *\n * @param {Array} testers the testers to be composed\n */\nexport const or =\n (...testers: Tester[]): Tester =>\n (uischema: UISchemaElement, schema: JsonSchema, context: TesterContext) =>\n testers.reduce(\n (acc, tester) => acc || tester(uischema, schema, context),\n false\n );\n/**\n * Create a ranked tester that will associate a number with a given tester, if the\n * latter returns true.\n *\n * @param {number} rank the rank to be returned in case the tester returns true\n * @param {Tester} tester a tester\n */\nexport const rankWith =\n (rank: number, tester: Tester) =>\n (\n uischema: UISchemaElement,\n schema: JsonSchema,\n context: TesterContext\n ): number => {\n if (tester(uischema, schema, context)) {\n return rank;\n }\n\n return NOT_APPLICABLE;\n };\n\nexport const withIncreasedRank =\n (by: number, rankedTester: RankedTester) =>\n (\n uischema: UISchemaElement,\n schema: JsonSchema,\n context: TesterContext\n ): number => {\n const rank = rankedTester(uischema, schema, context);\n if (rank === NOT_APPLICABLE) {\n return NOT_APPLICABLE;\n }\n\n return rank + by;\n };\n\n/**\n * Default tester for boolean.\n * @type {RankedTester}\n */\nexport const isBooleanControl = and(\n uiTypeIs('Control'),\n schemaTypeIs('boolean')\n);\n\n// TODO: rather check for properties property\nexport const isObjectControl = and(uiTypeIs('Control'), schemaTypeIs('object'));\n\nexport const isAllOfControl = and(\n uiTypeIs('Control'),\n schemaMatches((schema) =>\n Object.prototype.hasOwnProperty.call(schema, 'allOf')\n )\n);\n\nexport const isAnyOfControl = and(\n uiTypeIs('Control'),\n schemaMatches((schema) =>\n Object.prototype.hasOwnProperty.call(schema, 'anyOf')\n )\n);\n\nexport const isOneOfControl = and(\n uiTypeIs('Control'),\n schemaMatches((schema) =>\n Object.prototype.hasOwnProperty.call(schema, 'oneOf')\n )\n);\n\n/**\n * Tests whether the given UI schema is of type Control and if the schema\n * has an enum.\n * @type {Tester}\n */\nexport const isEnumControl = and(\n uiTypeIs('Control'),\n or(\n schemaMatches((schema) =>\n Object.prototype.hasOwnProperty.call(schema, 'enum')\n ),\n schemaMatches((schema) =>\n Object.prototype.hasOwnProperty.call(schema, 'const')\n )\n )\n);\n\n/**\n * Tests whether the given UI schema is of type Control and if the schema\n * has an enum based on oneOf.\n * @type {Tester}\n */\nexport const isOneOfEnumControl = and(\n uiTypeIs('Control'),\n schemaMatches((schema) => isOneOfEnumSchema(schema))\n);\n\n/**\n * Tests whether the given UI schema is of type Control and if the schema\n * is of type integer\n * @type {Tester}\n */\nexport const isIntegerControl = and(\n uiTypeIs('Control'),\n schemaTypeIs('integer')\n);\n\n/**\n * Tests whether the given UI schema is of type Control and if the schema\n * is of type number\n * @type {Tester}\n */\nexport const isNumberControl = and(uiTypeIs('Control'), schemaTypeIs('number'));\n\n/**\n * Tests whether the given UI schema is of type Control and if the schema\n * is of type string\n * @type {Tester}\n */\nexport const isStringControl = and(uiTypeIs('Control'), schemaTypeIs('string'));\n\n/**\n * Tests whether the given UI schema is of type Control and if is has\n * a 'multi' option.\n * @type {Tester}\n */\nexport const isMultiLineControl = and(\n uiTypeIs('Control'),\n optionIs('multi', true)\n);\n\n/**\n * Tests whether the given UI schema is of type Control and whether the schema\n * or uischema options has a 'date' format.\n * @type {Tester}\n */\nexport const isDateControl = and(\n uiTypeIs('Control'),\n or(formatIs('date'), optionIs('format', 'date'))\n);\n\n/**\n * Tests whether the given UI schema is of type Control and whether the schema\n * or the uischema options has a 'time' format.\n * @type {Tester}\n */\nexport const isTimeControl = and(\n uiTypeIs('Control'),\n or(formatIs('time'), optionIs('format', 'time'))\n);\n\n/**\n * Tests whether the given UI schema is of type Control and whether the schema\n * or the uischema options has a 'date-time' format.\n * @type {Tester}\n */\nexport const isDateTimeControl = and(\n uiTypeIs('Control'),\n or(formatIs('date-time'), optionIs('format', 'date-time'))\n);\n\n/**\n * Tests whether the given schema is an array of objects.\n * @type {Tester}\n */\nexport const isObjectArray = and(\n schemaMatches(\n (schema, rootSchema) =>\n hasType(schema, 'array') &&\n !Array.isArray(resolveSchema(schema, 'items', rootSchema)) // we don't care about tuples\n ),\n schemaSubPathMatches('items', (schema, rootSchema) => {\n const resolvedSchema = schema.$ref\n ? resolveSchema(rootSchema, schema.$ref, rootSchema)\n : schema;\n return hasType(resolvedSchema, 'object');\n })\n);\n\n/**\n * Tests whether the given UI schema is of type Control and if the schema\n * is an array of objects.\n * @type {Tester}\n */\nexport const isObjectArrayControl = and(uiTypeIs('Control'), isObjectArray);\n\nconst traverse = (\n any: JsonSchema | JsonSchema[],\n pred: (obj: JsonSchema) => boolean,\n rootSchema: JsonSchema\n): boolean => {\n if (isArray(any)) {\n return reduce(\n any,\n (acc, el) => acc || traverse(el, pred, rootSchema),\n false\n );\n }\n\n if (pred(any)) {\n return true;\n }\n\n if (any.$ref) {\n const toTraverse = resolveSchema(rootSchema, any.$ref, rootSchema);\n if (toTraverse && !toTraverse.$ref) {\n return traverse(toTraverse, pred, rootSchema);\n }\n }\n\n if (any.items) {\n return traverse(any.items, pred, rootSchema);\n }\n if (any.properties) {\n return reduce(\n toPairs(any.properties),\n (acc, [_key, val]) => acc || traverse(val, pred, rootSchema),\n false\n );\n }\n\n return false;\n};\n\nexport const isObjectArrayWithNesting = (\n uischema: UISchemaElement,\n schema: JsonSchema,\n context: TesterContext\n): boolean => {\n if (!uiTypeIs('Control')(uischema, schema, context)) {\n return false;\n }\n const schemaPath = (uischema as ControlElement).scope;\n const resolvedSchema = resolveSchema(\n schema,\n schemaPath,\n context?.rootSchema ?? schema\n );\n let objectDepth = 0;\n if (resolvedSchema !== undefined && resolvedSchema.items !== undefined) {\n // check if nested arrays\n if (\n traverse(\n resolvedSchema.items,\n (val) => {\n if (val === schema) {\n return false;\n }\n if (val.$ref !== undefined) {\n return false;\n }\n if (val.anyOf || val.allOf) {\n return true;\n }\n if (val.oneOf && !isOneOfEnumSchema(val)) {\n return true;\n }\n if (hasType(val, 'object')) {\n objectDepth++;\n if (objectDepth === 2) {\n return true;\n }\n }\n if (hasType(val, 'array')) {\n return true;\n }\n return false;\n },\n context?.rootSchema\n )\n ) {\n return true;\n }\n // check if uischema options detail is set\n if (uischema.options && uischema.options.detail) {\n if (typeof uischema.options.detail === 'string') {\n return uischema.options.detail.toUpperCase() !== 'DEFAULT';\n } else if (\n typeof uischema.options.detail === 'object' &&\n uischema.options.detail.type\n ) {\n return true;\n }\n }\n }\n return false;\n};\n\n/**\n * Synonym for isObjectArrayControl\n */\nexport const isArrayObjectControl = isObjectArrayControl;\n\n/**\n * Tests whether the given UI schema is of type Control and if the schema\n * is an array of a primitive type.\n * @type {Tester}\n */\nexport const isPrimitiveArrayControl = and(\n uiTypeIs('Control'),\n schemaMatches(\n (schema, rootSchema) =>\n deriveTypes(schema).length !== 0 &&\n !Array.isArray(resolveSchema(schema, 'items', rootSchema)) // we don't care about tuples\n ),\n schemaSubPathMatches('items', (schema, rootSchema) => {\n const resolvedSchema = schema.$ref\n ? resolveSchema(rootSchema, schema.$ref, rootSchema)\n : schema;\n const types = deriveTypes(resolvedSchema);\n return (\n types.length === 1 &&\n includes(['integer', 'number', 'boolean', 'string'], types[0])\n );\n })\n);\n\n/**\n * Tests whether a given UI schema is of type Control,\n * if the schema is of type number or integer and\n * whether the schema defines a numerical range with a default value.\n * @type {Tester}\n */\nexport const isRangeControl = and(\n uiTypeIs('Control'),\n or(schemaTypeIs('number'), schemaTypeIs('integer')),\n schemaMatches(\n (schema) =>\n Object.prototype.hasOwnProperty.call(schema, 'maximum') &&\n Object.prototype.hasOwnProperty.call(schema, 'minimum') &&\n Object.prototype.hasOwnProperty.call(schema, 'default')\n ),\n optionIs('slider', true)\n);\n\n/**\n * Tests whether the given UI schema is of type Control, if the schema\n * is of type integer and has option format\n * @type {Tester}\n */\nexport const isNumberFormatControl = and(\n uiTypeIs('Control'),\n schemaTypeIs('integer'),\n optionIs('format', true)\n);\n\nexport const isCategorization = (\n category: UISchemaElement\n): category is Categorization => category.type === 'Categorization';\n\nexport const isCategory = (uischema: UISchemaElement): boolean =>\n uischema.type === 'Category';\n\nexport const hasCategory = (categorization: Categorization): boolean => {\n if (isEmpty(categorization.elements)) {\n return false;\n }\n // all children of the categorization have to be categories\n return categorization.elements\n .map((elem) =>\n isCategorization(elem) ? hasCategory(elem) : isCategory(elem)\n )\n .reduce((prev, curr) => prev && curr, true);\n};\n\nexport const categorizationHasCategory = (uischema: UISchemaElement) =>\n hasCategory(uischema as Categorization);\n\nexport const not =\n (tester: Tester): Tester =>\n (uischema: UISchemaElement, schema: JsonSchema, context: TesterContext) =>\n !tester(uischema, schema, context);\n","/*\n The MIT License\n \n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport maxBy from 'lodash/maxBy';\nimport remove from 'lodash/remove';\nimport { ADD_UI_SCHEMA, REMOVE_UI_SCHEMA, UISchemaActions } from '../actions';\nimport { NOT_APPLICABLE } from '../testers';\nimport type { JsonSchema, UISchemaElement } from '../models';\nimport type { Reducer } from '../util';\n\nexport type UISchemaTester = (\n schema: JsonSchema,\n schemaPath: string,\n path: string\n) => number;\n\nexport interface JsonFormsUISchemaRegistryEntry {\n tester: UISchemaTester;\n uischema: UISchemaElement;\n}\n\nexport const uischemaRegistryReducer: Reducer<\n JsonFormsUISchemaRegistryEntry[],\n UISchemaActions\n> = (state = [], action) => {\n switch (action.type) {\n case ADD_UI_SCHEMA:\n return state\n .slice()\n .concat({ tester: action.tester, uischema: action.uischema });\n case REMOVE_UI_SCHEMA: {\n const copy = state.slice();\n remove(copy, (entry) => entry.tester === action.tester);\n return copy;\n }\n default:\n return state;\n }\n};\n\nexport const findMatchingUISchema =\n (state: JsonFormsUISchemaRegistryEntry[]) =>\n (\n jsonSchema: JsonSchema,\n schemaPath: string,\n path: string\n ): UISchemaElement => {\n const match = maxBy(state, (entry) =>\n entry.tester(jsonSchema, schemaPath, path)\n );\n if (\n match !== undefined &&\n match.tester(jsonSchema, schemaPath, path) !== NOT_APPLICABLE\n ) {\n return match.uischema;\n }\n return undefined;\n };\n","/*\n The MIT License\n \n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport type { ControlElement, UISchemaElement } from '../models';\nimport { coreReducer, errorAt, subErrorsAt } from './core';\nimport { defaultDataReducer } from './default-data';\nimport { rendererReducer } from './renderers';\nimport type { JsonFormsState } from '../store';\nimport type { JsonFormsUISchemaRegistryEntry } from './uischemas';\nimport { findMatchingUISchema, uischemaRegistryReducer } from './uischemas';\nimport { fetchErrorTranslator, fetchLocale, i18nReducer } from './i18n';\n\nimport { Generate } from '../generators';\nimport type { JsonSchema } from '../models/jsonSchema';\n\nimport { cellReducer } from './cells';\nimport { configReducer } from './config';\nimport get from 'lodash/get';\nimport { fetchTranslator } from '.';\nimport type { ErrorTranslator, Translator } from '../i18n';\n\nexport const jsonFormsReducerConfig = {\n core: coreReducer,\n renderers: rendererReducer,\n cells: cellReducer,\n config: configReducer,\n uischemas: uischemaRegistryReducer,\n defaultData: defaultDataReducer,\n i18n: i18nReducer,\n};\n\n/**\n * Finds a registered UI schema to use, if any.\n * @param schema the JSON schema describing the data to be rendered\n * @param schemaPath the according schema path\n * @param path the instance path\n * @param fallback the type of the layout to use or a UI-schema-generator function\n * @param control may be checked for embedded inline uischema options\n */\nexport const findUISchema = (\n uischemas: JsonFormsUISchemaRegistryEntry[],\n schema: JsonSchema,\n schemaPath: string,\n path: string,\n fallback: string | (() => UISchemaElement) = 'VerticalLayout',\n control?: ControlElement,\n rootSchema?: JsonSchema\n): UISchemaElement => {\n // handle options\n if (control && control.options && control.options.detail) {\n if (typeof control.options.detail === 'string') {\n if (control.options.detail.toUpperCase() === 'GENERATE') {\n //use fallback generation function\n if (typeof fallback === 'function') {\n return fallback();\n }\n // force generation of uischema\n return Generate.uiSchema(schema, fallback, undefined, rootSchema);\n }\n } else if (typeof control.options.detail === 'object') {\n // check if detail is a valid uischema\n if (\n control.options.detail.type &&\n typeof control.options.detail.type === 'string'\n ) {\n return control.options.detail as UISchemaElement;\n }\n }\n }\n // default\n const uiSchema = findMatchingUISchema(uischemas)(schema, schemaPath, path);\n if (uiSchema === undefined) {\n //use fallback generation function\n if (typeof fallback === 'function') {\n return fallback();\n }\n return Generate.uiSchema(schema, fallback, '#', rootSchema);\n }\n return uiSchema;\n};\n\nexport const getErrorAt =\n (instancePath: string, schema: JsonSchema) => (state: JsonFormsState) => {\n return errorAt(instancePath, schema)(state.jsonforms.core);\n };\n\nexport const getSubErrorsAt =\n (instancePath: string, schema: JsonSchema) => (state: JsonFormsState) =>\n subErrorsAt(instancePath, schema)(state.jsonforms.core);\n\nexport const getConfig = (state: JsonFormsState) => state.jsonforms.config;\n\nexport const getLocale = (state: JsonFormsState) =>\n fetchLocale(get(state, 'jsonforms.i18n'));\n\nexport const getTranslator =\n () =>\n (state: JsonFormsState): Translator =>\n fetchTranslator(get(state, 'jsonforms.i18n'));\n\nexport const getErrorTranslator =\n () =>\n (state: JsonFormsState): ErrorTranslator =>\n fetchErrorTranslator(get(state, 'jsonforms.i18n'));\n","/*\n The MIT License\n \n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport get from 'lodash/get';\nimport type Ajv from 'ajv';\nimport type { JsonFormsState } from '../store';\nimport type { JsonSchema, UISchemaElement } from '../models';\nimport {\n extractAjv,\n extractData,\n extractSchema,\n extractUiSchema,\n} from './core';\nimport {\n extractDefaultData,\n JsonFormsDefaultDataRegistryEntry,\n} from './default-data';\nimport type { JsonFormsRendererRegistryEntry } from './renderers';\nimport type { JsonFormsCellRendererRegistryEntry } from './cells';\nimport type { JsonFormsUISchemaRegistryEntry } from './uischemas';\n\nexport const getData = (state: JsonFormsState) =>\n extractData(get(state, 'jsonforms.core'));\nexport const getSchema = (state: JsonFormsState): JsonSchema =>\n extractSchema(get(state, 'jsonforms.core'));\nexport const getUiSchema = (state: JsonFormsState): UISchemaElement =>\n extractUiSchema(get(state, 'jsonforms.core'));\nexport const getAjv = (state: JsonFormsState): Ajv =>\n extractAjv(get(state, 'jsonforms.core'));\nexport const getDefaultData = (\n state: JsonFormsState\n): JsonFormsDefaultDataRegistryEntry[] =>\n extractDefaultData(get(state, 'jsonforms.defaultData'));\nexport const getRenderers = (\n state: JsonFormsState\n): JsonFormsRendererRegistryEntry[] => get(state, 'jsonforms.renderers');\nexport const getCells = (\n state: JsonFormsState\n): JsonFormsCellRendererRegistryEntry[] => get(state, 'jsonforms.cells');\nexport const getUISchemas = (\n state: JsonFormsState\n): JsonFormsUISchemaRegistryEntry[] => get(state, 'jsonforms.uischemas');\n","/*\n The MIT License\n\n Copyright (c) 2023 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\nimport { CoreActions } from '../actions';\nimport { JsonFormsCore } from './core';\n\nexport interface Middleware {\n (\n state: JsonFormsCore,\n action: CoreActions,\n defaultReducer: (state: JsonFormsCore, action: CoreActions) => JsonFormsCore\n ): JsonFormsCore;\n}\nexport const defaultMiddleware: Middleware = (state, action, defaultReducer) =>\n defaultReducer(state, action);\n","/*\n The MIT License\n \n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport isEmpty from 'lodash/isEmpty';\nimport range from 'lodash/range';\nimport { isScoped, Scopable } from '../models';\n\nexport const compose = (path1: string, path2: string) => {\n let p1 = path1;\n if (!isEmpty(path1) && !isEmpty(path2) && !path2.startsWith('[')) {\n p1 = path1 + '.';\n }\n\n if (isEmpty(p1)) {\n return path2;\n } else if (isEmpty(path2)) {\n return p1;\n } else {\n return `${p1}${path2}`;\n }\n};\n\nexport { compose as composePaths };\n\n/**\n * Convert a schema path (i.e. JSON pointer) to an array by splitting\n * at the '/' character and removing all schema-specific keywords.\n *\n * The returned value can be used to de-reference a root object by folding over it\n * and de-referencing the single segments to obtain a new object.\n *\n *\n * @param {string} schemaPath the schema path to be converted\n * @returns {string[]} an array containing only non-schema-specific segments\n */\nexport const toDataPathSegments = (schemaPath: string): string[] => {\n const s = schemaPath\n .replace(/(anyOf|allOf|oneOf)\\/[\\d]+\\//g, '')\n .replace(/(then|else)\\//g, '');\n const segments = s.split('/');\n\n const decodedSegments = segments.map(decode);\n\n const startFromRoot = decodedSegments[0] === '#' || decodedSegments[0] === '';\n const startIndex = startFromRoot ? 2 : 1;\n return range(startIndex, decodedSegments.length, 2).map(\n (idx) => decodedSegments[idx]\n );\n};\n\n/**\n * Convert a schema path (i.e. JSON pointer) to a data path.\n *\n * Data paths can be used in field change event handlers like handleChange.\n *\n * @example\n * toDataPath('#/properties/foo/properties/bar') === 'foo.bar')\n *\n * @param {string} schemaPath the schema path to be converted\n * @returns {string} the data path\n */\nexport const toDataPath = (schemaPath: string): string => {\n return toDataPathSegments(schemaPath).join('.');\n};\n\nexport const composeWithUi = (scopableUi: Scopable, path: string): string => {\n if (!isScoped(scopableUi)) {\n return path ?? '';\n }\n\n const segments = toDataPathSegments(scopableUi.scope);\n\n if (isEmpty(segments)) {\n return path ?? '';\n }\n\n return compose(path, segments.join('.'));\n};\n\n/**\n * Encodes the given segment to be used as part of a JSON Pointer\n *\n * JSON Pointer has special meaning for \"/\" and \"~\", therefore these must be encoded\n */\nexport const encode = (segment: string) =>\n segment?.replace(/~/g, '~0').replace(/\\//g, '~1');\n/**\n * Decodes a given JSON Pointer segment to its \"normal\" representation\n */\nexport const decode = (pointerSegment: string) =>\n pointerSegment?.replace(/~1/g, '/').replace(/~0/, '~');\n","/*\n The MIT License\n\n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport isEmpty from 'lodash/isEmpty';\nimport get from 'lodash/get';\nimport type { JsonSchema, JsonSchema7 } from '../models';\nimport { decode } from './path';\n\n/**\n * Map for storing refs and the respective schemas they are pointing to.\n */\nexport interface ReferenceSchemaMap {\n [ref: string]: JsonSchema;\n}\n\nconst isObjectSchema = (schema: JsonSchema): boolean => {\n return schema.properties !== undefined;\n};\nconst isArraySchema = (schema: JsonSchema): boolean => {\n return schema.type === 'array' && schema.items !== undefined;\n};\n\nexport const resolveData = (instance: any, dataPath: string): any => {\n if (isEmpty(dataPath)) {\n return instance;\n }\n const dataPathSegments = dataPath.split('.');\n\n return dataPathSegments.reduce((curInstance, decodedSegment) => {\n if (\n !curInstance ||\n !Object.prototype.hasOwnProperty.call(curInstance, decodedSegment)\n ) {\n return undefined;\n }\n\n return curInstance[decodedSegment];\n }, instance);\n};\n\n/**\n * Finds all references inside the given schema.\n *\n * @param schema The {@link JsonSchema} to find the references in\n * @param result The initial result map, default: empty map (this parameter is used for recursion\n * inside the function)\n * @param resolveTuples Whether arrays of tuples should be considered; default: false\n */\nexport const findAllRefs = (\n schema: JsonSchema,\n result: ReferenceSchemaMap = {},\n resolveTuples = false\n): ReferenceSchemaMap => {\n if (isObjectSchema(schema)) {\n Object.keys(schema.properties).forEach((key) =>\n findAllRefs(schema.properties[key], result)\n );\n }\n if (isArraySchema(schema)) {\n if (Array.isArray(schema.items)) {\n if (resolveTuples) {\n const items: JsonSchema[] = schema.items;\n items.forEach((child) => findAllRefs(child, result));\n }\n } else {\n findAllRefs(schema.items, result);\n }\n }\n if (Array.isArray(schema.anyOf)) {\n const anyOf: JsonSchema[] = schema.anyOf;\n anyOf.forEach((child) => findAllRefs(child, result));\n }\n if (schema.$ref !== undefined) {\n result[schema.$ref] = schema;\n }\n\n return result;\n};\n\nconst invalidSegment = (pathSegment: string) =>\n pathSegment === '#' || pathSegment === undefined || pathSegment === '';\n\n/**\n * Resolve the given schema path in order to obtain a subschema.\n * @param {JsonSchema} schema the root schema from which to start\n * @param {string} schemaPath the schema path to be resolved\n * @param {JsonSchema} rootSchema the actual root schema\n * @returns {JsonSchema} the resolved sub-schema\n */\nexport const resolveSchema = (\n schema: JsonSchema,\n schemaPath: string,\n rootSchema: JsonSchema\n): JsonSchema => {\n const segments = schemaPath?.split('/').map(decode);\n return resolveSchemaWithSegments(schema, segments, rootSchema);\n};\n\nconst resolveSchemaWithSegments = (\n schema: JsonSchema,\n pathSegments: string[],\n rootSchema: JsonSchema\n): JsonSchema => {\n if (isEmpty(schema)) {\n return undefined;\n }\n\n if (schema.$ref) {\n schema = resolveSchema(rootSchema, schema.$ref, rootSchema);\n }\n\n if (!pathSegments || pathSegments.length === 0) {\n return schema;\n }\n\n const [segment, ...remainingSegments] = pathSegments;\n\n if (invalidSegment(segment)) {\n return resolveSchemaWithSegments(schema, remainingSegments, rootSchema);\n }\n\n const singleSegmentResolveSchema = get(schema, segment);\n\n const resolvedSchema = resolveSchemaWithSegments(\n singleSegmentResolveSchema,\n remainingSegments,\n rootSchema\n );\n if (resolvedSchema) {\n return resolvedSchema;\n }\n\n if (segment === 'properties' || segment === 'items') {\n // Let's try to resolve the path, assuming oneOf/allOf/anyOf/then/else was omitted.\n // We only do this when traversing an object or array as we want to avoid\n // following a property which is named oneOf, allOf, anyOf, then or else.\n let alternativeResolveResult = undefined;\n\n const subSchemas = [].concat(\n schema.oneOf ?? [],\n schema.allOf ?? [],\n schema.anyOf ?? [],\n (schema as JsonSchema7).then ?? [],\n (schema as JsonSchema7).else ?? []\n );\n\n for (const subSchema of subSchemas) {\n alternativeResolveResult = resolveSchemaWithSegments(\n subSchema,\n [segment, ...remainingSegments],\n rootSchema\n );\n if (alternativeResolveResult) {\n break;\n }\n }\n return alternativeResolveResult;\n }\n\n return undefined;\n};\n","/*\n The MIT License\n\n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport has from 'lodash/has';\nimport {\n AndCondition,\n Condition,\n JsonSchema,\n LeafCondition,\n OrCondition,\n RuleEffect,\n SchemaBasedCondition,\n Scopable,\n UISchemaElement,\n} from '../models';\nimport { resolveData } from './resolvers';\nimport { composeWithUi } from './path';\nimport type Ajv from 'ajv';\nimport { getAjv } from '../reducers';\nimport type { JsonFormsState } from '../store';\n\nconst isOrCondition = (condition: Condition): condition is OrCondition =>\n condition.type === 'OR';\n\nconst isAndCondition = (condition: Condition): condition is AndCondition =>\n condition.type === 'AND';\n\nconst isLeafCondition = (condition: Condition): condition is LeafCondition =>\n condition.type === 'LEAF';\n\nconst isSchemaCondition = (\n condition: Condition\n): condition is SchemaBasedCondition => has(condition, 'schema');\n\nconst getConditionScope = (condition: Scopable, path: string): string => {\n return composeWithUi(condition, path);\n};\n\nconst evaluateCondition = (\n data: any,\n condition: Condition,\n path: string,\n ajv: Ajv\n): boolean => {\n if (isAndCondition(condition)) {\n return condition.conditions.reduce(\n (acc, cur) => acc && evaluateCondition(data, cur, path, ajv),\n true\n );\n } else if (isOrCondition(condition)) {\n return condition.conditions.reduce(\n (acc, cur) => acc || evaluateCondition(data, cur, path, ajv),\n false\n );\n } else if (isLeafCondition(condition)) {\n const value = resolveData(data, getConditionScope(condition, path));\n return value === condition.expectedValue;\n } else if (isSchemaCondition(condition)) {\n const value = resolveData(data, getConditionScope(condition, path));\n if (condition.failWhenUndefined && value === undefined) {\n return false;\n }\n return ajv.validate(condition.schema, value) as boolean;\n } else {\n // unknown condition\n return true;\n }\n};\n\nconst isRuleFulfilled = (\n uischema: UISchemaElement,\n data: any,\n path: string,\n ajv: Ajv\n): boolean => {\n const condition = uischema.rule.condition;\n return evaluateCondition(data, condition, path, ajv);\n};\n\nexport const evalVisibility = (\n uischema: UISchemaElement,\n data: any,\n path: string = undefined,\n ajv: Ajv\n): boolean => {\n const fulfilled = isRuleFulfilled(uischema, data, path, ajv);\n\n switch (uischema.rule.effect) {\n case RuleEffect.HIDE:\n return !fulfilled;\n case RuleEffect.SHOW:\n return fulfilled;\n // visible by default\n default:\n return true;\n }\n};\n\nexport const evalEnablement = (\n uischema: UISchemaElement,\n data: any,\n path: string = undefined,\n ajv: Ajv\n): boolean => {\n const fulfilled = isRuleFulfilled(uischema, data, path, ajv);\n\n switch (uischema.rule.effect) {\n case RuleEffect.DISABLE:\n return !fulfilled;\n case RuleEffect.ENABLE:\n return fulfilled;\n // enabled by default\n default:\n return true;\n }\n};\n\nexport const hasShowRule = (uischema: UISchemaElement): boolean => {\n if (\n uischema.rule &&\n (uischema.rule.effect === RuleEffect.SHOW ||\n uischema.rule.effect === RuleEffect.HIDE)\n ) {\n return true;\n }\n return false;\n};\n\nexport const hasEnableRule = (uischema: UISchemaElement): boolean => {\n if (\n uischema.rule &&\n (uischema.rule.effect === RuleEffect.ENABLE ||\n uischema.rule.effect === RuleEffect.DISABLE)\n ) {\n return true;\n }\n return false;\n};\n\nexport const isVisible = (\n uischema: UISchemaElement,\n data: any,\n path: string = undefined,\n ajv: Ajv\n): boolean => {\n if (uischema.rule) {\n return evalVisibility(uischema, data, path, ajv);\n }\n\n return true;\n};\n\nexport const isEnabled = (\n uischema: UISchemaElement,\n data: any,\n path: string = undefined,\n ajv: Ajv\n): boolean => {\n if (uischema.rule) {\n return evalEnablement(uischema, data, path, ajv);\n }\n\n return true;\n};\n\n/**\n * Indicates whether the given `uischema` element shall be enabled or disabled.\n * Checks the global readonly flag, uischema rule, uischema options (including the config),\n * the schema and the enablement indicator of the parent.\n */\nexport const isInherentlyEnabled = (\n state: JsonFormsState,\n ownProps: any,\n uischema: UISchemaElement,\n schema: (JsonSchema & { readOnly?: boolean }) | undefined,\n rootData: any,\n config: any\n) => {\n if (state?.jsonforms?.readonly) {\n return false;\n }\n if (uischema && hasEnableRule(uischema)) {\n return isEnabled(uischema, rootData, ownProps?.path, getAjv(state));\n }\n if (typeof uischema?.options?.readonly === 'boolean') {\n return !uischema.options.readonly;\n }\n if (typeof uischema?.options?.readOnly === 'boolean') {\n return !uischema.options.readOnly;\n }\n if (typeof config?.readonly === 'boolean') {\n return !config.readonly;\n }\n if (typeof config?.readOnly === 'boolean') {\n return !config.readOnly;\n }\n if (schema?.readOnly === true) {\n return false;\n }\n if (typeof ownProps?.enabled === 'boolean') {\n return ownProps.enabled;\n }\n return true;\n};\n","/*\n The MIT License\n \n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport isEmpty from 'lodash/isEmpty';\nimport isArray from 'lodash/isArray';\nimport includes from 'lodash/includes';\nimport find from 'lodash/find';\nimport type { JsonSchema, Scoped, UISchemaElement } from '..';\nimport { resolveData, resolveSchema } from './resolvers';\nimport { composePaths, toDataPathSegments } from './path';\nimport { isEnabled, isVisible } from './runtime';\nimport type Ajv from 'ajv';\n\n/**\n * Returns the string representation of the given date. The format of the output string can be specified:\n * - 'date' for a date-only string (YYYY-MM-DD),\n * - 'time' for a time-only string (HH:mm:ss), or\n * - 'date-time' for a full date-time string in ISO format (YYYY-MM-DDTHH:mm:ss.sssZ).\n * If no format is specified, the full date-time ISO string is returned by default.\n *\n * @returns {string} A string representation of the date in the specified format.\n *\n * @example\n * // returns '2023-11-09'\n * convertDateToString(new Date('2023-11-09T14:22:54.131Z'), 'date');\n *\n * @example\n * // returns '14:22:54'\n * convertDateToString(new Date('2023-11-09T14:22:54.131Z'), 'time');\n *\n * @example\n * // returns '2023-11-09T14:22:54.131Z'\n * convertDateToString(new Date('2023-11-09T14:22:54.131Z'), 'date-time');\n *\n * @example\n * // returns '2023-11-09T14:22:54.131Z'\n * convertDateToString(new Date('2023-11-09T14:22:54.131Z'));\n */\nexport const convertDateToString = (\n date: Date,\n format?: 'date' | 'time' | 'date-time'\n): string => {\n //e.g. '2023-11-09T14:22:54.131Z'\n const dateString = date.toISOString();\n if (format === 'date-time') {\n return dateString;\n } else if (format === 'date') {\n // e.g. '2023-11-09'\n return dateString.split('T')[0];\n } else if (format === 'time') {\n //e.g. '14:22:54'\n return dateString.split('T')[1].split('.')[0];\n }\n return dateString;\n};\n\n/**\n * Escape the given string such that it can be used as a class name,\n * i.e. hashes and slashes will be replaced.\n *\n * @param {string} s the string that should be converted to a valid class name\n * @returns {string} the escaped string\n */\nexport const convertToValidClassName = (s: string): string =>\n s.replace('#', 'root').replace(new RegExp('/', 'g'), '_');\n\nexport const formatErrorMessage = (errors: string[]) => {\n if (errors === undefined || errors === null) {\n return '';\n }\n\n return errors.join('\\n');\n};\n\nexport const hasType = (jsonSchema: JsonSchema, expected: string): boolean => {\n return includes(deriveTypes(jsonSchema), expected);\n};\n\n/**\n * Derives the type of the jsonSchema element\n */\nexport const deriveTypes = (jsonSchema: JsonSchema): string[] => {\n if (isEmpty(jsonSchema)) {\n return [];\n }\n if (!isEmpty(jsonSchema.type) && typeof jsonSchema.type === 'string') {\n return [jsonSchema.type];\n }\n if (isArray(jsonSchema.type)) {\n return jsonSchema.type;\n }\n if (\n !isEmpty(jsonSchema.properties) ||\n !isEmpty(jsonSchema.additionalProperties)\n ) {\n return ['object'];\n }\n if (!isEmpty(jsonSchema.items)) {\n return ['array'];\n }\n if (!isEmpty(jsonSchema.enum)) {\n const types: Set = new Set();\n jsonSchema.enum.forEach((enumElement) => {\n if (typeof enumElement === 'string') {\n types.add('string');\n } else {\n deriveTypes(enumElement).forEach((type) => types.add(type));\n }\n });\n return Array.from(types);\n }\n if (!isEmpty(jsonSchema.allOf)) {\n const allOfType = find(\n jsonSchema.allOf,\n (schema: JsonSchema) => deriveTypes(schema).length !== 0\n );\n\n if (allOfType) {\n return deriveTypes(allOfType);\n }\n }\n // ignore all remaining cases\n return [];\n};\n\n/**\n * Convenience wrapper around resolveData and resolveSchema.\n */\nexport const Resolve: {\n schema(\n schema: JsonSchema,\n schemaPath: string,\n rootSchema: JsonSchema\n ): JsonSchema;\n data(data: any, path: string): any;\n} = {\n schema: resolveSchema,\n data: resolveData,\n};\n\n// Paths --\nconst fromScoped = (scopable: Scoped): string =>\n toDataPathSegments(scopable.scope).join('.');\n\nexport const Paths = {\n compose: composePaths,\n fromScoped,\n};\n\n// Runtime --\nexport const Runtime = {\n isEnabled(uischema: UISchemaElement, data: any, ajv: Ajv): boolean {\n return isEnabled(uischema, data, undefined, ajv);\n },\n isVisible(uischema: UISchemaElement, data: any, ajv: Ajv): boolean {\n return isVisible(uischema, data, undefined, ajv);\n },\n};\n","/*\n The MIT License\n \n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport startCase from 'lodash/startCase';\n\nimport type { ControlElement, JsonSchema, LabelDescription } from '../models';\nimport { decode } from './path';\n\nconst deriveLabel = (\n controlElement: ControlElement,\n schemaElement?: JsonSchema\n): string => {\n if (schemaElement && typeof schemaElement.title === 'string') {\n return schemaElement.title;\n }\n if (typeof controlElement.scope === 'string') {\n const ref = controlElement.scope;\n const label = decode(ref.substr(ref.lastIndexOf('/') + 1));\n return startCase(label);\n }\n\n return '';\n};\n\nexport const createCleanLabel = (label: string): string => {\n return startCase(label.replace('_', ' '));\n};\n\n/**\n * Return a label object based on the given control and schema element.\n * @param {ControlElement} withLabel the UI schema to obtain a label object for\n * @param {JsonSchema} schema optional: the corresponding schema element\n * @returns {LabelDescription}\n */\nexport const createLabelDescriptionFrom = (\n withLabel: ControlElement,\n schema?: JsonSchema\n): LabelDescription => {\n const labelProperty = withLabel.label;\n if (typeof labelProperty === 'boolean') {\n return labelDescription(deriveLabel(withLabel, schema), labelProperty);\n }\n if (typeof labelProperty === 'string') {\n return labelDescription(labelProperty, true);\n }\n if (typeof labelProperty === 'object') {\n const label =\n typeof labelProperty.text === 'string'\n ? labelProperty.text\n : deriveLabel(withLabel, schema);\n const show =\n typeof labelProperty.show === 'boolean' ? labelProperty.show : true;\n return labelDescription(label, show);\n }\n return labelDescription(deriveLabel(withLabel, schema), true);\n};\n\nconst labelDescription = (text: string, show: boolean): LabelDescription => ({\n text: text,\n show: show,\n});\n","/*\n The MIT License\n\n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport get from 'lodash/get';\nimport {\n ControlElement,\n isLabelable,\n JsonSchema,\n JsonSchema4,\n JsonSchema7,\n LabelElement,\n UISchemaElement,\n} from '../models';\nimport find from 'lodash/find';\nimport {\n getUISchemas,\n getAjv,\n getCells,\n getConfig,\n getData,\n getErrorAt,\n getErrorTranslator,\n getRenderers,\n getSchema,\n getSubErrorsAt,\n getTranslator,\n getUiSchema,\n} from '../reducers';\nimport type {\n JsonFormsCellRendererRegistryEntry,\n JsonFormsRendererRegistryEntry,\n JsonFormsUISchemaRegistryEntry,\n} from '../reducers';\nimport type { RankedTester } from '../testers';\nimport { hasShowRule, isInherentlyEnabled, isVisible } from './runtime';\nimport { createLabelDescriptionFrom } from './label';\nimport type { CombinatorKeyword } from './combinators';\nimport { moveDown, moveUp } from './array';\nimport type { AnyAction, Dispatch } from './type';\nimport { Resolve, convertDateToString, hasType } from './util';\nimport { composePaths, composeWithUi, toDataPath } from './path';\nimport { CoreActions, update } from '../actions';\nimport type { ErrorObject } from 'ajv';\nimport type { JsonFormsState } from '../store';\nimport {\n deriveLabelForUISchemaElement,\n getCombinedErrorMessage,\n getI18nKey,\n getI18nKeyPrefix,\n getI18nKeyPrefixBySchema,\n getArrayTranslations,\n Translator,\n CombinatorTranslations,\n getCombinatorTranslations,\n combinatorDefaultTranslations,\n} from '../i18n';\nimport {\n arrayDefaultTranslations,\n ArrayTranslations,\n} from '../i18n/arrayTranslations';\nimport { resolveSchema } from './resolvers';\nimport cloneDeep from 'lodash/cloneDeep';\nimport isEqual from 'lodash/isEqual';\nimport has from 'lodash/has';\nimport any from 'lodash/fp/any';\nimport all from 'lodash/fp/all';\n\nconst checkDataCondition = (\n propertyCondition: unknown,\n property: string,\n data: Record\n) => {\n if (has(propertyCondition, 'const')) {\n return (\n has(data, property) &&\n isEqual(data[property], get(propertyCondition, 'const'))\n );\n } else if (has(propertyCondition, 'enum')) {\n return (\n has(data, property) &&\n (get(propertyCondition, 'enum') as unknown[]).find((value) =>\n isEqual(value, data[property])\n ) !== undefined\n );\n } else if (has(propertyCondition, 'pattern')) {\n const pattern = new RegExp(get(propertyCondition, 'pattern'));\n\n return (\n has(data, property) &&\n typeof data[property] === 'string' &&\n pattern.test(data[property] as string)\n );\n }\n\n return false;\n};\n\nconst checkPropertyCondition = (\n propertiesCondition: Record,\n property: string,\n data: Record\n): boolean => {\n if (has(propertiesCondition[property], 'not')) {\n return !checkDataCondition(\n get(propertiesCondition[property], 'not'),\n property,\n data\n );\n }\n\n if (has(propertiesCondition[property], 'properties')) {\n const nextPropertyConditions = get(\n propertiesCondition[property],\n 'properties'\n );\n\n return all(\n (prop) =>\n checkPropertyCondition(\n nextPropertyConditions,\n prop,\n data[property] as Record\n ),\n Object.keys(nextPropertyConditions)\n );\n }\n\n return checkDataCondition(propertiesCondition[property], property, data);\n};\n\nconst evaluateCondition = (\n schema: JsonSchema,\n data: Record\n): boolean => {\n if (has(schema, 'allOf')) {\n return all(\n (subschema: JsonSchema) => evaluateCondition(subschema, data),\n get(schema, 'allOf')\n );\n }\n\n if (has(schema, 'anyOf')) {\n return any(\n (subschema: JsonSchema) => evaluateCondition(subschema, data),\n get(schema, 'anyOf')\n );\n }\n\n if (has(schema, 'oneOf')) {\n const subschemas = get(schema, 'oneOf');\n\n let satisfied = false;\n\n for (let i = 0; i < subschemas.length; i++) {\n const current = evaluateCondition(subschemas[i], data);\n if (current && satisfied) {\n return false;\n }\n\n if (current && !satisfied) {\n satisfied = true;\n }\n }\n\n return satisfied;\n }\n\n let requiredProperties: string[] = [];\n if (has(schema, 'required')) {\n requiredProperties = get(schema, 'required');\n }\n\n const requiredCondition = all(\n (property) => has(data, property),\n requiredProperties\n );\n\n if (has(schema, 'properties')) {\n const propertiesCondition = get(schema, 'properties') as Record<\n string,\n unknown\n >;\n\n const valueCondition = all(\n (property) => checkPropertyCondition(propertiesCondition, property, data),\n Object.keys(propertiesCondition)\n );\n\n return requiredCondition && valueCondition;\n }\n\n return requiredCondition;\n};\n\n/**\n * Go through parent's properties untill the segment is found at the exact level it is defined and check if it is required\n */\nconst extractRequired = (\n schema: JsonSchema,\n segment: string,\n prevSegments: string[]\n) => {\n let i = 0;\n let currentSchema = schema;\n while (\n i < prevSegments.length &&\n has(currentSchema, 'properties') &&\n has(get(currentSchema, 'properties'), prevSegments[i])\n ) {\n currentSchema = get(get(currentSchema, 'properties'), prevSegments[i]);\n ++i;\n }\n\n if (i < prevSegments.length) {\n return false;\n }\n\n return (\n has(currentSchema, 'required') &&\n (get(currentSchema, 'required') as string[]).includes(segment)\n );\n};\n\n/**\n * Check if property's required attribute is set based on if-then-else condition\n *\n */\nconst checkRequiredInIf = (\n schema: JsonSchema,\n segment: string,\n prevSegments: string[],\n data: Record\n): boolean => {\n const propertiesConditionSchema = get(schema, 'if');\n\n const condition = evaluateCondition(propertiesConditionSchema, data);\n\n const ifInThen = has(get(schema, 'then'), 'if');\n const ifInElse = has(get(schema, 'else'), 'if');\n const allOfInThen = has(get(schema, 'then'), 'allOf');\n const allOfInElse = has(get(schema, 'else'), 'allOf');\n\n return (\n (has(schema, 'then') &&\n condition &&\n extractRequired(get(schema, 'then'), segment, prevSegments)) ||\n (has(schema, 'else') &&\n !condition &&\n extractRequired(get(schema, 'else'), segment, prevSegments)) ||\n (ifInThen &&\n condition &&\n checkRequiredInIf(get(schema, 'then'), segment, prevSegments, data)) ||\n (ifInElse &&\n !condition &&\n checkRequiredInIf(get(schema, 'else'), segment, prevSegments, data)) ||\n (allOfInThen &&\n condition &&\n conditionallyRequired(\n get(schema, 'then'),\n segment,\n prevSegments,\n data\n )) ||\n (allOfInElse &&\n !condition &&\n conditionallyRequired(get(schema, 'else'), segment, prevSegments, data))\n );\n};\n\n/**\n * Check if property becomes required based on some if-then-else condition\n * that is part of allOf combinator\n */\nconst conditionallyRequired = (\n schema: JsonSchema,\n segment: string,\n prevSegments: string[],\n data: any\n) => {\n const nestedAllOfSchema = get(schema, 'allOf');\n\n return any((subschema: JsonSchema4 | JsonSchema7): boolean => {\n return (\n (has(subschema, 'if') &&\n checkRequiredInIf(subschema, segment, prevSegments, data)) ||\n conditionallyRequired(subschema, segment, prevSegments, data)\n );\n }, nestedAllOfSchema);\n};\n\n/**\n * Check if property is being required in the parent schema\n */\nconst isRequiredInParent = (\n schema: JsonSchema,\n rootSchema: JsonSchema,\n path: string,\n segment: string,\n prevSegments: string[],\n data: Record\n): boolean => {\n const pathSegments = path.split('/');\n const lastSegment = pathSegments[pathSegments.length - 3];\n const nextHigherSchemaSegments = pathSegments.slice(\n 0,\n pathSegments.length - 4\n );\n\n if (!nextHigherSchemaSegments.length) {\n return false;\n }\n\n const nextHigherSchemaPath = nextHigherSchemaSegments.join('/');\n\n const nextHigherSchema = Resolve.schema(\n schema,\n nextHigherSchemaPath,\n rootSchema\n );\n\n const currentData = Resolve.data(data, toDataPath(nextHigherSchemaPath));\n\n return (\n conditionallyRequired(\n nextHigherSchema,\n segment,\n [lastSegment, ...prevSegments],\n currentData\n ) ||\n (has(nextHigherSchema, 'if') &&\n checkRequiredInIf(\n nextHigherSchema,\n segment,\n [lastSegment, ...prevSegments],\n currentData\n )) ||\n isRequiredInParent(\n schema,\n rootSchema,\n nextHigherSchemaPath,\n segment,\n [lastSegment, ...prevSegments],\n currentData\n )\n );\n};\n\nconst isRequired = (\n schema: JsonSchema,\n schemaPath: string,\n rootSchema: JsonSchema,\n data: any,\n config: any\n): boolean => {\n const pathSegments = schemaPath.split('/');\n const lastSegment = pathSegments[pathSegments.length - 1];\n // Skip \"properties\", \"items\" etc. to resolve the parent\n const nextHigherSchemaSegments = pathSegments.slice(\n 0,\n pathSegments.length - 2\n );\n const nextHigherSchemaPath = nextHigherSchemaSegments.join('/');\n const nextHigherSchema = Resolve.schema(\n schema,\n nextHigherSchemaPath,\n rootSchema\n );\n const currentData = Resolve.data(data, toDataPath(nextHigherSchemaPath));\n\n if (!config?.allowDynamicCheck) {\n return (\n nextHigherSchema !== undefined &&\n nextHigherSchema.required !== undefined &&\n nextHigherSchema.required.indexOf(lastSegment) !== -1\n );\n }\n\n const requiredInIf =\n has(nextHigherSchema, 'if') &&\n checkRequiredInIf(nextHigherSchema, lastSegment, [], currentData);\n\n const requiredConditionally = conditionallyRequired(\n nextHigherSchema,\n lastSegment,\n [],\n currentData\n );\n\n const requiredConditionallyInParent = isRequiredInParent(\n rootSchema,\n rootSchema,\n schemaPath,\n lastSegment,\n [],\n data\n );\n\n return (\n (nextHigherSchema !== undefined &&\n nextHigherSchema.required !== undefined &&\n nextHigherSchema.required.indexOf(lastSegment) !== -1) ||\n requiredInIf ||\n requiredConditionally ||\n requiredConditionallyInParent\n );\n};\n\n/**\n * Adds an asterisk to the given label string based\n * on the required parameter.\n *\n * @param {string | undefined} label the label string\n * @param {boolean} required whether the label belongs to a control which is required\n * @param {boolean} hideRequiredAsterisk applied UI Schema option\n * @returns {string} the label string\n */\nexport const computeLabel = (\n label: string | undefined,\n required: boolean,\n hideRequiredAsterisk: boolean\n): string => {\n return `${label ?? ''}${required && !hideRequiredAsterisk ? '*' : ''}`;\n};\n\n/**\n * Indicates whether to mark a field as required.\n *\n * @param {boolean} required whether the label belongs to a control which is required\n * @param {boolean} hideRequiredAsterisk applied UI Schema option\n * @returns {boolean} should the field be marked as required\n */\nexport const showAsRequired = (\n required: boolean,\n hideRequiredAsterisk: boolean\n): boolean => {\n return required && !hideRequiredAsterisk;\n};\n\n/**\n * Create a default value based on the given schema.\n * @param schema the schema for which to create a default value.\n * @returns {any}\n */\nexport const createDefaultValue = (\n schema: JsonSchema,\n rootSchema: JsonSchema\n) => {\n const resolvedSchema = Resolve.schema(schema, schema.$ref, rootSchema);\n if (resolvedSchema.default !== undefined) {\n return extractDefaults(resolvedSchema, rootSchema);\n }\n if (hasType(resolvedSchema, 'string')) {\n if (\n resolvedSchema.format === 'date-time' ||\n resolvedSchema.format === 'date' ||\n resolvedSchema.format === 'time'\n ) {\n return convertDateToString(new Date(), resolvedSchema.format);\n }\n return '';\n } else if (\n hasType(resolvedSchema, 'integer') ||\n hasType(resolvedSchema, 'number')\n ) {\n return 0;\n } else if (hasType(resolvedSchema, 'boolean')) {\n return false;\n } else if (hasType(resolvedSchema, 'array')) {\n return [];\n } else if (hasType(resolvedSchema, 'object')) {\n return extractDefaults(resolvedSchema, rootSchema);\n } else if (hasType(resolvedSchema, 'null')) {\n return null;\n } else {\n return {};\n }\n};\n\n/**\n * Returns the default value defined in the given schema.\n * @param schema the schema for which to create a default value.\n * @returns {any}\n */\nexport const extractDefaults = (schema: JsonSchema, rootSchema: JsonSchema) => {\n if (hasType(schema, 'object') && schema.default === undefined) {\n const result: { [key: string]: any } = {};\n for (const key in schema.properties) {\n const property = schema.properties[key];\n const resolvedProperty = property.$ref\n ? Resolve.schema(rootSchema, property.$ref, rootSchema)\n : property;\n if (resolvedProperty.default !== undefined) {\n result[key] = cloneDeep(resolvedProperty.default);\n }\n }\n return result;\n }\n return cloneDeep(schema.default);\n};\n\n/**\n * Whether an element's description should be hidden.\n *\n * @param visible whether an element is visible\n * @param description the element's description\n * @param isFocused whether the element is focused\n *\n * @returns {boolean} true, if the description is to be hidden, false otherwise\n */\nexport const isDescriptionHidden = (\n visible: boolean,\n description: string | undefined,\n isFocused: boolean,\n showUnfocusedDescription: boolean\n): boolean => {\n return (\n description === undefined ||\n (description !== undefined && !visible) ||\n (!showUnfocusedDescription && !isFocused)\n );\n};\n\nexport interface WithClassname {\n className?: string;\n}\n\nexport interface EnumOption {\n label: string;\n value: any;\n}\n\nexport const enumToEnumOptionMapper = (\n e: any,\n t?: Translator,\n i18nKey?: string\n): EnumOption => {\n let label = typeof e === 'string' ? e : JSON.stringify(e);\n if (t) {\n if (i18nKey) {\n label = t(`${i18nKey}.${label}`, label);\n } else {\n label = t(label, label);\n }\n }\n return { label, value: e };\n};\n\nexport const oneOfToEnumOptionMapper = (\n e: any,\n t?: Translator,\n fallbackI18nKey?: string\n): EnumOption => {\n let label =\n e.title ??\n (typeof e.const === 'string' ? e.const : JSON.stringify(e.const));\n if (t) {\n // prefer schema keys as they can be more specialized\n if (e.i18n) {\n label = t(e.i18n, label);\n } else if (fallbackI18nKey) {\n label = t(`${fallbackI18nKey}.${label}`, label);\n } else {\n label = t(label, label);\n }\n }\n return {\n label,\n value: e.const,\n };\n};\n\nexport interface OwnPropsOfRenderer {\n /**\n * The UI schema to be rendered.\n */\n uischema?: UISchemaElement;\n /**\n * The JSON schema that describes the data.\n */\n schema?: JsonSchema;\n /**\n * Whether the rendered element should be enabled.\n */\n enabled?: boolean;\n /**\n * Whether the rendered element should be visible.\n */\n visible?: boolean;\n\n /**\n * Optional instance path. Necessary when the actual data\n * path can not be inferred via the UI schema element as\n * it is the case with nested controls.\n */\n path?: string;\n\n renderers?: JsonFormsRendererRegistryEntry[];\n\n cells?: JsonFormsCellRendererRegistryEntry[];\n\n uischemas?: JsonFormsUISchemaRegistryEntry[];\n}\n\nexport interface OwnPropsOfControl extends OwnPropsOfRenderer {\n id?: string;\n // constraint type\n uischema?: ControlElement;\n}\n\nexport interface OwnPropsOfLabel extends OwnPropsOfRenderer {\n uischema?: LabelElement;\n}\n\nexport interface OwnPropsOfEnum {\n options?: EnumOption[];\n}\n\nexport interface OwnPropsOfLayout extends OwnPropsOfRenderer {\n direction?: 'row' | 'column';\n}\n\n/**\n * State-based props of a {@link Renderer}.\n */\nexport interface StatePropsOfRenderer {\n /**\n * Any configuration options for the element.\n */\n config?: any;\n\n /**\n * The UI schema to be rendered.\n */\n uischema: UISchemaElement;\n\n /**\n * The JSON schema that describes the data.\n */\n schema: JsonSchema;\n\n /**\n * The data to be rendered.\n */\n data?: any;\n\n /**\n * Whether the rendered element should be enabled.\n */\n enabled: boolean;\n /**\n * Whether the rendered element should be visible.\n */\n visible: boolean;\n\n /**\n * Instance path the data is written to, in case of a control.\n */\n path: string;\n\n /**\n * All available renderers.\n */\n renderers?: JsonFormsRendererRegistryEntry[];\n\n /**\n * All available cell renderers.\n */\n\n cells?: JsonFormsCellRendererRegistryEntry[];\n}\n\n/**\n * State-based properties for UI schema elements that have a scope.\n */\nexport interface StatePropsOfScopedRenderer extends StatePropsOfRenderer {\n // constraint type\n uischema: ControlElement;\n\n /**\n * Any validation errors that are caused by the data to be rendered.\n */\n errors: string;\n\n /**\n * The data to be rendered.\n */\n data: any;\n\n /**\n * The root schema as returned by the store.\n */\n rootSchema: JsonSchema;\n\n /**\n * A unique ID that should be used for rendering the scoped UI schema element.\n */\n id: string;\n}\n\n/**\n * Props of a {@link Renderer}.\n */\nexport interface RendererProps extends StatePropsOfRenderer {}\n\n/**\n * State-based props of a Control\n */\nexport interface StatePropsOfControl extends StatePropsOfScopedRenderer {\n cells?: { tester: RankedTester; cell: any }[];\n\n /**\n * The label for the rendered element.\n */\n label: string;\n\n /**\n * Description of input cell\n */\n description?: string;\n\n /**\n * Whether the rendered data is required.\n */\n required?: boolean;\n\n i18nKeyPrefix?: string;\n\n // TODO: renderers?\n}\n\n/**\n * Dispatch-based props of a Control.\n */\nexport interface DispatchPropsOfControl {\n /**\n * Update handler that emits a data change\n *\n * @param {string} path the path to the data to be updated\n * @param {any} value the new value that should be written to the given path\n */\n handleChange(path: string, value: any): void;\n}\n\n/**\n * Props of a Control.\n */\nexport interface ControlProps\n extends StatePropsOfControl,\n DispatchPropsOfControl {}\n\n/**\n * State props of a layout;\n */\nexport interface StatePropsOfLayout extends StatePropsOfRenderer {\n /**\n * Direction for the layout to flow\n */\n direction: 'row' | 'column';\n label?: string;\n}\n\nexport interface LayoutProps extends StatePropsOfLayout {}\n\n/**\n * The state of a control.\n */\nexport interface ControlState {\n /**\n * The current value.\n */\n value: any;\n\n /**\n * Whether the control is focused.\n */\n isFocused: boolean;\n}\n\n/**\n * Map state to control props.\n * @param state the store's state\n * @param ownProps any own props\n * @returns {StatePropsOfControl} state props for a control\n */\nexport const mapStateToControlProps = (\n state: JsonFormsState,\n ownProps: OwnPropsOfControl\n): StatePropsOfControl => {\n const { uischema } = ownProps;\n const rootData = getData(state);\n const path = composeWithUi(uischema, ownProps.path);\n const visible: boolean =\n ownProps.visible === undefined || hasShowRule(uischema)\n ? isVisible(uischema, rootData, ownProps.path, getAjv(state))\n : ownProps.visible;\n const controlElement = uischema as ControlElement;\n const id = ownProps.id;\n const rootSchema = getSchema(state);\n const config = getConfig(state);\n const required =\n controlElement.scope !== undefined &&\n isRequired(\n ownProps.schema,\n controlElement.scope,\n rootSchema,\n rootData,\n config\n );\n const resolvedSchema = Resolve.schema(\n ownProps.schema || rootSchema,\n controlElement.scope,\n rootSchema\n );\n const errors = getErrorAt(path, resolvedSchema)(state);\n\n const description =\n resolvedSchema !== undefined ? resolvedSchema.description : '';\n const data = Resolve.data(rootData, path);\n const labelDesc = createLabelDescriptionFrom(uischema, resolvedSchema);\n const label = labelDesc.show ? labelDesc.text : '';\n const enabled: boolean = isInherentlyEnabled(\n state,\n ownProps,\n uischema,\n resolvedSchema || rootSchema,\n rootData,\n config\n );\n\n const schema = resolvedSchema ?? rootSchema;\n const t = getTranslator()(state);\n const te = getErrorTranslator()(state);\n const i18nKeyPrefix = getI18nKeyPrefix(schema, uischema, path);\n const i18nLabel = t(getI18nKey(schema, uischema, path, 'label'), label, {\n schema,\n uischema,\n path,\n errors,\n });\n const i18nDescription = t(\n getI18nKey(schema, uischema, path, 'description'),\n description,\n { schema, uischema, path, errors }\n );\n const i18nErrorMessage = getCombinedErrorMessage(\n errors,\n te,\n t,\n schema,\n uischema,\n path\n );\n\n return {\n data,\n description: i18nDescription,\n errors: i18nErrorMessage,\n label: i18nLabel,\n visible,\n enabled,\n id,\n path,\n required,\n uischema,\n schema,\n config: getConfig(state),\n cells: ownProps.cells || state.jsonforms.cells,\n rootSchema,\n i18nKeyPrefix,\n };\n};\n\n/**\n *\n * Map dispatch to control props.\n *\n * @param dispatch the store's dispatch method\n * @returns {DispatchPropsOfControl} dispatch props for a control\n */\nexport const mapDispatchToControlProps = (\n dispatch: Dispatch\n): DispatchPropsOfControl => ({\n handleChange(path, value) {\n dispatch(update(path, () => value));\n },\n});\n\n/**\n * Default mapStateToCellProps for enum control. Options is used for populating dropdown list\n * @param state\n * @param ownProps\n * @returns {StatePropsOfControl & OwnPropsOfEnum}\n */\nexport const mapStateToEnumControlProps = (\n state: JsonFormsState,\n ownProps: OwnPropsOfControl & OwnPropsOfEnum\n): StatePropsOfControl & OwnPropsOfEnum => {\n const props: StatePropsOfControl = mapStateToControlProps(state, ownProps);\n const options: EnumOption[] =\n ownProps.options ||\n props.schema.enum?.map((e) =>\n enumToEnumOptionMapper(\n e,\n getTranslator()(state),\n getI18nKeyPrefix(props.schema, props.uischema, props.path)\n )\n ) ||\n (props.schema.const && [\n enumToEnumOptionMapper(\n props.schema.const,\n getTranslator()(state),\n getI18nKeyPrefix(props.schema, props.uischema, props.path)\n ),\n ]);\n return {\n ...props,\n options,\n };\n};\n\n/**\n * Default mapStateToCellProps for enum control based on oneOf. Options is used for populating dropdown list\n * @param state\n * @param ownProps\n * @returns {StatePropsOfControl & OwnPropsOfEnum}\n */\nexport const mapStateToOneOfEnumControlProps = (\n state: JsonFormsState,\n ownProps: OwnPropsOfControl & OwnPropsOfEnum\n): StatePropsOfControl & OwnPropsOfEnum => {\n const props: StatePropsOfControl = mapStateToControlProps(state, ownProps);\n const options: EnumOption[] =\n ownProps.options ||\n (props.schema.oneOf as JsonSchema[])?.map((oneOfSubSchema) =>\n oneOfToEnumOptionMapper(\n oneOfSubSchema,\n getTranslator()(state),\n getI18nKeyPrefix(props.schema, props.uischema, props.path)\n )\n );\n return {\n ...props,\n options,\n };\n};\n\n/**\n * Default mapStateToCellProps for multi enum control. Options is used for populating dropdown list\n * @param state\n * @param ownProps\n * @returns {StatePropsOfControl & OwnPropsOfEnum}\n */\nexport const mapStateToMultiEnumControlProps = (\n state: JsonFormsState,\n ownProps: OwnPropsOfControl & OwnPropsOfEnum\n): StatePropsOfControl & OwnPropsOfEnum => {\n const props: StatePropsOfControl = mapStateToControlProps(state, ownProps);\n let items = props.schema.items as JsonSchema;\n items =\n items && items.$ref\n ? resolveSchema(props.rootSchema, items.$ref, props.rootSchema)\n : items;\n const options: EnumOption[] =\n ownProps.options ||\n (items?.oneOf &&\n (items.oneOf as JsonSchema[]).map((oneOfSubSchema) =>\n oneOfToEnumOptionMapper(\n oneOfSubSchema,\n state.jsonforms.i18n?.translate,\n getI18nKeyPrefix(props.schema, props.uischema, props.path)\n )\n )) ||\n items?.enum?.map((e) =>\n enumToEnumOptionMapper(\n e,\n state.jsonforms.i18n?.translate,\n getI18nKeyPrefix(props.schema, props.uischema, props.path)\n )\n );\n return {\n ...props,\n options,\n };\n};\n\n/**\n * Map state to control props.\n * @param state the store's state\n * @param ownProps any own props\n * @returns {StatePropsOfControl} state props for a control\n */\nexport const mapStateToMasterListItemProps = (\n state: JsonFormsState,\n ownProps: OwnPropsOfMasterListItem\n): StatePropsOfMasterItem => {\n const { schema, path, index } = ownProps;\n const firstPrimitiveProp = schema.properties\n ? find(Object.keys(schema.properties), (propName) => {\n const prop = schema.properties[propName];\n return (\n prop.type === 'string' ||\n prop.type === 'number' ||\n prop.type === 'integer'\n );\n })\n : undefined;\n const childPath = composePaths(path, `${index}`);\n const childData = Resolve.data(getData(state), childPath);\n const childLabel = firstPrimitiveProp ? childData[firstPrimitiveProp] : '';\n\n return {\n ...ownProps,\n childLabel,\n };\n};\n\n/**\n * State-based props of a table control.\n */\nexport interface StatePropsOfControlWithDetail extends StatePropsOfControl {\n uischemas?: JsonFormsUISchemaRegistryEntry[];\n renderers?: JsonFormsRendererRegistryEntry[];\n cells?: JsonFormsCellRendererRegistryEntry[];\n}\n\nexport interface OwnPropsOfMasterListItem {\n index: number;\n selected: boolean;\n path: string;\n enabled: boolean;\n schema: JsonSchema;\n handleSelect(index: number): () => void;\n removeItem(path: string, value: number): () => void;\n translations: ArrayTranslations;\n}\n\nexport interface StatePropsOfMasterItem extends OwnPropsOfMasterListItem {\n childLabel: string;\n}\n\n/**\n * Map state to control with detail props\n *\n * @param state the store's state\n * @param ownProps any element's own props\n * @returns {StatePropsOfArrayControl} state props for a table control\n */\nexport const mapStateToControlWithDetailProps = (\n state: JsonFormsState,\n ownProps: OwnPropsOfControl\n): StatePropsOfControlWithDetail => {\n const { ...props } = mapStateToControlProps(state, ownProps);\n\n return {\n ...props,\n uischemas: state.jsonforms.uischemas,\n };\n};\n\nexport interface ControlWithDetailProps\n extends StatePropsOfControlWithDetail,\n DispatchPropsOfControl {}\n\n/**\n * State-based props of a table control.\n */\nexport interface StatePropsOfArrayControl\n extends StatePropsOfControlWithDetail {\n translations: ArrayTranslations;\n childErrors?: ErrorObject[];\n}\n\n/**\n * Map state to table props\n *\n * @param state the store's state\n * @param ownProps any element's own props\n * @returns {StatePropsOfArrayControl} state props for a table control\n */\nexport const mapStateToArrayControlProps = (\n state: JsonFormsState,\n ownProps: OwnPropsOfControl\n): StatePropsOfArrayControl => {\n const { path, schema, uischema, i18nKeyPrefix, label, ...props } =\n mapStateToControlWithDetailProps(state, ownProps);\n\n const resolvedSchema = Resolve.schema(schema, 'items', props.rootSchema);\n const childErrors = getSubErrorsAt(path, resolvedSchema)(state);\n const t = getTranslator()(state);\n\n return {\n ...props,\n label,\n path,\n uischema,\n schema: resolvedSchema,\n childErrors,\n renderers: ownProps.renderers || getRenderers(state),\n cells: ownProps.cells || getCells(state),\n translations: getArrayTranslations(\n t,\n arrayDefaultTranslations,\n i18nKeyPrefix,\n label\n ),\n };\n};\n\n/**\n * Dispatch props of a table control\n */\nexport interface DispatchPropsOfArrayControl {\n addItem(path: string, value: any): () => void;\n removeItems?(path: string, toDelete: number[]): () => void;\n moveUp?(path: string, toMove: number): () => void;\n moveDown?(path: string, toMove: number): () => void;\n}\n\n/**\n * Maps state to dispatch properties of an array control.\n *\n * @param dispatch the store's dispatch method\n * @returns {DispatchPropsOfArrayControl} dispatch props of an array control\n */\nexport const mapDispatchToArrayControlProps = (\n dispatch: Dispatch\n): DispatchPropsOfArrayControl => ({\n addItem: (path: string, value: any) => () => {\n dispatch(\n update(path, (array) => {\n if (array === undefined || array === null) {\n return [value];\n }\n\n array.push(value);\n return array;\n })\n );\n },\n removeItems: (path: string, toDelete: number[]) => () => {\n dispatch(\n update(path, (array) => {\n toDelete\n .sort((a, b) => a - b)\n .reverse()\n .forEach((s) => array.splice(s, 1));\n return array;\n })\n );\n },\n moveUp: (path, toMove: number) => () => {\n dispatch(\n update(path, (array) => {\n moveUp(array, toMove);\n return array;\n })\n );\n },\n moveDown: (path, toMove: number) => () => {\n dispatch(\n update(path, (array) => {\n moveDown(array, toMove);\n return array;\n })\n );\n },\n});\n\nexport interface DispatchPropsOfMultiEnumControl {\n addItem: (path: string, value: any) => void;\n removeItem?: (path: string, toDelete: any) => void;\n}\n\nexport const mapDispatchToMultiEnumProps = (\n dispatch: Dispatch\n): DispatchPropsOfMultiEnumControl => ({\n addItem: (path: string, value: any) => {\n dispatch(\n update(path, (data) => {\n if (data === undefined || data === null) {\n return [value];\n }\n data.push(value);\n return data;\n })\n );\n },\n removeItem: (path: string, toDelete: any) => {\n dispatch(\n update(path, (data) => {\n const indexInData = data.indexOf(toDelete);\n data.splice(indexInData, 1);\n return data;\n })\n );\n },\n});\n\n/**\n * Props of an array control.\n */\nexport interface ArrayControlProps\n extends StatePropsOfArrayControl,\n DispatchPropsOfArrayControl {}\n\nexport const layoutDefaultProps: {\n visible: boolean;\n enabled: boolean;\n path: string;\n direction: 'row' | 'column';\n} = {\n visible: true,\n enabled: true,\n path: '',\n direction: 'column',\n};\n\nconst getDirection = (uischema: UISchemaElement) => {\n if (uischema.type === 'HorizontalLayout') {\n return 'row';\n }\n if (uischema.type === 'VerticalLayout') {\n return 'column';\n }\n return layoutDefaultProps.direction;\n};\n\n/**\n * Map state to layout props.\n * @param state JSONForms state tree\n * @param ownProps any own props\n * @returns {StatePropsOfLayout}\n */\nexport const mapStateToLayoutProps = (\n state: JsonFormsState,\n ownProps: OwnPropsOfLayout\n): LayoutProps => {\n const rootData = getData(state);\n const { uischema } = ownProps;\n const visible: boolean =\n ownProps.visible === undefined || hasShowRule(uischema)\n ? isVisible(ownProps.uischema, rootData, ownProps.path, getAjv(state))\n : ownProps.visible;\n\n const data = Resolve.data(rootData, ownProps.path);\n const config = getConfig(state);\n const enabled: boolean = isInherentlyEnabled(\n state,\n ownProps,\n uischema,\n undefined, // layouts have no associated schema\n rootData,\n config\n );\n\n // some layouts have labels which might need to be translated\n const t = getTranslator()(state);\n const label = isLabelable(uischema)\n ? deriveLabelForUISchemaElement(uischema, t)\n : undefined;\n\n return {\n ...layoutDefaultProps,\n renderers: ownProps.renderers || getRenderers(state),\n cells: ownProps.cells || getCells(state),\n visible,\n enabled,\n path: ownProps.path,\n data,\n uischema: ownProps.uischema,\n schema: ownProps.schema,\n direction: ownProps.direction ?? getDirection(uischema),\n config,\n label,\n };\n};\n\nexport type RefResolver = (schema: JsonSchema) => Promise;\n\nexport interface OwnPropsOfJsonFormsRenderer extends OwnPropsOfRenderer {}\n\nexport interface StatePropsOfJsonFormsRenderer\n extends OwnPropsOfJsonFormsRenderer {\n rootSchema: JsonSchema;\n config: any;\n}\n\nexport interface JsonFormsProps extends StatePropsOfJsonFormsRenderer {}\n\nexport const mapStateToJsonFormsRendererProps = (\n state: JsonFormsState,\n ownProps: OwnPropsOfJsonFormsRenderer\n): StatePropsOfJsonFormsRenderer => {\n return {\n renderers: ownProps.renderers || get(state.jsonforms, 'renderers'),\n cells: ownProps.cells || get(state.jsonforms, 'cells'),\n schema: ownProps.schema || getSchema(state),\n rootSchema: getSchema(state),\n uischema: ownProps.uischema || getUiSchema(state),\n path: ownProps.path,\n enabled: ownProps.enabled,\n config: getConfig(state),\n };\n};\n\nexport const controlDefaultProps = {\n ...layoutDefaultProps,\n errors: [] as string[],\n};\n\nexport interface StatePropsOfCombinator extends StatePropsOfControl {\n rootSchema: JsonSchema;\n path: string;\n id: string;\n indexOfFittingSchema: number;\n uischemas: JsonFormsUISchemaRegistryEntry[];\n data: any;\n translations: CombinatorTranslations;\n}\n\nexport const mapStateToCombinatorRendererProps = (\n state: JsonFormsState,\n ownProps: OwnPropsOfControl,\n keyword: CombinatorKeyword\n): StatePropsOfCombinator => {\n const { data, schema, rootSchema, i18nKeyPrefix, label, ...props } =\n mapStateToControlProps(state, ownProps);\n\n const ajv = state.jsonforms.core.ajv;\n const t = getTranslator()(state);\n const translations = getCombinatorTranslations(\n t,\n combinatorDefaultTranslations,\n i18nKeyPrefix,\n label\n );\n const structuralKeywords = [\n 'required',\n 'additionalProperties',\n 'type',\n 'enum',\n 'const',\n ];\n const dataIsValid = (errors: ErrorObject[]): boolean => {\n return (\n !errors ||\n errors.length === 0 ||\n !errors.find((e) => structuralKeywords.indexOf(e.keyword) !== -1)\n );\n };\n let indexOfFittingSchema: number;\n // TODO instead of compiling the combinator subschemas we can compile the original schema\n // without the combinator alternatives and then revalidate and check the errors for the\n // element\n for (let i = 0; i < schema[keyword]?.length; i++) {\n try {\n let _schema = schema[keyword][i];\n if (_schema.$ref) {\n _schema = Resolve.schema(rootSchema, _schema.$ref, rootSchema);\n }\n const valFn = ajv.compile(_schema);\n valFn(data);\n if (dataIsValid(valFn.errors)) {\n indexOfFittingSchema = i;\n break;\n }\n } catch (error) {\n console.debug(\n \"Combinator subschema is not self contained, can't hand it over to AJV\"\n );\n }\n }\n\n return {\n data,\n schema,\n rootSchema,\n ...props,\n i18nKeyPrefix,\n label,\n indexOfFittingSchema,\n uischemas: getUISchemas(state),\n translations,\n };\n};\n\nexport interface CombinatorRendererProps\n extends StatePropsOfCombinator,\n DispatchPropsOfControl {}\n/**\n * Map state to all of renderer props.\n * @param state the store's state\n * @param ownProps any own props\n * @returns {StatePropsOfCombinator} state props for a combinator\n */\nexport const mapStateToAllOfProps = (\n state: JsonFormsState,\n ownProps: OwnPropsOfControl\n): StatePropsOfCombinator =>\n mapStateToCombinatorRendererProps(state, ownProps, 'allOf');\n\nexport const mapStateToAnyOfProps = (\n state: JsonFormsState,\n ownProps: OwnPropsOfControl\n): StatePropsOfCombinator => {\n return mapStateToCombinatorRendererProps(state, ownProps, 'anyOf');\n};\n\nexport const mapStateToOneOfProps = (\n state: JsonFormsState,\n ownProps: OwnPropsOfControl\n): StatePropsOfCombinator => {\n return mapStateToCombinatorRendererProps(state, ownProps, 'oneOf');\n};\n\nexport interface StatePropsOfArrayLayout extends StatePropsOfControlWithDetail {\n data: number;\n translations: ArrayTranslations;\n minItems?: number;\n}\n/**\n * Map state to table props\n *\n * @param state the store's state\n * @param ownProps any element's own props\n * @returns {StatePropsOfArrayControl} state props for a table control\n */\nexport const mapStateToArrayLayoutProps = (\n state: JsonFormsState,\n ownProps: OwnPropsOfControl\n): StatePropsOfArrayLayout => {\n const { path, schema, uischema, errors, i18nKeyPrefix, label, ...props } =\n mapStateToControlWithDetailProps(state, ownProps);\n\n const resolvedSchema = Resolve.schema(schema, 'items', props.rootSchema);\n const t = getTranslator()(state);\n // TODO Does not consider 'i18n' keys which are specified in the ui schemas of the sub errors\n const childErrors = getCombinedErrorMessage(\n getSubErrorsAt(path, resolvedSchema)(state),\n getErrorTranslator()(state),\n t,\n undefined,\n undefined,\n undefined\n );\n\n const allErrors =\n errors +\n (errors.length > 0 && childErrors.length > 0 ? '\\n' : '') +\n childErrors;\n return {\n ...props,\n label,\n path,\n uischema,\n schema: resolvedSchema,\n data: props.data ? props.data.length : 0,\n errors: allErrors,\n minItems: schema.minItems,\n translations: getArrayTranslations(\n t,\n arrayDefaultTranslations,\n i18nKeyPrefix,\n label\n ),\n };\n};\n\n/**\n * Props of an array control.\n */\nexport interface ArrayLayoutProps\n extends StatePropsOfArrayLayout,\n DispatchPropsOfArrayControl {}\n\nexport interface StatePropsOfLabel extends StatePropsOfRenderer {\n text?: string;\n}\nexport interface LabelProps extends StatePropsOfLabel {}\n\nexport const mapStateToLabelProps = (\n state: JsonFormsState,\n props: OwnPropsOfLabel\n) => {\n const { uischema } = props;\n\n const visible: boolean =\n props.visible === undefined || hasShowRule(uischema)\n ? isVisible(props.uischema, getData(state), props.path, getAjv(state))\n : props.visible;\n\n const text = uischema.text;\n const t = getTranslator()(state);\n const i18nKeyPrefix = getI18nKeyPrefixBySchema(undefined, uischema);\n const i18nKey = i18nKeyPrefix ? `${i18nKeyPrefix}.text` : text ?? '';\n const i18nText = t(i18nKey, text, { uischema });\n\n return {\n text: i18nText,\n visible,\n config: getConfig(state),\n renderers: props.renderers || getRenderers(state),\n cells: props.cells || getCells(state),\n };\n};\n","/*\n The MIT License\n\n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport isEmpty from 'lodash/isEmpty';\nimport {\n getErrorTranslator,\n getAjv,\n getConfig,\n getData,\n getErrorAt,\n getSchema,\n getTranslator,\n} from '../reducers';\nimport type { JsonFormsCellRendererRegistryEntry } from '../reducers';\nimport type { AnyAction, Dispatch } from './type';\nimport { Resolve } from './util';\nimport { isInherentlyEnabled, isVisible } from './runtime';\nimport {\n DispatchPropsOfControl,\n EnumOption,\n enumToEnumOptionMapper,\n mapDispatchToControlProps,\n oneOfToEnumOptionMapper,\n OwnPropsOfControl,\n OwnPropsOfEnum,\n StatePropsOfScopedRenderer,\n} from './renderer';\nimport { getCombinedErrorMessage, getI18nKeyPrefix } from '../i18n';\nimport type { JsonFormsState } from '../store';\nimport type { JsonSchema } from '../models';\n\nexport interface OwnPropsOfCell extends OwnPropsOfControl {\n data?: any;\n}\n\n/**\n * State props of a cell.\n */\nexport interface StatePropsOfCell extends StatePropsOfScopedRenderer {\n isValid: boolean;\n rootSchema: JsonSchema;\n}\n\nexport interface OwnPropsOfEnumCell extends OwnPropsOfCell, OwnPropsOfEnum {}\n\n/**\n * State props of a cell for enum cell\n */\nexport interface StatePropsOfEnumCell\n extends StatePropsOfCell,\n OwnPropsOfEnum {}\n\n/**\n * Props of an enum cell.\n */\nexport interface EnumCellProps\n extends StatePropsOfEnumCell,\n DispatchPropsOfControl {}\n\nexport type DispatchPropsOfCell = DispatchPropsOfControl;\n\n/**\n * Props of a cell.\n */\nexport interface CellProps extends StatePropsOfCell, DispatchPropsOfCell {}\n/**\n * Registers the given cell renderer when a JSON Forms store is created.\n * @param {RankedTester} tester\n * @param cell the cell to be registered\n * @returns {any}\n */\nexport interface DispatchCellStateProps extends StatePropsOfCell {\n cells?: JsonFormsCellRendererRegistryEntry[];\n}\n\n/**\n * Map state to cell props.\n *\n * @param state JSONForms state tree\n * @param ownProps any own props\n * @returns {StatePropsOfCell} state props of a cell\n */\nexport const mapStateToCellProps = (\n state: JsonFormsState,\n ownProps: OwnPropsOfCell\n): StatePropsOfCell => {\n const { id, schema, path, uischema, renderers, cells } = ownProps;\n const rootData = getData(state);\n const visible =\n ownProps.visible !== undefined\n ? ownProps.visible\n : isVisible(uischema, rootData, undefined, getAjv(state));\n\n const rootSchema = getSchema(state);\n const config = getConfig(state);\n\n /* When determining the enabled state of cells we take a shortcut: At the\n * moment it's only possible to configure enablement and disablement at the\n * control level. Therefore the renderer using the cell, for example a\n * table renderer, determines whether a cell is enabled and should hand\n * over the prop themselves. If that prop was given, we prefer it over\n * anything else to save evaluation effort (except for the global readonly\n * flag). For example it would be quite expensive to evaluate the same ui schema\n * rule again and again for each cell of a table. */\n let enabled;\n if (state.jsonforms.readonly === true) {\n enabled = false;\n } else if (typeof ownProps.enabled === 'boolean') {\n enabled = ownProps.enabled;\n } else {\n enabled = isInherentlyEnabled(\n state,\n ownProps,\n uischema,\n schema || rootSchema,\n rootData,\n config\n );\n }\n\n const t = getTranslator()(state);\n const te = getErrorTranslator()(state);\n const errors = getCombinedErrorMessage(\n getErrorAt(path, schema)(state),\n te,\n t,\n schema,\n uischema,\n path\n );\n const isValid = isEmpty(errors);\n\n return {\n data: Resolve.data(rootData, path),\n visible,\n enabled,\n id,\n path,\n errors,\n isValid,\n schema,\n uischema,\n config: getConfig(state),\n rootSchema,\n renderers,\n cells,\n };\n};\n\nexport const mapStateToDispatchCellProps = (\n state: JsonFormsState,\n ownProps: OwnPropsOfCell\n): DispatchCellStateProps => {\n const props: StatePropsOfCell = mapStateToCellProps(state, ownProps);\n const { renderers: _renderers, cells, ...otherOwnProps } = ownProps;\n return {\n ...props,\n ...otherOwnProps,\n cells: cells || state.jsonforms.cells || [],\n };\n};\n\nexport interface DispatchCellProps extends DispatchCellStateProps {}\n\n/**\n * Default mapStateToCellProps for enum cell. Options is used for populating dropdown list\n * @param state\n * @param ownProps\n * @returns {StatePropsOfEnumCell}\n */\nexport const defaultMapStateToEnumCellProps = (\n state: JsonFormsState,\n ownProps: OwnPropsOfEnumCell\n): StatePropsOfEnumCell => {\n const props: StatePropsOfCell = mapStateToCellProps(state, ownProps);\n const options: EnumOption[] =\n ownProps.options ||\n props.schema.enum?.map((e) =>\n enumToEnumOptionMapper(\n e,\n getTranslator()(state),\n getI18nKeyPrefix(props.schema, props.uischema, props.path)\n )\n ) ||\n (props.schema.const && [\n enumToEnumOptionMapper(\n props.schema.const,\n getTranslator()(state),\n getI18nKeyPrefix(props.schema, props.uischema, props.path)\n ),\n ]);\n return {\n ...props,\n options,\n };\n};\n\n/**\n * mapStateToOneOfEnumCellProps for one of enum cell. Options is used for populating dropdown list from oneOf\n * @param state\n * @param ownProps\n * @returns {StatePropsOfEnumCell}\n */\nexport const mapStateToOneOfEnumCellProps = (\n state: JsonFormsState,\n ownProps: OwnPropsOfEnumCell\n): StatePropsOfEnumCell => {\n const props: StatePropsOfCell = mapStateToCellProps(state, ownProps);\n const options: EnumOption[] =\n ownProps.options ||\n (props.schema.oneOf as JsonSchema[])?.map((oneOfSubSchema) =>\n oneOfToEnumOptionMapper(\n oneOfSubSchema,\n getTranslator()(state),\n getI18nKeyPrefix(props.schema, props.uischema, props.path)\n )\n );\n return {\n ...props,\n options,\n };\n};\n\n/**\n * Synonym for mapDispatchToControlProps.\n *\n * @type {(dispatch) => {handleChange(path, value): void}}\n */\nexport const mapDispatchToCellProps: (\n dispatch: Dispatch\n) => DispatchPropsOfControl = mapDispatchToControlProps;\n\n/**\n * Default dispatch to control props which can be customized to set handleChange action\n *\n */\nexport const defaultMapDispatchToControlProps =\n // TODO: ownProps types\n (dispatch: Dispatch, ownProps: any): DispatchPropsOfControl => {\n const { handleChange } = mapDispatchToCellProps(dispatch);\n\n return {\n handleChange: ownProps.handleChange || handleChange,\n };\n };\n","/*\n The MIT License\n \n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport type { ControlElement, JsonSchema, UISchemaElement } from '../models';\nimport { findUISchema, JsonFormsUISchemaRegistryEntry } from '../reducers';\nimport { Resolve } from './util';\n\nexport interface CombinatorSubSchemaRenderInfo {\n schema: JsonSchema;\n uischema: UISchemaElement;\n label: string;\n}\n\nexport type CombinatorKeyword = 'anyOf' | 'oneOf' | 'allOf';\n\nexport const createCombinatorRenderInfos = (\n combinatorSubSchemas: JsonSchema[],\n rootSchema: JsonSchema,\n keyword: CombinatorKeyword,\n control: ControlElement,\n path: string,\n uischemas: JsonFormsUISchemaRegistryEntry[]\n): CombinatorSubSchemaRenderInfo[] =>\n combinatorSubSchemas.map((subSchema, subSchemaIndex) => {\n const resolvedSubSchema =\n subSchema.$ref && Resolve.schema(rootSchema, subSchema.$ref, rootSchema);\n\n const schema = resolvedSubSchema ?? subSchema;\n\n return {\n schema,\n uischema: findUISchema(\n uischemas,\n schema,\n control.scope,\n path,\n undefined,\n control,\n rootSchema\n ),\n label:\n subSchema.title ??\n resolvedSubSchema?.title ??\n `${keyword}-${subSchemaIndex}`,\n };\n });\n","/*\n The MIT License\n \n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nconst usedIds: Set = new Set();\n\nconst makeId = (idBase: string, iteration: number) =>\n iteration <= 1 ? idBase : idBase + iteration.toString();\n\nconst isUniqueId = (idBase: string, iteration: number) => {\n const newID = makeId(idBase, iteration);\n return !usedIds.has(newID);\n};\n\nexport const createId = (proposedId: string) => {\n if (proposedId === undefined) {\n // failsafe to avoid endless loops in error cases\n proposedId = 'undefined';\n }\n let tries = 0;\n while (!isUniqueId(proposedId, tries)) {\n tries++;\n }\n const newID = makeId(proposedId, tries);\n usedIds.add(newID);\n return newID;\n};\n\nexport const removeId = (id: string) => usedIds.delete(id);\n\nexport const clearAllIds = () => usedIds.clear();\n","/*\n The MIT License\n\n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport find from 'lodash/find';\nimport { JsonSchema } from '../models';\n\nexport const getFirstPrimitiveProp = (schema: any) => {\n if (schema.properties) {\n return find(Object.keys(schema.properties), (propName) => {\n const prop = schema.properties[propName];\n return (\n prop.type === 'string' ||\n prop.type === 'number' ||\n prop.type === 'integer'\n );\n });\n }\n return undefined;\n};\n\n/**\n * Tests whether the schema has an enum based on oneOf.\n */\nexport const isOneOfEnumSchema = (schema: JsonSchema) =>\n !!schema &&\n Object.prototype.hasOwnProperty.call(schema, 'oneOf') &&\n schema.oneOf &&\n (schema.oneOf as JsonSchema[]).every((s) => s.const !== undefined);\n","/*\n The MIT License\n\n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport isEmpty from 'lodash/isEmpty';\nimport { isLayout, UISchemaElement } from '../models';\n\nexport type IterateCallback = (uischema: UISchemaElement) => void;\n\nconst setReadonlyPropertyValue =\n (value: boolean): IterateCallback =>\n (child: UISchemaElement): void => {\n if (!child.options) {\n child.options = {};\n }\n child.options.readonly = value;\n };\nexport const setReadonly = (uischema: UISchemaElement): void => {\n iterateSchema(uischema, setReadonlyPropertyValue(true));\n};\nexport const unsetReadonly = (uischema: UISchemaElement): void => {\n iterateSchema(uischema, setReadonlyPropertyValue(false));\n};\nexport const iterateSchema = (\n uischema: UISchemaElement,\n toApply: IterateCallback\n): void => {\n if (isEmpty(uischema)) {\n return;\n }\n if (isLayout(uischema)) {\n uischema.elements.forEach((child) => iterateSchema(child, toApply));\n return;\n }\n toApply(uischema);\n};\n","/*\n The MIT License\n \n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\nimport Ajv from 'ajv';\nimport addFormats from 'ajv-formats';\nimport type { Options } from 'ajv';\n\nexport const createAjv = (options?: Options) => {\n const ajv = new Ajv({\n allErrors: true,\n verbose: true,\n strict: false,\n addUsedSchema: false,\n ...options,\n });\n addFormats(ajv);\n return ajv;\n};\n","/*\n The MIT License\n \n Copyright (c) 2023-2023 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nexport const defaultDateFormat = 'YYYY-MM-DD';\nexport const defaultTimeFormat = 'HH:mm:ss';\nexport const defaultDateTimeFormat = 'YYYY-MM-DDTHH:mm:ss.sssZ';\n","/*\n The MIT License\n\n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport isEmpty from 'lodash/isEmpty';\nimport startCase from 'lodash/startCase';\nimport keys from 'lodash/keys';\nimport {\n ControlElement,\n isGroup,\n isLayout,\n JsonSchema,\n LabelElement,\n Layout,\n UISchemaElement,\n} from '../models';\nimport { deriveTypes, encode, resolveSchema } from '../util';\n\n/**\n * Creates a new ILayout.\n * @param layoutType The type of the laoyut\n * @returns the new ILayout\n */\nconst createLayout = (layoutType: string): Layout => ({\n type: layoutType,\n elements: [],\n});\n\n/**\n * Creates a IControlObject with the given label referencing the given ref\n */\nexport const createControlElement = (ref: string): ControlElement => ({\n type: 'Control',\n scope: ref,\n});\n\n/**\n * Wraps the given {@code uiSchema} in a Layout if there is none already.\n * @param uischema The ui schema to wrap in a layout.\n * @param layoutType The type of the layout to create.\n * @returns the wrapped uiSchema.\n */\nconst wrapInLayoutIfNecessary = (\n uischema: UISchemaElement,\n layoutType: string\n): Layout => {\n if (!isEmpty(uischema) && !isLayout(uischema)) {\n const verticalLayout: Layout = createLayout(layoutType);\n verticalLayout.elements.push(uischema);\n\n return verticalLayout;\n }\n\n return uischema as Layout;\n};\n\n/**\n * Adds the given {@code labelName} to the {@code layout} if it exists\n * @param layout\n * The layout which is to receive the label\n * @param labelName\n * The name of the schema\n */\nconst addLabel = (layout: Layout, labelName: string) => {\n if (!isEmpty(labelName)) {\n const fixedLabel = startCase(labelName);\n if (isGroup(layout)) {\n layout.label = fixedLabel;\n } else {\n // add label with name\n const label: LabelElement = {\n type: 'Label',\n text: fixedLabel,\n };\n layout.elements.push(label);\n }\n }\n};\n\n/**\n * Returns whether the given {@code jsonSchema} is a combinator ({@code oneOf}, {@code anyOf}, {@code allOf}) at the root level\n * @param jsonSchema\n * the schema to check\n */\nconst isCombinator = (jsonSchema: JsonSchema): boolean => {\n return (\n !isEmpty(jsonSchema) &&\n (!isEmpty(jsonSchema.oneOf) ||\n !isEmpty(jsonSchema.anyOf) ||\n !isEmpty(jsonSchema.allOf))\n );\n};\n\nconst generateUISchema = (\n jsonSchema: JsonSchema,\n schemaElements: UISchemaElement[],\n currentRef: string,\n schemaName: string,\n layoutType: string,\n rootSchema?: JsonSchema\n): UISchemaElement => {\n if (!isEmpty(jsonSchema) && jsonSchema.$ref !== undefined) {\n return generateUISchema(\n resolveSchema(rootSchema, jsonSchema.$ref, rootSchema),\n schemaElements,\n currentRef,\n schemaName,\n layoutType,\n rootSchema\n );\n }\n\n if (isCombinator(jsonSchema)) {\n const controlObject: ControlElement = createControlElement(currentRef);\n schemaElements.push(controlObject);\n\n return controlObject;\n }\n\n const types = deriveTypes(jsonSchema);\n if (types.length === 0) {\n return null;\n }\n\n if (types.length > 1) {\n const controlObject: ControlElement = createControlElement(currentRef);\n schemaElements.push(controlObject);\n return controlObject;\n }\n\n if (currentRef === '#' && types[0] === 'object') {\n const layout: Layout = createLayout(layoutType);\n schemaElements.push(layout);\n\n if (jsonSchema.properties && keys(jsonSchema.properties).length > 1) {\n addLabel(layout, schemaName);\n }\n\n if (!isEmpty(jsonSchema.properties)) {\n // traverse properties\n const nextRef: string = currentRef + '/properties';\n Object.keys(jsonSchema.properties).map((propName) => {\n let value = jsonSchema.properties[propName];\n const ref = `${nextRef}/${encode(propName)}`;\n if (value.$ref !== undefined) {\n value = resolveSchema(rootSchema, value.$ref, rootSchema);\n }\n generateUISchema(\n value,\n layout.elements,\n ref,\n propName,\n layoutType,\n rootSchema\n );\n });\n }\n\n return layout;\n }\n\n switch (types[0]) {\n case 'object': // object items will be handled by the object control itself\n /* falls through */\n case 'array': // array items will be handled by the array control itself\n /* falls through */\n case 'string':\n /* falls through */\n case 'number':\n /* falls through */\n case 'integer':\n /* falls through */\n case 'null':\n /* falls through */\n case 'boolean': {\n const controlObject: ControlElement = createControlElement(currentRef);\n schemaElements.push(controlObject);\n\n return controlObject;\n }\n default:\n throw new Error('Unknown type: ' + JSON.stringify(jsonSchema));\n }\n};\n\n/**\n * Generate a default UI schema.\n * @param {JsonSchema} jsonSchema the JSON schema to generated a UI schema for\n * @param {string} layoutType the desired layout type for the root layout\n * of the generated UI schema\n */\nexport const generateDefaultUISchema = (\n jsonSchema: JsonSchema,\n layoutType = 'VerticalLayout',\n prefix = '#',\n rootSchema = jsonSchema\n): UISchemaElement =>\n wrapInLayoutIfNecessary(\n generateUISchema(jsonSchema, [], prefix, '', layoutType, rootSchema),\n layoutType\n );\n","/*\n The MIT License\n \n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport { generateJsonSchema } from './schema';\nimport { createControlElement, generateDefaultUISchema } from './uischema';\nimport type { ControlElement, JsonSchema, UISchemaElement } from '../';\n\nexport const Generate: {\n // TODO fix @typescript-eslint/ban-types\n // eslint-disable-next-line @typescript-eslint/ban-types\n jsonSchema(instance: Object, options?: any): JsonSchema;\n uiSchema(\n jsonSchema: JsonSchema,\n layoutType?: string,\n prefix?: string,\n rootSchema?: JsonSchema\n ): UISchemaElement;\n controlElement(ref: string): ControlElement;\n} = {\n jsonSchema: generateJsonSchema,\n uiSchema: generateDefaultUISchema,\n controlElement: createControlElement,\n};\n","/*\n The MIT License\n \n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport type AJV from 'ajv';\nimport type { ErrorObject } from 'ajv';\nimport type { JsonSchema, UISchemaElement } from '../models';\nimport { generateDefaultUISchema, generateJsonSchema } from '../generators';\n\nimport type { RankedTester } from '../testers';\nimport type { UISchemaTester, ValidationMode } from '../reducers';\nimport type { ErrorTranslator, Translator } from '../i18n';\n\nexport const INIT = 'jsonforms/INIT' as const;\nexport const UPDATE_CORE = 'jsonforms/UPDATE_CORE' as const;\nexport const SET_AJV = 'jsonforms/SET_AJV' as const;\nexport const UPDATE_DATA = 'jsonforms/UPDATE' as const;\nexport const UPDATE_ERRORS = 'jsonforms/UPDATE_ERRORS' as const;\nexport const VALIDATE = 'jsonforms/VALIDATE' as const;\nexport const ADD_RENDERER = 'jsonforms/ADD_RENDERER' as const;\nexport const REMOVE_RENDERER = 'jsonforms/REMOVE_RENDERER' as const;\nexport const ADD_CELL = 'jsonforms/ADD_CELL' as const;\nexport const REMOVE_CELL = 'jsonforms/REMOVE_CELL' as const;\nexport const SET_CONFIG = 'jsonforms/SET_CONFIG' as const;\nexport const ADD_UI_SCHEMA = 'jsonforms/ADD_UI_SCHEMA' as const;\nexport const REMOVE_UI_SCHEMA = 'jsonforms/REMOVE_UI_SCHEMA' as const;\nexport const SET_SCHEMA = 'jsonforms/SET_SCHEMA' as const;\nexport const SET_UISCHEMA = 'jsonforms/SET_UISCHEMA' as const;\nexport const SET_VALIDATION_MODE = 'jsonforms/SET_VALIDATION_MODE' as const;\n\nexport const SET_LOCALE = 'jsonforms/SET_LOCALE' as const;\nexport const SET_TRANSLATOR = 'jsonforms/SET_TRANSLATOR' as const;\nexport const UPDATE_I18N = 'jsonforms/UPDATE_I18N' as const;\n\nexport const ADD_DEFAULT_DATA = 'jsonforms/ADD_DEFAULT_DATA' as const;\nexport const REMOVE_DEFAULT_DATA = 'jsonforms/REMOVE_DEFAULT_DATA' as const;\n\nexport type CoreActions =\n | InitAction\n | UpdateCoreAction\n | UpdateAction\n | UpdateErrorsAction\n | SetAjvAction\n | SetSchemaAction\n | SetUISchemaAction\n | SetValidationModeAction;\n\nexport interface UpdateAction {\n type: 'jsonforms/UPDATE';\n path: string;\n updater(existingData?: any): any;\n}\n\nexport interface UpdateErrorsAction {\n type: 'jsonforms/UPDATE_ERRORS';\n errors: ErrorObject[];\n}\n\nexport interface InitAction {\n type: 'jsonforms/INIT';\n data: any;\n schema: JsonSchema;\n uischema: UISchemaElement;\n options?: InitActionOptions | AJV;\n}\n\nexport interface UpdateCoreAction {\n type: 'jsonforms/UPDATE_CORE';\n data?: any;\n schema?: JsonSchema;\n uischema?: UISchemaElement;\n options?: InitActionOptions | AJV;\n}\n\nexport interface InitActionOptions {\n ajv?: AJV;\n validationMode?: ValidationMode;\n additionalErrors?: ErrorObject[];\n}\n\nexport interface SetValidationModeAction {\n type: 'jsonforms/SET_VALIDATION_MODE';\n validationMode: ValidationMode;\n}\n\nexport const init = (\n data: any,\n schema: JsonSchema = generateJsonSchema(data),\n uischema?: UISchemaElement,\n options?: InitActionOptions | AJV\n) => ({\n type: INIT,\n data,\n schema,\n uischema:\n typeof uischema === 'object' ? uischema : generateDefaultUISchema(schema),\n options,\n});\n\nexport const updateCore = (\n data: any,\n schema: JsonSchema,\n uischema?: UISchemaElement,\n options?: AJV | InitActionOptions\n): UpdateCoreAction => ({\n type: UPDATE_CORE,\n data,\n schema,\n uischema,\n options,\n});\n\nexport interface RegisterDefaultDataAction {\n type: 'jsonforms/ADD_DEFAULT_DATA';\n schemaPath: string;\n data: any;\n}\n\nexport const registerDefaultData = (schemaPath: string, data: any) => ({\n type: ADD_DEFAULT_DATA,\n schemaPath,\n data,\n});\n\nexport interface UnregisterDefaultDataAction {\n type: 'jsonforms/REMOVE_DEFAULT_DATA';\n schemaPath: string;\n}\n\nexport const unregisterDefaultData = (schemaPath: string) => ({\n type: REMOVE_DEFAULT_DATA,\n schemaPath,\n});\n\nexport interface SetAjvAction {\n type: 'jsonforms/SET_AJV';\n ajv: AJV;\n}\n\nexport const setAjv = (ajv: AJV) => ({\n type: SET_AJV,\n ajv,\n});\n\nexport const update = (\n path: string,\n updater: (existingData: any) => any\n): UpdateAction => ({\n type: UPDATE_DATA,\n path,\n updater,\n});\n\nexport const updateErrors = (errors: ErrorObject[]): UpdateErrorsAction => ({\n type: UPDATE_ERRORS,\n errors,\n});\n\nexport interface AddRendererAction {\n type: 'jsonforms/ADD_RENDERER';\n tester: RankedTester;\n renderer: any;\n}\n\nexport const registerRenderer = (tester: RankedTester, renderer: any) => ({\n type: ADD_RENDERER,\n tester,\n renderer,\n});\n\nexport interface AddCellRendererAction {\n type: 'jsonforms/ADD_CELL';\n tester: RankedTester;\n cell: any;\n}\n\nexport const registerCell = (tester: RankedTester, cell: any) => ({\n type: ADD_CELL,\n tester,\n cell,\n});\n\nexport interface RemoveCellRendererAction {\n type: 'jsonforms/REMOVE_CELL';\n tester: RankedTester;\n cell: any;\n}\n\nexport const unregisterCell = (tester: RankedTester, cell: any) => ({\n type: REMOVE_CELL,\n tester,\n cell,\n});\n\nexport interface RemoveRendererAction {\n type: 'jsonforms/REMOVE_RENDERER';\n tester: RankedTester;\n renderer: any;\n}\n\nexport const unregisterRenderer = (tester: RankedTester, renderer: any) => ({\n type: REMOVE_RENDERER,\n tester,\n renderer,\n});\n\nexport interface SetConfigAction {\n type: 'jsonforms/SET_CONFIG';\n config: any;\n}\n\nexport const setConfig = (config: any): SetConfigAction => ({\n type: SET_CONFIG,\n config,\n});\n\nexport const setValidationMode = (\n validationMode: ValidationMode\n): SetValidationModeAction => ({\n type: SET_VALIDATION_MODE,\n validationMode,\n});\n\nexport type UISchemaActions = AddUISchemaAction | RemoveUISchemaAction;\n\nexport interface AddUISchemaAction {\n type: 'jsonforms/ADD_UI_SCHEMA';\n tester: UISchemaTester;\n uischema: UISchemaElement;\n}\n\nexport const registerUISchema = (\n tester: UISchemaTester,\n uischema: UISchemaElement\n): AddUISchemaAction => {\n return {\n type: ADD_UI_SCHEMA,\n tester,\n uischema,\n };\n};\n\nexport interface RemoveUISchemaAction {\n type: 'jsonforms/REMOVE_UI_SCHEMA';\n tester: UISchemaTester;\n}\n\nexport const unregisterUISchema = (\n tester: UISchemaTester\n): RemoveUISchemaAction => {\n return {\n type: REMOVE_UI_SCHEMA,\n tester,\n };\n};\n\nexport type I18nActions =\n | SetLocaleAction\n | SetTranslatorAction\n | UpdateI18nAction;\n\nexport interface SetLocaleAction {\n type: 'jsonforms/SET_LOCALE';\n locale: string | undefined;\n}\n\nexport const setLocale = (locale: string | undefined): SetLocaleAction => ({\n type: SET_LOCALE,\n locale,\n});\n\nexport interface SetSchemaAction {\n type: 'jsonforms/SET_SCHEMA';\n schema: JsonSchema;\n}\n\nexport const setSchema = (schema: JsonSchema): SetSchemaAction => ({\n type: SET_SCHEMA,\n schema,\n});\n\nexport interface SetTranslatorAction {\n type: 'jsonforms/SET_TRANSLATOR';\n translator?: Translator;\n errorTranslator?: ErrorTranslator;\n}\n\nexport const setTranslator = (\n translator?: Translator,\n errorTranslator?: ErrorTranslator\n): SetTranslatorAction => ({\n type: SET_TRANSLATOR,\n translator,\n errorTranslator,\n});\n\nexport interface UpdateI18nAction {\n type: 'jsonforms/UPDATE_I18N';\n locale: string | undefined;\n translator: Translator | undefined;\n errorTranslator: ErrorTranslator | undefined;\n}\n\nexport const updateI18n = (\n locale: string | undefined,\n translator: Translator | undefined,\n errorTranslator: ErrorTranslator | undefined\n): UpdateI18nAction => ({\n type: UPDATE_I18N,\n locale,\n translator,\n errorTranslator,\n});\n\nexport interface SetUISchemaAction {\n type: 'jsonforms/SET_UISCHEMA';\n uischema: UISchemaElement;\n}\n\nexport const setUISchema = (uischema: UISchemaElement): SetUISchemaAction => ({\n type: SET_UISCHEMA,\n uischema,\n});\n","/*\n The MIT License\n \n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport { convertToValidClassName, createLabelDescriptionFrom } from './util';\nimport type { ControlElement, JsonSchema, LabelDescription } from './models';\n\nexport const Helpers: {\n createLabelDescriptionFrom(\n withLabel: ControlElement,\n schema: JsonSchema\n ): LabelDescription;\n convertToValidClassName(s: string): string;\n} = {\n createLabelDescriptionFrom,\n convertToValidClassName,\n};\n"],"names":["RuleEffect","merge","isFunction","isEqual","cloneDeep","get","setFp","unsetFp","filter","isObjectSchema","ArrayTranslationEnum","CombinatorTranslationEnum","isEmpty","endsWith","last","isArray","reduce","toPairs","includes","remove","maxBy","range","has","evaluateCondition","find","composePaths","startCase","all","any","Ajv","addFormats","keys"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,IAAM,qBAAqB,GAAG,sBAAsB,CAAC;AACrD,IAAM,mBAAmB,GAAG,UAAU,CAAC;AAIvC,IAAM,QAAQ,GAAG,UACf,UAAiB,EACjB,aAAoC,EAAA;IAEpC,IAAM,KAAK,GAAoC,EAAE,CAAC;AAElD,IAAA,OAAO,UAAU,CAAC,MAAM,CAAC,UAAC,IAAI,EAAA;AAC5B,QAAA,IAAM,kBAAkB,GAAG,aAAa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AAA;CAChB,EAAC,GAAC;IAOU,WAAW,GAAG,UAAC,QAAyB,EAAA,EAAwB,QAAC;AAC5E,IAAA,IAAI,EAAE,YAAY;AAClB,IAAA,QAAQ,EAAA,QAAA;CACT,EAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC3TW,IAAA,OAAO,GAMhB;AACF,IAAA,0BAA0B,EAAA,0BAAA;AAC1B,IAAA,uBAAuB,EAAA,uBAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"jsonforms-core.cjs.js","sources":["../src/generators/schema.ts","../src/models/draft4.ts","../src/models/uischema.ts","../src/util/array.ts","../src/reducers/cells.ts","../src/configDefault.ts","../src/reducers/config.ts","../src/reducers/core.ts","../src/reducers/default-data.ts","../src/i18n/i18nUtil.ts","../src/i18n/arrayTranslations.ts","../src/i18n/combinatorTranslations.ts","../src/reducers/i18n.ts","../src/reducers/renderers.ts","../src/testers/testers.ts","../src/reducers/uischemas.ts","../src/reducers/reducers.ts","../src/reducers/selectors.ts","../src/reducers/middleware.ts","../src/util/path.ts","../src/util/resolvers.ts","../src/util/runtime.ts","../src/util/util.ts","../src/util/label.ts","../src/util/renderer.ts","../src/util/cell.ts","../src/util/combinators.ts","../src/util/ids.ts","../src/util/schema.ts","../src/util/uischema.ts","../src/util/validator.ts","../src/util/defaultDateFormat.ts","../src/generators/uischema.ts","../src/generators/Generate.ts","../src/actions/actions.ts","../src/Helpers.ts"],"sourcesContent":["/*\n The MIT License\n \n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport type { JsonSchema4 } from '../models';\n\nconst ADDITIONAL_PROPERTIES = 'additionalProperties';\nconst REQUIRED_PROPERTIES = 'required';\n\ntype Properties = { [property: string]: JsonSchema4 };\n\nconst distinct = (\n properties: any[],\n discriminator: (item: any) => string\n): JsonSchema4[] => {\n const known: { [property: string]: boolean } = {};\n\n return properties.filter((item) => {\n const discriminatorValue = discriminator(item);\n if (Object.prototype.hasOwnProperty.call(known, discriminatorValue)) {\n return false;\n } else {\n known[discriminatorValue] = true;\n return true;\n }\n });\n};\n\nclass Gen {\n constructor(\n private findOption: (props: Properties) => (optionName: string) => any\n ) {}\n\n // TODO fix @typescript-eslint/ban-types\n // eslint-disable-next-line @typescript-eslint/ban-types\n schemaObject = (data: Object): JsonSchema4 => {\n const props: Properties = this.properties(data);\n const schema: JsonSchema4 = {\n type: 'object',\n properties: props,\n additionalProperties: this.findOption(props)(ADDITIONAL_PROPERTIES),\n };\n const required = this.findOption(props)(REQUIRED_PROPERTIES);\n if (required.length > 0) {\n schema.required = required;\n }\n\n return schema;\n };\n\n properties = (data: any): Properties => {\n const emptyProps: Properties = {};\n\n return Object.keys(data).reduce((acc: Properties, propName: string) => {\n acc[propName] = this.property(data[propName]);\n\n return acc;\n }, emptyProps);\n };\n\n property = (data: any): JsonSchema4 => {\n switch (typeof data) {\n case 'string':\n return { type: 'string' };\n case 'boolean':\n return { type: 'boolean' };\n case 'number':\n if (Number.isInteger(data)) {\n return { type: 'integer' };\n }\n\n return { type: 'number' };\n case 'object':\n if (data == null) {\n return { type: 'null' };\n }\n\n return this.schemaObjectOrArray(data);\n default:\n return {};\n }\n };\n\n schemaObjectOrArray = (data: any): JsonSchema4 => {\n if (data instanceof Array) {\n return this.schemaArray(data as any[]);\n } else {\n return this.schemaObject(data);\n }\n };\n\n schemaArray = (data: any[]): JsonSchema4 => {\n if (data.length > 0) {\n const allProperties: JsonSchema4[] = data.map(this.property);\n const uniqueProperties = distinct(allProperties, (prop) =>\n JSON.stringify(prop)\n );\n if (uniqueProperties.length === 1) {\n return {\n type: 'array',\n items: uniqueProperties[0],\n };\n } else {\n return {\n type: 'array',\n items: {\n oneOf: uniqueProperties,\n },\n };\n }\n } else {\n return {\n type: 'array',\n items: {},\n };\n }\n };\n}\n\n/**\n * Generate a JSON schema based on the given data and any additional options.\n * @param {Object} instance the data to create a JSON schema for\n * @param {any} options any additional options that may alter the generated JSON schema\n * @returns {JsonSchema} the generated schema\n */\nexport const generateJsonSchema = (\n // TODO fix @typescript-eslint/ban-types\n // eslint-disable-next-line @typescript-eslint/ban-types\n instance: Object,\n options: any = {}\n): JsonSchema4 => {\n const findOption =\n (props: Properties) =>\n (optionName: string): boolean | string[] => {\n switch (optionName) {\n case ADDITIONAL_PROPERTIES:\n if (\n Object.prototype.hasOwnProperty.call(options, ADDITIONAL_PROPERTIES)\n ) {\n return options[ADDITIONAL_PROPERTIES];\n }\n\n return true;\n case REQUIRED_PROPERTIES:\n if (\n Object.prototype.hasOwnProperty.call(options, REQUIRED_PROPERTIES)\n ) {\n return options[REQUIRED_PROPERTIES](props);\n }\n\n return Object.keys(props);\n default:\n return;\n }\n };\n\n const gen = new Gen(findOption);\n\n return gen.schemaObject(instance);\n};\n","/*\n The MIT License\n \n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nexport const Draft4 = {\n id: 'http://json-schema.org/draft-04/schema#',\n $schema: 'http://json-schema.org/draft-04/schema#',\n description: 'Core schema meta-schema',\n definitions: {\n schemaArray: {\n type: 'array',\n minItems: 1,\n items: { $ref: '#' },\n },\n positiveInteger: {\n type: 'integer',\n minimum: 0,\n },\n positiveIntegerDefault0: {\n allOf: [{ $ref: '#/definitions/positiveInteger' }, { default: 0 }],\n },\n simpleTypes: {\n enum: [\n 'array',\n 'boolean',\n 'integer',\n 'null',\n 'number',\n 'object',\n 'string',\n ],\n },\n stringArray: {\n type: 'array',\n items: { type: 'string' },\n minItems: 1,\n uniqueItems: true,\n },\n },\n type: 'object',\n properties: {\n id: {\n type: 'string',\n format: 'uri',\n },\n $schema: {\n type: 'string',\n format: 'uri',\n },\n title: {\n type: 'string',\n },\n description: {\n type: 'string',\n },\n default: {},\n multipleOf: {\n type: 'number',\n minimum: 0,\n exclusiveMinimum: true,\n },\n maximum: {\n type: 'number',\n },\n exclusiveMaximum: {\n type: 'boolean',\n default: false,\n },\n minimum: {\n type: 'number',\n },\n exclusiveMinimum: {\n type: 'boolean',\n default: false,\n },\n maxLength: { $ref: '#/definitions/positiveInteger' },\n minLength: { $ref: '#/definitions/positiveIntegerDefault0' },\n pattern: {\n type: 'string',\n format: 'regex',\n },\n additionalItems: {\n anyOf: [{ type: 'boolean' }, { $ref: '#' }],\n default: {},\n },\n items: {\n anyOf: [{ $ref: '#' }, { $ref: '#/definitions/schemaArray' }],\n default: {},\n },\n maxItems: { $ref: '#/definitions/positiveInteger' },\n minItems: { $ref: '#/definitions/positiveIntegerDefault0' },\n uniqueItems: {\n type: 'boolean',\n default: false,\n },\n maxProperties: { $ref: '#/definitions/positiveInteger' },\n minProperties: { $ref: '#/definitions/positiveIntegerDefault0' },\n required: { $ref: '#/definitions/stringArray' },\n additionalProperties: {\n anyOf: [{ type: 'boolean' }, { $ref: '#' }],\n default: {},\n },\n definitions: {\n type: 'object',\n additionalProperties: { $ref: '#' },\n default: {},\n },\n properties: {\n type: 'object',\n additionalProperties: { $ref: '#' },\n default: {},\n },\n patternProperties: {\n type: 'object',\n additionalProperties: { $ref: '#' },\n default: {},\n },\n dependencies: {\n type: 'object',\n additionalProperties: {\n anyOf: [{ $ref: '#' }, { $ref: '#/definitions/stringArray' }],\n },\n },\n enum: {\n type: 'array',\n minItems: 1,\n uniqueItems: true,\n },\n type: {\n anyOf: [\n { $ref: '#/definitions/simpleTypes' },\n {\n type: 'array',\n items: { $ref: '#/definitions/simpleTypes' },\n minItems: 1,\n uniqueItems: true,\n },\n ],\n },\n allOf: { $ref: '#/definitions/schemaArray' },\n anyOf: { $ref: '#/definitions/schemaArray' },\n oneOf: { $ref: '#/definitions/schemaArray' },\n not: { $ref: '#' },\n },\n dependencies: {\n exclusiveMaximum: ['maximum'],\n exclusiveMinimum: ['minimum'],\n },\n default: {},\n};\n","/*\n The MIT License\n \n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport type { JsonSchema } from './jsonSchema';\n\n/**\n * Interface for describing an UI schema element that is referencing\n * a subschema. The value of the scope may be a JSON Pointer.\n */\nexport interface Scopable {\n /**\n * The scope that determines to which part this element should be bound to.\n */\n scope?: string;\n}\n\n/**\n * Interface for describing an UI schema element that is referencing\n * a subschema. The value of the scope must be a JSON Pointer.\n */\nexport interface Scoped extends Scopable {\n /**\n * The scope that determines to which part this element should be bound to.\n */\n scope: string;\n}\n\n/**\n * Interface for describing an UI schema element that may be labeled.\n */\nexport interface Labelable {\n /**\n * Label for UI schema element.\n */\n label?: string | T;\n}\n\n/**\n * Interface for describing an UI schema element that is labeled.\n */\nexport interface Labeled extends Labelable {\n label: string | T;\n}\n\n/*\n * Interface for describing an UI schema element that can provide an internationalization base key.\n * If defined, this key is suffixed to derive applicable message keys for the UI schema element.\n * For example, such suffixes are `.label` or `.description` to derive the corresponding message keys for a control element.\n */\nexport interface Internationalizable {\n i18n?: string;\n}\n\n/**\n * A rule that may be attached to any UI schema element.\n */\nexport interface Rule {\n /**\n * The effect of the rule\n */\n effect: RuleEffect;\n\n /**\n * The condition of the rule that must evaluate to true in order\n * to trigger the effect.\n */\n condition: Condition;\n}\n\n/**\n * The different rule effects.\n */\nexport enum RuleEffect {\n /**\n * Effect that hides the associated element.\n */\n HIDE = 'HIDE',\n /**\n * Effect that shows the associated element.\n */\n SHOW = 'SHOW',\n /**\n * Effect that enables the associated element.\n */\n ENABLE = 'ENABLE',\n /**\n * Effect that disables the associated element.\n */\n DISABLE = 'DISABLE',\n}\n\n/**\n * Represents a condition to be evaluated.\n */\nexport interface Condition {\n /**\n * The type of condition.\n */\n readonly type?: string;\n}\n\n/**\n * A leaf condition.\n */\nexport interface LeafCondition extends Condition, Scoped {\n type: 'LEAF';\n\n /**\n * The expected value when evaluating the condition\n */\n expectedValue: any;\n}\n\nexport interface SchemaBasedCondition extends Condition, Scoped {\n schema: JsonSchema;\n\n /**\n * When the scope resolves to undefined and `failWhenUndefined` is set to `true`, the condition\n * will fail. Therefore the reverse effect will be applied.\n *\n * Background:\n * Most JSON Schemas will successfully validate against `undefined` data. Specifying that a\n * condition shall fail when data is `undefined` requires to lift the scope to being able to use\n * JSON Schema's `required`.\n *\n * Using `failWhenUndefined` allows to more conveniently express this condition.\n */\n failWhenUndefined?: boolean;\n}\n\n/**\n * A composable condition.\n */\nexport interface ComposableCondition extends Condition {\n conditions: Condition[];\n}\n\n/**\n * An or condition.\n */\nexport interface OrCondition extends ComposableCondition {\n type: 'OR';\n}\n\n/**\n * An and condition.\n */\nexport interface AndCondition extends ComposableCondition {\n type: 'AND';\n}\n\n/**\n * Common base interface for any UI schema element.\n */\nexport interface UISchemaElement {\n /**\n * The type of this UI schema element.\n */\n type: string;\n\n /**\n * An optional rule.\n */\n rule?: Rule;\n\n /**\n * Any additional options.\n */\n options?: { [key: string]: any };\n}\n\n/**\n * Represents a layout element which can order its children\n * in a specific way.\n */\nexport interface Layout extends UISchemaElement {\n /**\n * The child elements of this layout.\n */\n elements: UISchemaElement[];\n}\n\n/**\n * A layout which orders its child elements vertically (i.e. from top to bottom).\n */\nexport interface VerticalLayout extends Layout {\n type: 'VerticalLayout';\n}\n\n/**\n * A layout which orders its children horizontally (i.e. from left to right).\n */\nexport interface HorizontalLayout extends Layout {\n type: 'HorizontalLayout';\n}\n\n/**\n * A group resembles a vertical layout, but additionally might have a label.\n * This layout is useful when grouping different elements by a certain criteria.\n */\nexport interface GroupLayout extends Layout, Labelable, Internationalizable {\n type: 'Group';\n}\n\n/**\n * Represents an object that can be used to configure a label.\n */\nexport interface LabelDescription {\n /**\n * An optional text to be displayed.\n */\n text?: string;\n /**\n * Optional property that determines whether to show this label.\n */\n show?: boolean;\n}\n\n/**\n * A label element.\n */\nexport interface LabelElement extends UISchemaElement, Internationalizable {\n type: 'Label';\n /**\n * The text of label.\n */\n text: string;\n}\n\n/**\n * A control element. The scope property of the control determines\n * to which part of the schema the control should be bound.\n */\nexport interface ControlElement\n extends UISchemaElement,\n Scoped,\n Labelable,\n Internationalizable {\n type: 'Control';\n}\n\n/**\n * The category layout.\n */\nexport interface Category extends Layout, Labeled, Internationalizable {\n type: 'Category';\n}\n\n/**\n * The categorization element, which may have children elements.\n * A child element may either be itself a Categorization or a Category, hence\n * the categorization element can be used to represent recursive structures like trees.\n */\nexport interface Categorization\n extends UISchemaElement,\n Labeled,\n Internationalizable {\n type: 'Categorization';\n /**\n * The child elements of this categorization which are either of type\n * {@link Category} or {@link Categorization}.\n */\n elements: (Category | Categorization)[];\n}\n\nexport const isInternationalized = (\n element: unknown\n): element is Required =>\n typeof element === 'object' &&\n element !== null &&\n typeof (element as Internationalizable).i18n === 'string';\n\nexport const isGroup = (layout: Layout): layout is GroupLayout =>\n layout.type === 'Group';\n\nexport const isLayout = (uischema: UISchemaElement): uischema is Layout =>\n (uischema as Layout).elements !== undefined;\n\nexport const isScopable = (obj: unknown): obj is Scopable =>\n !!obj && typeof obj === 'object';\n\nexport const isScoped = (obj: unknown): obj is Scoped =>\n isScopable(obj) && typeof obj.scope === 'string';\n\nexport const isLabelable = (obj: unknown): obj is Labelable =>\n !!obj && typeof obj === 'object';\n\nexport const isLabeled = (obj: unknown): obj is Labeled =>\n isLabelable(obj) && ['string', 'boolean'].includes(typeof obj.label);\n","/*\n The MIT License\n\n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nconst move = (array: any[], index: number, delta: number) => {\n const newIndex: number = index + delta;\n if (newIndex < 0 || newIndex >= array.length) {\n return;\n } // Already at the top or bottom.\n const indexes: number[] = [index, newIndex].sort((a, b) => a - b); // Sort the indixes\n array.splice(indexes[0], 2, array[indexes[1]], array[indexes[0]]);\n};\n\nconst moveUp = (array: any[], toMove: number) => {\n move(array, toMove, -1);\n};\n\nconst moveDown = (array: any[], toMove: number) => {\n move(array, toMove, 1);\n};\n\nexport { moveUp, moveDown };\n","/*\n The MIT License\n \n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport type { RankedTester } from '../testers';\nimport {\n ADD_CELL,\n AddCellRendererAction,\n REMOVE_CELL,\n RemoveCellRendererAction,\n} from '../actions';\nimport type { Reducer } from '../util';\n\ntype ValidCellReducerActions = AddCellRendererAction | RemoveCellRendererAction;\n\nexport type JsonFormsCellRendererRegistryState =\n JsonFormsCellRendererRegistryEntry[];\n\nexport interface JsonFormsCellRendererRegistryEntry {\n tester: RankedTester;\n cell: any;\n}\n\nexport const cellReducer: Reducer<\n JsonFormsCellRendererRegistryState,\n ValidCellReducerActions\n> = (state = [], { type, tester, cell }) => {\n switch (type) {\n case ADD_CELL:\n return state.concat([{ tester, cell }]);\n case REMOVE_CELL:\n return state.filter((t) => t.tester !== tester);\n default:\n return state;\n }\n};\n","/*\n The MIT License\n\n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nexport const configDefault = {\n /*\n * [text] whether to restrict the number of characters to maxLength,\n * if specified in the JSON schema\n */\n restrict: false,\n\n /*\n * [text] whether to resize the input's width to maxLength,\n * if specified in the JSON schema\n */\n trim: false,\n\n /*\n * [text] if input descriptions should hide when not focused\n */\n showUnfocusedDescription: false,\n\n /*\n * [text] if asterisks in labels for required fields should be hidden\n */\n hideRequiredAsterisk: false,\n\n /**\n * [text] if dynamic checks for conditional application of properties\n * should be performed (e.g. check for conditional required)\n */\n allowDynamicCheck: false,\n};\n","/*\n The MIT License\n \n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport merge from 'lodash/merge';\nimport { SET_CONFIG, SetConfigAction } from '../actions';\nimport { configDefault } from '../configDefault';\nimport type { Reducer } from '../util';\n\nconst applyDefaultConfiguration = (config: any = {}) =>\n merge({}, configDefault, config);\n\nexport const configReducer: Reducer = (\n state = applyDefaultConfiguration(),\n action\n) => {\n switch (action.type) {\n case SET_CONFIG:\n return applyDefaultConfiguration(action.config);\n default:\n return state;\n }\n};\n","/*\n The MIT License\n\n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport cloneDeep from 'lodash/cloneDeep';\nimport setFp from 'lodash/fp/set';\nimport unsetFp from 'lodash/fp/unset';\nimport get from 'lodash/get';\nimport filter from 'lodash/filter';\nimport isEqual from 'lodash/isEqual';\nimport isFunction from 'lodash/isFunction';\nimport type Ajv from 'ajv';\nimport type { ErrorObject, ValidateFunction } from 'ajv';\nimport {\n CoreActions,\n INIT,\n InitAction,\n InitActionOptions,\n SET_AJV,\n SET_SCHEMA,\n SET_UISCHEMA,\n SET_VALIDATION_MODE,\n UPDATE_DATA,\n UPDATE_ERRORS,\n UPDATE_CORE,\n UpdateCoreAction,\n} from '../actions';\nimport { createAjv, decode, isOneOfEnumSchema, Reducer } from '../util';\nimport type { JsonSchema, UISchemaElement } from '../models';\n\nexport const validate = (\n validator: ValidateFunction | undefined,\n data: any\n): ErrorObject[] => {\n if (validator === undefined) {\n return [];\n }\n const valid = validator(data);\n if (valid) {\n return [];\n }\n return validator.errors;\n};\n\nexport type ValidationMode =\n | 'ValidateAndShow'\n | 'ValidateAndHide'\n | 'NoValidation';\n\nexport interface JsonFormsCore {\n data: any;\n schema: JsonSchema;\n uischema: UISchemaElement;\n errors?: ErrorObject[];\n additionalErrors?: ErrorObject[];\n validator?: ValidateFunction;\n ajv?: Ajv;\n validationMode?: ValidationMode;\n}\n\nconst initState: JsonFormsCore = {\n data: {},\n schema: {},\n uischema: undefined,\n errors: [],\n validator: undefined,\n ajv: undefined,\n validationMode: 'ValidateAndShow',\n additionalErrors: [],\n};\n\nconst getOrCreateAjv = (\n state: JsonFormsCore,\n action?: InitAction | UpdateCoreAction\n): Ajv => {\n if (action) {\n if (hasAjvOption(action.options)) {\n // options object with ajv\n return action.options.ajv;\n } else if (action.options !== undefined) {\n // it is not an option object => should be ajv itself => check for compile function\n if (isFunction(action.options.compile)) {\n return action.options;\n }\n }\n }\n return state.ajv ? state.ajv : createAjv();\n};\n\nconst hasAjvOption = (option: any): option is InitActionOptions => {\n if (option) {\n return option.ajv !== undefined;\n }\n return false;\n};\n\nconst getValidationMode = (\n state: JsonFormsCore,\n action?: InitAction | UpdateCoreAction\n): ValidationMode => {\n if (action && hasValidationModeOption(action.options)) {\n return action.options.validationMode;\n }\n return state.validationMode;\n};\n\nconst hasValidationModeOption = (option: any): option is InitActionOptions => {\n if (option) {\n return option.validationMode !== undefined;\n }\n return false;\n};\n\nconst hasAdditionalErrorsOption = (\n option: any\n): option is InitActionOptions => {\n if (option) {\n return option.additionalErrors !== undefined;\n }\n return false;\n};\n\nconst getAdditionalErrors = (\n state: JsonFormsCore,\n action?: InitAction | UpdateCoreAction\n): ErrorObject[] => {\n if (action && hasAdditionalErrorsOption(action.options)) {\n return action.options.additionalErrors;\n }\n return state.additionalErrors;\n};\n\nexport const coreReducer: Reducer = (\n state = initState,\n action\n) => {\n switch (action.type) {\n case INIT: {\n const thisAjv = getOrCreateAjv(state, action);\n\n const validationMode = getValidationMode(state, action);\n const v =\n validationMode === 'NoValidation'\n ? undefined\n : thisAjv.compile(action.schema);\n const e = validate(v, action.data);\n const additionalErrors = getAdditionalErrors(state, action);\n\n return {\n ...state,\n data: action.data,\n schema: action.schema,\n uischema: action.uischema,\n additionalErrors,\n errors: e,\n validator: v,\n ajv: thisAjv,\n validationMode,\n };\n }\n case UPDATE_CORE: {\n const thisAjv = getOrCreateAjv(state, action);\n const validationMode = getValidationMode(state, action);\n let validator = state.validator;\n let errors = state.errors;\n if (\n state.schema !== action.schema ||\n state.validationMode !== validationMode ||\n state.ajv !== thisAjv\n ) {\n // revalidate only if necessary\n validator =\n validationMode === 'NoValidation'\n ? undefined\n : thisAjv.compile(action.schema);\n errors = validate(validator, action.data);\n } else if (state.data !== action.data) {\n errors = validate(validator, action.data);\n }\n const additionalErrors = getAdditionalErrors(state, action);\n\n const stateChanged =\n state.data !== action.data ||\n state.schema !== action.schema ||\n state.uischema !== action.uischema ||\n state.ajv !== thisAjv ||\n state.errors !== errors ||\n state.validator !== validator ||\n state.validationMode !== validationMode ||\n state.additionalErrors !== additionalErrors;\n return stateChanged\n ? {\n ...state,\n data: action.data,\n schema: action.schema,\n uischema: action.uischema,\n ajv: thisAjv,\n errors: isEqual(errors, state.errors) ? state.errors : errors,\n validator: validator,\n validationMode: validationMode,\n additionalErrors,\n }\n : state;\n }\n case SET_AJV: {\n const currentAjv = action.ajv;\n const validator =\n state.validationMode === 'NoValidation'\n ? undefined\n : currentAjv.compile(state.schema);\n const errors = validate(validator, state.data);\n return {\n ...state,\n validator,\n errors,\n };\n }\n case SET_SCHEMA: {\n const needsNewValidator =\n action.schema && state.ajv && state.validationMode !== 'NoValidation';\n const v = needsNewValidator\n ? state.ajv.compile(action.schema)\n : state.validator;\n const errors = validate(v, state.data);\n return {\n ...state,\n validator: v,\n schema: action.schema,\n errors,\n };\n }\n case SET_UISCHEMA: {\n return {\n ...state,\n uischema: action.uischema,\n };\n }\n case UPDATE_DATA: {\n if (action.path === undefined || action.path === null) {\n return state;\n } else if (action.path === '') {\n // empty path is ok\n const result = action.updater(cloneDeep(state.data));\n const errors = validate(state.validator, result);\n return {\n ...state,\n data: result,\n errors,\n };\n } else {\n const oldData: any = get(state.data, action.path);\n const newData = action.updater(cloneDeep(oldData));\n let newState: any;\n if (newData !== undefined) {\n newState = setFp(\n action.path,\n newData,\n state.data === undefined ? {} : state.data\n );\n } else {\n newState = unsetFp(\n action.path,\n state.data === undefined ? {} : state.data\n );\n }\n const errors = validate(state.validator, newState);\n return {\n ...state,\n data: newState,\n errors,\n };\n }\n }\n case UPDATE_ERRORS: {\n return {\n ...state,\n errors: action.errors,\n };\n }\n case SET_VALIDATION_MODE: {\n if (state.validationMode === action.validationMode) {\n return state;\n }\n if (action.validationMode === 'NoValidation') {\n const errors = validate(undefined, state.data);\n return {\n ...state,\n errors,\n validationMode: action.validationMode,\n };\n }\n if (state.validationMode === 'NoValidation') {\n const validator = state.ajv.compile(state.schema);\n const errors = validate(validator, state.data);\n return {\n ...state,\n validator,\n errors,\n validationMode: action.validationMode,\n };\n }\n return {\n ...state,\n validationMode: action.validationMode,\n };\n }\n default:\n return state;\n }\n};\n\nexport const extractData = (state: JsonFormsCore) => get(state, 'data');\nexport const extractSchema = (state: JsonFormsCore) => get(state, 'schema');\nexport const extractUiSchema = (state: JsonFormsCore) => get(state, 'uischema');\nexport const extractAjv = (state: JsonFormsCore) => get(state, 'ajv');\n\nconst getInvalidProperty = (error: ErrorObject): string | undefined => {\n switch (error.keyword) {\n case 'required':\n case 'dependencies':\n return error.params.missingProperty;\n case 'additionalProperties':\n return error.params.additionalProperty;\n default:\n return undefined;\n }\n};\n\nexport const getControlPath = (error: ErrorObject) => {\n // Up until AJV v7 the path property was called 'dataPath'\n // With AJV v8 the property was renamed to 'instancePath'\n let controlPath = (error as any).dataPath || error.instancePath || '';\n\n // change '/' chars to '.'\n controlPath = controlPath.replace(/\\//g, '.');\n\n const invalidProperty = getInvalidProperty(error);\n if (invalidProperty !== undefined && !controlPath.endsWith(invalidProperty)) {\n controlPath = `${controlPath}.${invalidProperty}`;\n }\n\n // remove '.' chars at the beginning of paths\n controlPath = controlPath.replace(/^./, '');\n\n // decode JSON Pointer escape sequences\n controlPath = decode(controlPath);\n return controlPath;\n};\n\nexport const errorsAt =\n (\n instancePath: string,\n schema: JsonSchema,\n matchPath: (path: string) => boolean\n ) =>\n (errors: ErrorObject[]): ErrorObject[] => {\n // Get data paths of oneOf and anyOf errors to later determine whether an error occurred inside a subschema of oneOf or anyOf.\n const combinatorPaths = filter(\n errors,\n (error) => error.keyword === 'oneOf' || error.keyword === 'anyOf'\n ).map((error) => getControlPath(error));\n\n return filter(errors, (error) => {\n // Filter errors that match any keyword that we don't want to show in the UI\n // but keep the errors for oneOf enums\n if (\n filteredErrorKeywords.indexOf(error.keyword) !== -1 &&\n !isOneOfEnumSchema(error.parentSchema)\n ) {\n return false;\n }\n const controlPath = getControlPath(error);\n let result = matchPath(controlPath);\n // In anyOf and oneOf blocks with \"primitive\" (i.e. string, number etc.) or array subschemas,\n // we want to make sure that errors are only shown for the correct subschema.\n // Therefore, we compare the error's parent schema with the property's schema.\n // In the primitive case the error's data path is the same for all subschemas:\n // It directly points to the property defining the anyOf/oneOf.\n // The same holds true for errors on the array level (e.g. min item amount).\n // In contrast, this comparison must not be done for errors whose parent schema defines an object or a oneOf enum,\n // because the parent schema can never match the property schema (e.g. for 'required' checks).\n const parentSchema: JsonSchema | undefined = error.parentSchema;\n if (\n result &&\n !isObjectSchema(parentSchema) &&\n !isOneOfEnumSchema(parentSchema) &&\n combinatorPaths.findIndex((p) => instancePath.startsWith(p)) !== -1\n ) {\n result = result && isEqual(parentSchema, schema);\n }\n return result;\n });\n };\n\n/**\n * @returns true if the schema describes an object.\n */\nconst isObjectSchema = (schema?: JsonSchema): boolean => {\n return schema?.type === 'object' || !!schema?.properties;\n};\n\n/**\n * The error-type of an AJV error is defined by its `keyword` property.\n * Certain errors are filtered because they don't fit to any rendered control.\n * All of them have in common that we don't want to show them in the UI\n * because controls will show the actual reason why they don't match their correponding sub schema.\n * - additionalProperties: Indicates that a property is present that is not defined in the schema.\n * Jsonforms only allows to edit defined properties. These errors occur if an oneOf doesn't match.\n * - allOf: Indicates that not all of the allOf definitions match as a whole.\n * - anyOf: Indicates that an anyOf definition itself is not valid because none of its subschemas matches.\n * - oneOf: Indicates that an oneOf definition itself is not valid because not exactly one of its subschemas matches.\n */\nconst filteredErrorKeywords = [\n 'additionalProperties',\n 'allOf',\n 'anyOf',\n 'oneOf',\n];\n\nconst getErrorsAt =\n (\n instancePath: string,\n schema: JsonSchema,\n matchPath: (path: string) => boolean\n ) =>\n (state: JsonFormsCore): ErrorObject[] => {\n const errors = state.errors ?? [];\n const additionalErrors = state.additionalErrors ?? [];\n return errorsAt(\n instancePath,\n schema,\n matchPath\n )(\n state.validationMode === 'ValidateAndHide'\n ? additionalErrors\n : [...errors, ...additionalErrors]\n );\n };\n\nexport const errorAt = (instancePath: string, schema: JsonSchema) =>\n getErrorsAt(instancePath, schema, (path) => path === instancePath);\nexport const subErrorsAt = (instancePath: string, schema: JsonSchema) =>\n getErrorsAt(instancePath, schema, (path) =>\n path.startsWith(instancePath + '.')\n );\n","/*\n The MIT License\n\n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport {\n ADD_DEFAULT_DATA,\n RegisterDefaultDataAction,\n REMOVE_DEFAULT_DATA,\n UnregisterDefaultDataAction,\n} from '../actions';\nimport type { Reducer } from '../util';\n\nexport interface JsonFormsDefaultDataRegistryEntry {\n schemaPath: string;\n data: any;\n}\n\ntype ValidDefaultDataActions =\n | RegisterDefaultDataAction\n | UnregisterDefaultDataAction;\n\nexport const defaultDataReducer: Reducer<\n JsonFormsDefaultDataRegistryEntry[],\n ValidDefaultDataActions\n> = (state = [], action) => {\n switch (action.type) {\n case ADD_DEFAULT_DATA:\n return state.concat([\n { schemaPath: action.schemaPath, data: action.data },\n ]);\n case REMOVE_DEFAULT_DATA:\n return state.filter((t) => t.schemaPath !== action.schemaPath);\n default:\n return state;\n }\n};\n\nexport const extractDefaultData = (\n state: JsonFormsDefaultDataRegistryEntry[]\n): JsonFormsDefaultDataRegistryEntry[] => state;\n","import type { ErrorObject } from 'ajv';\nimport { isInternationalized, Labelable, UISchemaElement } from '../models';\nimport { getControlPath } from '../reducers';\nimport { formatErrorMessage } from '../util';\nimport type { i18nJsonSchema, ErrorTranslator, Translator } from './i18nTypes';\nimport {\n ArrayDefaultTranslation,\n ArrayTranslations,\n} from './arrayTranslations';\nimport {\n CombinatorDefaultTranslation,\n CombinatorTranslations,\n} from './combinatorTranslations';\n\nexport const getI18nKeyPrefixBySchema = (\n schema: i18nJsonSchema | undefined,\n uischema: unknown | undefined\n): string | undefined => {\n if (isInternationalized(uischema)) {\n return uischema.i18n;\n }\n return schema?.i18n ?? undefined;\n};\n\n/**\n * Transforms a given path to a prefix which can be used for i18n keys.\n * Returns 'root' for empty paths and removes array indices\n */\nexport const transformPathToI18nPrefix = (path: string): string => {\n return (\n path\n ?.split('.')\n .filter((segment) => !/^\\d+$/.test(segment))\n .join('.') || 'root'\n );\n};\n\nexport const getI18nKeyPrefix = (\n schema: i18nJsonSchema | undefined,\n uischema: unknown | undefined,\n path: string | undefined\n): string => {\n return (\n getI18nKeyPrefixBySchema(schema, uischema) ??\n transformPathToI18nPrefix(path)\n );\n};\n\nexport const getI18nKey = (\n schema: i18nJsonSchema | undefined,\n uischema: unknown | undefined,\n path: string | undefined,\n key: string\n): string => {\n return `${getI18nKeyPrefix(schema, uischema, path)}.${key}`;\n};\n\nexport const addI18nKeyToPrefix = (\n i18nKeyPrefix: string,\n key: string\n): string => {\n return `${i18nKeyPrefix}.${key}`;\n};\n\nexport const defaultTranslator: Translator = (\n _id: string,\n defaultMessage: string | undefined\n) => defaultMessage;\n\nexport const defaultErrorTranslator: ErrorTranslator = (error, t, uischema) => {\n // check whether there is a special keyword message\n const i18nKey = getI18nKey(\n error.parentSchema,\n uischema,\n getControlPath(error),\n `error.${error.keyword}`\n );\n const specializedKeywordMessage = t(i18nKey, undefined, { error });\n if (specializedKeywordMessage !== undefined) {\n return specializedKeywordMessage;\n }\n\n // check whether there is a generic keyword message\n const genericKeywordMessage = t(`error.${error.keyword}`, undefined, {\n error,\n });\n if (genericKeywordMessage !== undefined) {\n return genericKeywordMessage;\n }\n\n // check whether there is a customization for the default message\n const messageCustomization = t(error.message, undefined, { error });\n if (messageCustomization !== undefined) {\n return messageCustomization;\n }\n\n // rewrite required property messages (if they were not customized) as we place them next to the respective input\n if (\n error.keyword === 'required' &&\n error.message?.startsWith('must have required property')\n ) {\n return t('is a required property', 'is a required property', { error });\n }\n\n return error.message;\n};\n\n/**\n * Returns the determined error message for the given errors.\n * All errors must correspond to the given schema, uischema or path.\n */\nexport const getCombinedErrorMessage = (\n errors: ErrorObject[],\n et: ErrorTranslator,\n t: Translator,\n schema?: i18nJsonSchema,\n uischema?: UISchemaElement,\n path?: string\n) => {\n if (errors.length > 0 && t) {\n // check whether there is a special message which overwrites all others\n const customErrorKey = getI18nKey(schema, uischema, path, 'error.custom');\n const specializedErrorMessage = t(customErrorKey, undefined, {\n schema,\n uischema,\n path,\n errors,\n });\n if (specializedErrorMessage !== undefined) {\n return specializedErrorMessage;\n }\n }\n return formatErrorMessage(errors.map((error) => et(error, t, uischema)));\n};\n\n/**\n * This can be used to internationalize the label of the given Labelable (e.g. UI Schema elements).\n * This should not be used for controls as there we have additional context in the form of the JSON Schema available.\n */\nexport const deriveLabelForUISchemaElement = (\n uischema: Labelable,\n t: Translator\n): string | undefined => {\n if (uischema.label === false) {\n return undefined;\n }\n if (\n (uischema.label === undefined ||\n uischema.label === null ||\n uischema.label === true) &&\n !isInternationalized(uischema)\n ) {\n return undefined;\n }\n const stringifiedLabel =\n typeof uischema.label === 'string'\n ? uischema.label\n : JSON.stringify(uischema.label);\n const i18nKeyPrefix = getI18nKeyPrefixBySchema(undefined, uischema);\n const i18nKey =\n typeof i18nKeyPrefix === 'string'\n ? `${i18nKeyPrefix}.label`\n : stringifiedLabel;\n return t(i18nKey, stringifiedLabel, { uischema: uischema });\n};\n\nexport const getArrayTranslations = (\n t: Translator,\n defaultTranslations: ArrayDefaultTranslation[],\n i18nKeyPrefix: string,\n label: string\n): ArrayTranslations => {\n const translations: ArrayTranslations = {};\n defaultTranslations.forEach((controlElement) => {\n const key = addI18nKeyToPrefix(i18nKeyPrefix, controlElement.key);\n translations[controlElement.key] = t(key, controlElement.default(label));\n });\n return translations;\n};\n\nexport const getCombinatorTranslations = (\n t: Translator,\n defaultTranslations: CombinatorDefaultTranslation[],\n i18nKeyPrefix: string,\n label: string\n): CombinatorTranslations => {\n const translations: CombinatorTranslations = {};\n defaultTranslations.forEach((controlElement) => {\n const key = addI18nKeyToPrefix(i18nKeyPrefix, controlElement.key);\n translations[controlElement.key] = t(key, controlElement.default(label));\n });\n return translations;\n};\n","export interface ArrayDefaultTranslation {\n key: ArrayTranslationEnum;\n default: (variable?: string) => string;\n}\n\nexport enum ArrayTranslationEnum {\n addTooltip = 'addTooltip',\n addAriaLabel = 'addAriaLabel',\n removeTooltip = 'removeTooltip',\n upAriaLabel = 'upAriaLabel',\n downAriaLabel = 'downAriaLabel',\n noSelection = 'noSelection',\n removeAriaLabel = 'removeAriaLabel',\n noDataMessage = 'noDataMessage',\n deleteDialogTitle = 'deleteDialogTitle',\n deleteDialogMessage = 'deleteDialogMessage',\n deleteDialogAccept = 'deleteDialogAccept',\n deleteDialogDecline = 'deleteDialogDecline',\n up = 'up',\n down = 'down',\n}\n\nexport type ArrayTranslations = {\n [key in ArrayTranslationEnum]?: string;\n};\n\nexport const arrayDefaultTranslations: ArrayDefaultTranslation[] = [\n {\n key: ArrayTranslationEnum.addTooltip,\n default: (input) => (input ? `Add to ${input}` : 'Add'),\n },\n {\n key: ArrayTranslationEnum.addAriaLabel,\n default: (input) => (input ? `Add to ${input} button` : 'Add button'),\n },\n { key: ArrayTranslationEnum.removeTooltip, default: () => 'Delete' },\n { key: ArrayTranslationEnum.removeAriaLabel, default: () => 'Delete button' },\n { key: ArrayTranslationEnum.upAriaLabel, default: () => `Move item up` },\n { key: ArrayTranslationEnum.up, default: () => 'Up' },\n { key: ArrayTranslationEnum.down, default: () => 'Down' },\n { key: ArrayTranslationEnum.downAriaLabel, default: () => `Move item down` },\n { key: ArrayTranslationEnum.noDataMessage, default: () => 'No data' },\n { key: ArrayTranslationEnum.noSelection, default: () => 'No selection' },\n {\n key: ArrayTranslationEnum.deleteDialogTitle,\n default: () => 'Confirm Deletion',\n },\n {\n key: ArrayTranslationEnum.deleteDialogMessage,\n default: () => 'Are you sure you want to delete the selected entry?',\n },\n { key: ArrayTranslationEnum.deleteDialogAccept, default: () => 'Yes' },\n { key: ArrayTranslationEnum.deleteDialogDecline, default: () => 'No' },\n];\n","export interface CombinatorDefaultTranslation {\n key: CombinatorTranslationEnum;\n default: (variable?: string) => string;\n}\n\nexport enum CombinatorTranslationEnum {\n clearDialogTitle = 'clearDialogTitle',\n clearDialogMessage = 'clearDialogMessage',\n clearDialogAccept = 'clearDialogAccept',\n clearDialogDecline = 'clearDialogDecline',\n}\n\nexport type CombinatorTranslations = {\n [key in CombinatorTranslationEnum]?: string;\n};\n\nexport const combinatorDefaultTranslations: CombinatorDefaultTranslation[] = [\n {\n key: CombinatorTranslationEnum.clearDialogTitle,\n default: () => 'Clear form?',\n },\n {\n key: CombinatorTranslationEnum.clearDialogMessage,\n default: () => 'Your data will be cleared. Do you want to proceed?',\n },\n { key: CombinatorTranslationEnum.clearDialogAccept, default: () => 'Yes' },\n { key: CombinatorTranslationEnum.clearDialogDecline, default: () => 'No' },\n];\n","/*\n The MIT License\n\n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport {\n defaultErrorTranslator,\n defaultTranslator,\n JsonFormsI18nState,\n} from '../i18n';\nimport {\n I18nActions,\n SET_LOCALE,\n SET_TRANSLATOR,\n UPDATE_I18N,\n} from '../actions';\nimport type { Reducer } from '../util';\n\nexport const defaultJsonFormsI18nState: Required = {\n locale: 'en',\n translate: defaultTranslator,\n translateError: defaultErrorTranslator,\n};\n\nexport const i18nReducer: Reducer = (\n state = defaultJsonFormsI18nState,\n action\n) => {\n switch (action.type) {\n case UPDATE_I18N: {\n const locale = action.locale ?? defaultJsonFormsI18nState.locale;\n const translate =\n action.translator ?? defaultJsonFormsI18nState.translate;\n const translateError =\n action.errorTranslator ?? defaultJsonFormsI18nState.translateError;\n\n if (\n locale !== state.locale ||\n translate !== state.translate ||\n translateError !== state.translateError\n ) {\n return {\n ...state,\n locale,\n translate,\n translateError,\n };\n }\n return state;\n }\n case SET_TRANSLATOR:\n return {\n ...state,\n translate: action.translator ?? defaultTranslator,\n translateError: action.errorTranslator ?? defaultErrorTranslator,\n };\n case SET_LOCALE:\n return {\n ...state,\n locale: action.locale ?? navigator.languages[0],\n };\n default:\n return state;\n }\n};\n\nexport const fetchLocale = (state?: JsonFormsI18nState) => {\n if (state === undefined) {\n return undefined;\n }\n return state.locale;\n};\n\nexport const fetchTranslator = (state?: JsonFormsI18nState) => {\n if (state === undefined) {\n return defaultTranslator;\n }\n return state.translate;\n};\n\nexport const fetchErrorTranslator = (state?: JsonFormsI18nState) => {\n if (state === undefined) {\n return defaultErrorTranslator;\n }\n return state.translateError;\n};\n","/*\n The MIT License\n \n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport type { RankedTester } from '../testers';\nimport {\n ADD_RENDERER,\n AddRendererAction,\n REMOVE_RENDERER,\n RemoveRendererAction,\n} from '../actions';\nimport type { Reducer } from '../util';\n\nexport interface JsonFormsRendererRegistryEntry {\n tester: RankedTester;\n renderer: any;\n}\n\ntype ValidRendererReducerActions = AddRendererAction | RemoveRendererAction;\n\nexport const rendererReducer: Reducer<\n JsonFormsRendererRegistryEntry[],\n ValidRendererReducerActions\n> = (state = [], action) => {\n switch (action.type) {\n case ADD_RENDERER:\n return state.concat([\n { tester: action.tester, renderer: action.renderer },\n ]);\n case REMOVE_RENDERER:\n return state.filter((t) => t.tester !== action.tester);\n default:\n return state;\n }\n};\n","/*\n The MIT License\n\n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport isEmpty from 'lodash/isEmpty';\nimport get from 'lodash/get';\nimport endsWith from 'lodash/endsWith';\nimport last from 'lodash/last';\nimport isArray from 'lodash/isArray';\nimport reduce from 'lodash/reduce';\nimport toPairs from 'lodash/toPairs';\nimport includes from 'lodash/includes';\nimport type {\n Categorization,\n ControlElement,\n JsonSchema,\n UISchemaElement,\n} from '../models';\nimport {\n deriveTypes,\n hasType,\n isOneOfEnumSchema,\n resolveSchema,\n} from '../util';\n\n/**\n * Constant that indicates that a tester is not capable of handling\n * a combination of schema/data.\n * @type {number}\n */\nexport const NOT_APPLICABLE = -1;\n/**\n * A tester is a function that receives an UI schema and a JSON schema and returns a boolean.\n * The rootSchema is handed over as context. Can be used to resolve references.\n */\nexport type Tester = (\n uischema: UISchemaElement,\n schema: JsonSchema,\n context: TesterContext\n) => boolean;\n\n/**\n * A ranked tester associates a tester with a number.\n */\nexport type RankedTester = (\n uischema: UISchemaElement,\n schema: JsonSchema,\n context: TesterContext\n) => number;\n\n/**\n * Additional context given to a tester in addition to UISchema and JsonSchema.\n */\nexport interface TesterContext {\n /** The root JsonSchema of the form. Can be used to resolve references. */\n rootSchema: JsonSchema;\n /** The form wide configuration object given to JsonForms. */\n config: any;\n}\n\nexport const isControl = (uischema: any): uischema is ControlElement =>\n !isEmpty(uischema) && uischema.scope !== undefined;\n\n/**\n * Only applicable for Controls.\n *\n * This function checks whether the given UI schema is of type Control\n * and if so, resolves the sub-schema referenced by the control and applies\n * the given predicate\n *\n * @param {(JsonSchema) => boolean} predicate the predicate that should be\n * applied to the resolved sub-schema\n */\nexport const schemaMatches =\n (\n predicate: (schema: JsonSchema, rootSchema: JsonSchema) => boolean\n ): Tester =>\n (\n uischema: UISchemaElement,\n schema: JsonSchema,\n context: TesterContext\n ): boolean => {\n if (isEmpty(uischema) || !isControl(uischema)) {\n return false;\n }\n if (isEmpty(schema)) {\n return false;\n }\n const schemaPath = uischema.scope;\n if (isEmpty(schemaPath)) {\n return false;\n }\n let currentDataSchema = schema;\n if (hasType(schema, 'object')) {\n currentDataSchema = resolveSchema(\n schema,\n schemaPath,\n context?.rootSchema\n );\n }\n if (currentDataSchema === undefined) {\n return false;\n }\n\n return predicate(currentDataSchema, context?.rootSchema);\n };\n\nexport const schemaSubPathMatches =\n (\n subPath: string,\n predicate: (schema: JsonSchema, rootSchema: JsonSchema) => boolean\n ): Tester =>\n (\n uischema: UISchemaElement,\n schema: JsonSchema,\n context: TesterContext\n ): boolean => {\n if (isEmpty(uischema) || !isControl(uischema)) {\n return false;\n }\n const schemaPath = uischema.scope;\n let currentDataSchema: JsonSchema = schema;\n if (hasType(schema, 'object')) {\n currentDataSchema = resolveSchema(\n schema,\n schemaPath,\n context?.rootSchema\n );\n }\n currentDataSchema = get(currentDataSchema, subPath);\n\n if (currentDataSchema === undefined) {\n return false;\n }\n\n return predicate(currentDataSchema, context?.rootSchema);\n };\n\n/**\n * Only applicable for Controls.\n *\n * This function checks whether the given UI schema is of type Control\n * and if so, resolves the sub-schema referenced by the control and checks\n * whether the type of the sub-schema matches the expected one.\n *\n * @param {string} expectedType the expected type of the resolved sub-schema\n */\nexport const schemaTypeIs = (expectedType: string): Tester =>\n schemaMatches((schema) => !isEmpty(schema) && hasType(schema, expectedType));\n\n/**\n * Only applicable for Controls.\n *\n * This function checks whether the given UI schema is of type Control\n * and if so, resolves the sub-schema referenced by the control and checks\n * whether the format of the sub-schema matches the expected one.\n *\n * @param {string} expectedFormat the expected format of the resolved sub-schema\n */\nexport const formatIs = (expectedFormat: string): Tester =>\n schemaMatches(\n (schema) =>\n !isEmpty(schema) &&\n schema.format === expectedFormat &&\n hasType(schema, 'string')\n );\n\n/**\n * Checks whether the given UI schema has the expected type.\n *\n * @param {string} expected the expected UI schema type\n */\nexport const uiTypeIs =\n (expected: string): Tester =>\n (uischema: UISchemaElement): boolean =>\n !isEmpty(uischema) && uischema.type === expected;\n\n/**\n * Checks whether the given UI schema has an option with the given\n * name and whether it has the expected value. If no options property\n * is set, returns false.\n *\n * @param {string} optionName the name of the option to check\n * @param {any} optionValue the expected value of the option\n */\nexport const optionIs =\n (optionName: string, optionValue: any): Tester =>\n (uischema: UISchemaElement): boolean => {\n if (isEmpty(uischema)) {\n return false;\n }\n\n const options = uischema.options;\n return !isEmpty(options) && options[optionName] === optionValue;\n };\n\n/**\n * Only applicable for Controls.\n *\n * Checks whether the scope of a control ends with the expected string.\n *\n * @param {string} expected the expected ending of the reference\n */\nexport const scopeEndsWith =\n (expected: string): Tester =>\n (uischema: UISchemaElement): boolean => {\n if (isEmpty(expected) || !isControl(uischema)) {\n return false;\n }\n\n return endsWith(uischema.scope, expected);\n };\n\n/**\n * Only applicable for Controls.\n *\n * Checks whether the last segment of the scope matches the expected string.\n *\n * @param {string} expected the expected ending of the reference\n */\nexport const scopeEndIs =\n (expected: string): Tester =>\n (uischema: UISchemaElement): boolean => {\n if (isEmpty(expected) || !isControl(uischema)) {\n return false;\n }\n const schemaPath = uischema.scope;\n\n return !isEmpty(schemaPath) && last(schemaPath.split('/')) === expected;\n };\n\n/**\n * A tester that allow composing other testers by && them.\n *\n * @param {Array} testers the testers to be composed\n */\nexport const and =\n (...testers: Tester[]): Tester =>\n (uischema: UISchemaElement, schema: JsonSchema, context: TesterContext) =>\n testers.reduce(\n (acc, tester) => acc && tester(uischema, schema, context),\n true\n );\n\n/**\n * A tester that allow composing other testers by || them.\n *\n * @param {Array} testers the testers to be composed\n */\nexport const or =\n (...testers: Tester[]): Tester =>\n (uischema: UISchemaElement, schema: JsonSchema, context: TesterContext) =>\n testers.reduce(\n (acc, tester) => acc || tester(uischema, schema, context),\n false\n );\n/**\n * Create a ranked tester that will associate a number with a given tester, if the\n * latter returns true.\n *\n * @param {number} rank the rank to be returned in case the tester returns true\n * @param {Tester} tester a tester\n */\nexport const rankWith =\n (rank: number, tester: Tester) =>\n (\n uischema: UISchemaElement,\n schema: JsonSchema,\n context: TesterContext\n ): number => {\n if (tester(uischema, schema, context)) {\n return rank;\n }\n\n return NOT_APPLICABLE;\n };\n\nexport const withIncreasedRank =\n (by: number, rankedTester: RankedTester) =>\n (\n uischema: UISchemaElement,\n schema: JsonSchema,\n context: TesterContext\n ): number => {\n const rank = rankedTester(uischema, schema, context);\n if (rank === NOT_APPLICABLE) {\n return NOT_APPLICABLE;\n }\n\n return rank + by;\n };\n\n/**\n * Default tester for boolean.\n * @type {RankedTester}\n */\nexport const isBooleanControl = and(\n uiTypeIs('Control'),\n schemaTypeIs('boolean')\n);\n\n// TODO: rather check for properties property\nexport const isObjectControl = and(uiTypeIs('Control'), schemaTypeIs('object'));\n\nexport const isAllOfControl = and(\n uiTypeIs('Control'),\n schemaMatches((schema) =>\n Object.prototype.hasOwnProperty.call(schema, 'allOf')\n )\n);\n\nexport const isAnyOfControl = and(\n uiTypeIs('Control'),\n schemaMatches((schema) =>\n Object.prototype.hasOwnProperty.call(schema, 'anyOf')\n )\n);\n\nexport const isOneOfControl = and(\n uiTypeIs('Control'),\n schemaMatches((schema) =>\n Object.prototype.hasOwnProperty.call(schema, 'oneOf')\n )\n);\n\n/**\n * Tests whether the given UI schema is of type Control and if the schema\n * has an enum.\n * @type {Tester}\n */\nexport const isEnumControl = and(\n uiTypeIs('Control'),\n or(\n schemaMatches((schema) =>\n Object.prototype.hasOwnProperty.call(schema, 'enum')\n ),\n schemaMatches((schema) =>\n Object.prototype.hasOwnProperty.call(schema, 'const')\n )\n )\n);\n\n/**\n * Tests whether the given UI schema is of type Control and if the schema\n * has an enum based on oneOf.\n * @type {Tester}\n */\nexport const isOneOfEnumControl = and(\n uiTypeIs('Control'),\n schemaMatches((schema) => isOneOfEnumSchema(schema))\n);\n\n/**\n * Tests whether the given UI schema is of type Control and if the schema\n * is of type integer\n * @type {Tester}\n */\nexport const isIntegerControl = and(\n uiTypeIs('Control'),\n schemaTypeIs('integer')\n);\n\n/**\n * Tests whether the given UI schema is of type Control and if the schema\n * is of type number\n * @type {Tester}\n */\nexport const isNumberControl = and(uiTypeIs('Control'), schemaTypeIs('number'));\n\n/**\n * Tests whether the given UI schema is of type Control and if the schema\n * is of type string\n * @type {Tester}\n */\nexport const isStringControl = and(uiTypeIs('Control'), schemaTypeIs('string'));\n\n/**\n * Tests whether the given UI schema is of type Control and if is has\n * a 'multi' option.\n * @type {Tester}\n */\nexport const isMultiLineControl = and(\n uiTypeIs('Control'),\n optionIs('multi', true)\n);\n\n/**\n * Tests whether the given UI schema is of type Control and whether the schema\n * or uischema options has a 'date' format.\n * @type {Tester}\n */\nexport const isDateControl = and(\n uiTypeIs('Control'),\n or(formatIs('date'), optionIs('format', 'date'))\n);\n\n/**\n * Tests whether the given UI schema is of type Control and whether the schema\n * or the uischema options has a 'time' format.\n * @type {Tester}\n */\nexport const isTimeControl = and(\n uiTypeIs('Control'),\n or(formatIs('time'), optionIs('format', 'time'))\n);\n\n/**\n * Tests whether the given UI schema is of type Control and whether the schema\n * or the uischema options has a 'date-time' format.\n * @type {Tester}\n */\nexport const isDateTimeControl = and(\n uiTypeIs('Control'),\n or(formatIs('date-time'), optionIs('format', 'date-time'))\n);\n\n/**\n * Tests whether the given schema is an array of objects.\n * @type {Tester}\n */\nexport const isObjectArray = and(\n schemaMatches(\n (schema, rootSchema) =>\n hasType(schema, 'array') &&\n !Array.isArray(resolveSchema(schema, 'items', rootSchema)) // we don't care about tuples\n ),\n schemaSubPathMatches('items', (schema, rootSchema) => {\n const resolvedSchema = schema.$ref\n ? resolveSchema(rootSchema, schema.$ref, rootSchema)\n : schema;\n return hasType(resolvedSchema, 'object');\n })\n);\n\n/**\n * Tests whether the given UI schema is of type Control and if the schema\n * is an array of objects.\n * @type {Tester}\n */\nexport const isObjectArrayControl = and(uiTypeIs('Control'), isObjectArray);\n\nconst traverse = (\n any: JsonSchema | JsonSchema[],\n pred: (obj: JsonSchema) => boolean,\n rootSchema: JsonSchema\n): boolean => {\n if (isArray(any)) {\n return reduce(\n any,\n (acc, el) => acc || traverse(el, pred, rootSchema),\n false\n );\n }\n\n if (pred(any)) {\n return true;\n }\n\n if (any.$ref) {\n const toTraverse = resolveSchema(rootSchema, any.$ref, rootSchema);\n if (toTraverse && !toTraverse.$ref) {\n return traverse(toTraverse, pred, rootSchema);\n }\n }\n\n if (any.items) {\n return traverse(any.items, pred, rootSchema);\n }\n if (any.properties) {\n return reduce(\n toPairs(any.properties),\n (acc, [_key, val]) => acc || traverse(val, pred, rootSchema),\n false\n );\n }\n\n return false;\n};\n\nexport const isObjectArrayWithNesting = (\n uischema: UISchemaElement,\n schema: JsonSchema,\n context: TesterContext\n): boolean => {\n if (!uiTypeIs('Control')(uischema, schema, context)) {\n return false;\n }\n const schemaPath = (uischema as ControlElement).scope;\n const resolvedSchema = resolveSchema(\n schema,\n schemaPath,\n context?.rootSchema ?? schema\n );\n let objectDepth = 0;\n if (resolvedSchema !== undefined && resolvedSchema.items !== undefined) {\n // check if nested arrays\n if (\n traverse(\n resolvedSchema.items,\n (val) => {\n if (val === schema) {\n return false;\n }\n if (val.$ref !== undefined) {\n return false;\n }\n if (val.anyOf || val.allOf) {\n return true;\n }\n if (val.oneOf && !isOneOfEnumSchema(val)) {\n return true;\n }\n if (hasType(val, 'object')) {\n objectDepth++;\n if (objectDepth === 2) {\n return true;\n }\n }\n if (hasType(val, 'array')) {\n return true;\n }\n return false;\n },\n context?.rootSchema\n )\n ) {\n return true;\n }\n // check if uischema options detail is set\n if (uischema.options && uischema.options.detail) {\n if (typeof uischema.options.detail === 'string') {\n return uischema.options.detail.toUpperCase() !== 'DEFAULT';\n } else if (\n typeof uischema.options.detail === 'object' &&\n uischema.options.detail.type\n ) {\n return true;\n }\n }\n }\n return false;\n};\n\n/**\n * Synonym for isObjectArrayControl\n */\nexport const isArrayObjectControl = isObjectArrayControl;\n\n/**\n * Tests whether the given UI schema is of type Control and if the schema\n * is an array of a primitive type.\n * @type {Tester}\n */\nexport const isPrimitiveArrayControl = and(\n uiTypeIs('Control'),\n schemaMatches(\n (schema, rootSchema) =>\n deriveTypes(schema).length !== 0 &&\n !Array.isArray(resolveSchema(schema, 'items', rootSchema)) // we don't care about tuples\n ),\n schemaSubPathMatches('items', (schema, rootSchema) => {\n const resolvedSchema = schema.$ref\n ? resolveSchema(rootSchema, schema.$ref, rootSchema)\n : schema;\n const types = deriveTypes(resolvedSchema);\n return (\n types.length === 1 &&\n includes(['integer', 'number', 'boolean', 'string'], types[0])\n );\n })\n);\n\n/**\n * Tests whether a given UI schema is of type Control,\n * if the schema is of type number or integer and\n * whether the schema defines a numerical range with a default value.\n * @type {Tester}\n */\nexport const isRangeControl = and(\n uiTypeIs('Control'),\n or(schemaTypeIs('number'), schemaTypeIs('integer')),\n schemaMatches(\n (schema) =>\n Object.prototype.hasOwnProperty.call(schema, 'maximum') &&\n Object.prototype.hasOwnProperty.call(schema, 'minimum') &&\n Object.prototype.hasOwnProperty.call(schema, 'default')\n ),\n optionIs('slider', true)\n);\n\n/**\n * Tests whether the given UI schema is of type Control, if the schema\n * is of type integer and has option format\n * @type {Tester}\n */\nexport const isNumberFormatControl = and(\n uiTypeIs('Control'),\n schemaTypeIs('integer'),\n optionIs('format', true)\n);\n\nexport const isCategorization = (\n category: UISchemaElement\n): category is Categorization => category.type === 'Categorization';\n\nexport const isCategory = (uischema: UISchemaElement): boolean =>\n uischema.type === 'Category';\n\nexport const hasCategory = (categorization: Categorization): boolean => {\n if (isEmpty(categorization.elements)) {\n return false;\n }\n // all children of the categorization have to be categories\n return categorization.elements\n .map((elem) =>\n isCategorization(elem) ? hasCategory(elem) : isCategory(elem)\n )\n .reduce((prev, curr) => prev && curr, true);\n};\n\nexport const categorizationHasCategory = (uischema: UISchemaElement) =>\n hasCategory(uischema as Categorization);\n\nexport const not =\n (tester: Tester): Tester =>\n (uischema: UISchemaElement, schema: JsonSchema, context: TesterContext) =>\n !tester(uischema, schema, context);\n","/*\n The MIT License\n \n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport maxBy from 'lodash/maxBy';\nimport remove from 'lodash/remove';\nimport { ADD_UI_SCHEMA, REMOVE_UI_SCHEMA, UISchemaActions } from '../actions';\nimport { NOT_APPLICABLE } from '../testers';\nimport type { JsonSchema, UISchemaElement } from '../models';\nimport type { Reducer } from '../util';\n\nexport type UISchemaTester = (\n schema: JsonSchema,\n schemaPath: string,\n path: string\n) => number;\n\nexport interface JsonFormsUISchemaRegistryEntry {\n tester: UISchemaTester;\n uischema: UISchemaElement;\n}\n\nexport const uischemaRegistryReducer: Reducer<\n JsonFormsUISchemaRegistryEntry[],\n UISchemaActions\n> = (state = [], action) => {\n switch (action.type) {\n case ADD_UI_SCHEMA:\n return state\n .slice()\n .concat({ tester: action.tester, uischema: action.uischema });\n case REMOVE_UI_SCHEMA: {\n const copy = state.slice();\n remove(copy, (entry) => entry.tester === action.tester);\n return copy;\n }\n default:\n return state;\n }\n};\n\nexport const findMatchingUISchema =\n (state: JsonFormsUISchemaRegistryEntry[]) =>\n (\n jsonSchema: JsonSchema,\n schemaPath: string,\n path: string\n ): UISchemaElement => {\n const match = maxBy(state, (entry) =>\n entry.tester(jsonSchema, schemaPath, path)\n );\n if (\n match !== undefined &&\n match.tester(jsonSchema, schemaPath, path) !== NOT_APPLICABLE\n ) {\n return match.uischema;\n }\n return undefined;\n };\n","/*\n The MIT License\n \n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport type { ControlElement, UISchemaElement } from '../models';\nimport { coreReducer, errorAt, subErrorsAt } from './core';\nimport { defaultDataReducer } from './default-data';\nimport { rendererReducer } from './renderers';\nimport type { JsonFormsState } from '../store';\nimport type { JsonFormsUISchemaRegistryEntry } from './uischemas';\nimport { findMatchingUISchema, uischemaRegistryReducer } from './uischemas';\nimport { fetchErrorTranslator, fetchLocale, i18nReducer } from './i18n';\n\nimport { Generate } from '../generators';\nimport type { JsonSchema } from '../models/jsonSchema';\n\nimport { cellReducer } from './cells';\nimport { configReducer } from './config';\nimport get from 'lodash/get';\nimport { fetchTranslator } from '.';\nimport type { ErrorTranslator, Translator } from '../i18n';\n\nexport const jsonFormsReducerConfig = {\n core: coreReducer,\n renderers: rendererReducer,\n cells: cellReducer,\n config: configReducer,\n uischemas: uischemaRegistryReducer,\n defaultData: defaultDataReducer,\n i18n: i18nReducer,\n};\n\n/**\n * Finds a registered UI schema to use, if any.\n * @param schema the JSON schema describing the data to be rendered\n * @param schemaPath the according schema path\n * @param path the instance path\n * @param fallback the type of the layout to use or a UI-schema-generator function\n * @param control may be checked for embedded inline uischema options\n */\nexport const findUISchema = (\n uischemas: JsonFormsUISchemaRegistryEntry[],\n schema: JsonSchema,\n schemaPath: string,\n path: string,\n fallback: string | (() => UISchemaElement) = 'VerticalLayout',\n control?: ControlElement,\n rootSchema?: JsonSchema\n): UISchemaElement => {\n // handle options\n if (control && control.options && control.options.detail) {\n if (typeof control.options.detail === 'string') {\n if (control.options.detail.toUpperCase() === 'GENERATE') {\n //use fallback generation function\n if (typeof fallback === 'function') {\n return fallback();\n }\n // force generation of uischema\n return Generate.uiSchema(schema, fallback, undefined, rootSchema);\n }\n } else if (typeof control.options.detail === 'object') {\n // check if detail is a valid uischema\n if (\n control.options.detail.type &&\n typeof control.options.detail.type === 'string'\n ) {\n return control.options.detail as UISchemaElement;\n }\n }\n }\n // default\n const uiSchema = findMatchingUISchema(uischemas)(schema, schemaPath, path);\n if (uiSchema === undefined) {\n //use fallback generation function\n if (typeof fallback === 'function') {\n return fallback();\n }\n return Generate.uiSchema(schema, fallback, '#', rootSchema);\n }\n return uiSchema;\n};\n\nexport const getErrorAt =\n (instancePath: string, schema: JsonSchema) => (state: JsonFormsState) => {\n return errorAt(instancePath, schema)(state.jsonforms.core);\n };\n\nexport const getSubErrorsAt =\n (instancePath: string, schema: JsonSchema) => (state: JsonFormsState) =>\n subErrorsAt(instancePath, schema)(state.jsonforms.core);\n\nexport const getConfig = (state: JsonFormsState) => state.jsonforms.config;\n\nexport const getLocale = (state: JsonFormsState) =>\n fetchLocale(get(state, 'jsonforms.i18n'));\n\nexport const getTranslator =\n () =>\n (state: JsonFormsState): Translator =>\n fetchTranslator(get(state, 'jsonforms.i18n'));\n\nexport const getErrorTranslator =\n () =>\n (state: JsonFormsState): ErrorTranslator =>\n fetchErrorTranslator(get(state, 'jsonforms.i18n'));\n","/*\n The MIT License\n \n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport get from 'lodash/get';\nimport type Ajv from 'ajv';\nimport type { JsonFormsState } from '../store';\nimport type { JsonSchema, UISchemaElement } from '../models';\nimport {\n extractAjv,\n extractData,\n extractSchema,\n extractUiSchema,\n} from './core';\nimport {\n extractDefaultData,\n JsonFormsDefaultDataRegistryEntry,\n} from './default-data';\nimport type { JsonFormsRendererRegistryEntry } from './renderers';\nimport type { JsonFormsCellRendererRegistryEntry } from './cells';\nimport type { JsonFormsUISchemaRegistryEntry } from './uischemas';\n\nexport const getData = (state: JsonFormsState) =>\n extractData(get(state, 'jsonforms.core'));\nexport const getSchema = (state: JsonFormsState): JsonSchema =>\n extractSchema(get(state, 'jsonforms.core'));\nexport const getUiSchema = (state: JsonFormsState): UISchemaElement =>\n extractUiSchema(get(state, 'jsonforms.core'));\nexport const getAjv = (state: JsonFormsState): Ajv =>\n extractAjv(get(state, 'jsonforms.core'));\nexport const getDefaultData = (\n state: JsonFormsState\n): JsonFormsDefaultDataRegistryEntry[] =>\n extractDefaultData(get(state, 'jsonforms.defaultData'));\nexport const getRenderers = (\n state: JsonFormsState\n): JsonFormsRendererRegistryEntry[] => get(state, 'jsonforms.renderers');\nexport const getCells = (\n state: JsonFormsState\n): JsonFormsCellRendererRegistryEntry[] => get(state, 'jsonforms.cells');\nexport const getUISchemas = (\n state: JsonFormsState\n): JsonFormsUISchemaRegistryEntry[] => get(state, 'jsonforms.uischemas');\n","/*\n The MIT License\n\n Copyright (c) 2023 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\nimport { CoreActions } from '../actions';\nimport { JsonFormsCore } from './core';\n\nexport interface Middleware {\n (\n state: JsonFormsCore,\n action: CoreActions,\n defaultReducer: (state: JsonFormsCore, action: CoreActions) => JsonFormsCore\n ): JsonFormsCore;\n}\nexport const defaultMiddleware: Middleware = (state, action, defaultReducer) =>\n defaultReducer(state, action);\n","/*\n The MIT License\n \n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport isEmpty from 'lodash/isEmpty';\nimport range from 'lodash/range';\nimport { isScoped, Scopable } from '../models';\n\nexport const compose = (path1: string, path2: string) => {\n let p1 = path1;\n if (!isEmpty(path1) && !isEmpty(path2) && !path2.startsWith('[')) {\n p1 = path1 + '.';\n }\n\n if (isEmpty(p1)) {\n return path2;\n } else if (isEmpty(path2)) {\n return p1;\n } else {\n return `${p1}${path2}`;\n }\n};\n\nexport { compose as composePaths };\n\n/**\n * Convert a schema path (i.e. JSON pointer) to an array by splitting\n * at the '/' character and removing all schema-specific keywords.\n *\n * The returned value can be used to de-reference a root object by folding over it\n * and de-referencing the single segments to obtain a new object.\n *\n *\n * @param {string} schemaPath the schema path to be converted\n * @returns {string[]} an array containing only non-schema-specific segments\n */\nexport const toDataPathSegments = (schemaPath: string): string[] => {\n const s = schemaPath\n .replace(/(anyOf|allOf|oneOf)\\/[\\d]+\\//g, '')\n .replace(/(then|else)\\//g, '');\n const segments = s.split('/');\n\n const decodedSegments = segments.map(decode);\n\n const startFromRoot = decodedSegments[0] === '#' || decodedSegments[0] === '';\n const startIndex = startFromRoot ? 2 : 1;\n return range(startIndex, decodedSegments.length, 2).map(\n (idx) => decodedSegments[idx]\n );\n};\n\n/**\n * Convert a schema path (i.e. JSON pointer) to a data path.\n *\n * Data paths can be used in field change event handlers like handleChange.\n *\n * @example\n * toDataPath('#/properties/foo/properties/bar') === 'foo.bar')\n *\n * @param {string} schemaPath the schema path to be converted\n * @returns {string} the data path\n */\nexport const toDataPath = (schemaPath: string): string => {\n return toDataPathSegments(schemaPath).join('.');\n};\n\nexport const composeWithUi = (scopableUi: Scopable, path: string): string => {\n if (!isScoped(scopableUi)) {\n return path ?? '';\n }\n\n const segments = toDataPathSegments(scopableUi.scope);\n\n if (isEmpty(segments)) {\n return path ?? '';\n }\n\n return compose(path, segments.join('.'));\n};\n\n/**\n * Encodes the given segment to be used as part of a JSON Pointer\n *\n * JSON Pointer has special meaning for \"/\" and \"~\", therefore these must be encoded\n */\nexport const encode = (segment: string) =>\n segment?.replace(/~/g, '~0').replace(/\\//g, '~1');\n/**\n * Decodes a given JSON Pointer segment to its \"normal\" representation\n */\nexport const decode = (pointerSegment: string) =>\n pointerSegment?.replace(/~1/g, '/').replace(/~0/, '~');\n","/*\n The MIT License\n\n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport isEmpty from 'lodash/isEmpty';\nimport get from 'lodash/get';\nimport type { JsonSchema, JsonSchema7 } from '../models';\nimport { decode } from './path';\n\n/**\n * Map for storing refs and the respective schemas they are pointing to.\n */\nexport interface ReferenceSchemaMap {\n [ref: string]: JsonSchema;\n}\n\nconst isObjectSchema = (schema: JsonSchema): boolean => {\n return schema.properties !== undefined;\n};\nconst isArraySchema = (schema: JsonSchema): boolean => {\n return schema.type === 'array' && schema.items !== undefined;\n};\n\nexport const resolveData = (instance: any, dataPath: string): any => {\n if (isEmpty(dataPath)) {\n return instance;\n }\n const dataPathSegments = dataPath.split('.');\n\n return dataPathSegments.reduce((curInstance, decodedSegment) => {\n if (\n !curInstance ||\n !Object.prototype.hasOwnProperty.call(curInstance, decodedSegment)\n ) {\n return undefined;\n }\n\n return curInstance[decodedSegment];\n }, instance);\n};\n\n/**\n * Finds all references inside the given schema.\n *\n * @param schema The {@link JsonSchema} to find the references in\n * @param result The initial result map, default: empty map (this parameter is used for recursion\n * inside the function)\n * @param resolveTuples Whether arrays of tuples should be considered; default: false\n */\nexport const findAllRefs = (\n schema: JsonSchema,\n result: ReferenceSchemaMap = {},\n resolveTuples = false\n): ReferenceSchemaMap => {\n if (isObjectSchema(schema)) {\n Object.keys(schema.properties).forEach((key) =>\n findAllRefs(schema.properties[key], result)\n );\n }\n if (isArraySchema(schema)) {\n if (Array.isArray(schema.items)) {\n if (resolveTuples) {\n const items: JsonSchema[] = schema.items;\n items.forEach((child) => findAllRefs(child, result));\n }\n } else {\n findAllRefs(schema.items, result);\n }\n }\n if (Array.isArray(schema.anyOf)) {\n const anyOf: JsonSchema[] = schema.anyOf;\n anyOf.forEach((child) => findAllRefs(child, result));\n }\n if (schema.$ref !== undefined) {\n result[schema.$ref] = schema;\n }\n\n return result;\n};\n\nconst invalidSegment = (pathSegment: string) =>\n pathSegment === '#' || pathSegment === undefined || pathSegment === '';\n\n/**\n * Resolve the given schema path in order to obtain a subschema.\n * @param {JsonSchema} schema the root schema from which to start\n * @param {string} schemaPath the schema path to be resolved\n * @param {JsonSchema} rootSchema the actual root schema\n * @returns {JsonSchema} the resolved sub-schema\n */\nexport const resolveSchema = (\n schema: JsonSchema,\n schemaPath: string,\n rootSchema: JsonSchema\n): JsonSchema => {\n const segments = schemaPath?.split('/').map(decode);\n return resolveSchemaWithSegments(schema, segments, rootSchema);\n};\n\nconst resolveSchemaWithSegments = (\n schema: JsonSchema,\n pathSegments: string[],\n rootSchema: JsonSchema\n): JsonSchema => {\n if (isEmpty(schema)) {\n return undefined;\n }\n\n if (schema.$ref) {\n schema = resolveSchema(rootSchema, schema.$ref, rootSchema);\n }\n\n if (!pathSegments || pathSegments.length === 0) {\n return schema;\n }\n\n const [segment, ...remainingSegments] = pathSegments;\n\n if (invalidSegment(segment)) {\n return resolveSchemaWithSegments(schema, remainingSegments, rootSchema);\n }\n\n const singleSegmentResolveSchema = get(schema, segment);\n\n const resolvedSchema = resolveSchemaWithSegments(\n singleSegmentResolveSchema,\n remainingSegments,\n rootSchema\n );\n if (resolvedSchema) {\n return resolvedSchema;\n }\n\n if (segment === 'properties' || segment === 'items') {\n // Let's try to resolve the path, assuming oneOf/allOf/anyOf/then/else was omitted.\n // We only do this when traversing an object or array as we want to avoid\n // following a property which is named oneOf, allOf, anyOf, then or else.\n let alternativeResolveResult = undefined;\n\n const subSchemas = [].concat(\n schema.oneOf ?? [],\n schema.allOf ?? [],\n schema.anyOf ?? [],\n (schema as JsonSchema7).then ?? [],\n (schema as JsonSchema7).else ?? []\n );\n\n for (const subSchema of subSchemas) {\n alternativeResolveResult = resolveSchemaWithSegments(\n subSchema,\n [segment, ...remainingSegments],\n rootSchema\n );\n if (alternativeResolveResult) {\n break;\n }\n }\n return alternativeResolveResult;\n }\n\n return undefined;\n};\n","/*\n The MIT License\n\n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport has from 'lodash/has';\nimport {\n AndCondition,\n Condition,\n JsonSchema,\n LeafCondition,\n OrCondition,\n RuleEffect,\n SchemaBasedCondition,\n Scopable,\n UISchemaElement,\n} from '../models';\nimport { resolveData } from './resolvers';\nimport { composeWithUi } from './path';\nimport type Ajv from 'ajv';\nimport { getAjv } from '../reducers';\nimport type { JsonFormsState } from '../store';\n\nconst isOrCondition = (condition: Condition): condition is OrCondition =>\n condition.type === 'OR';\n\nconst isAndCondition = (condition: Condition): condition is AndCondition =>\n condition.type === 'AND';\n\nconst isLeafCondition = (condition: Condition): condition is LeafCondition =>\n condition.type === 'LEAF';\n\nconst isSchemaCondition = (\n condition: Condition\n): condition is SchemaBasedCondition => has(condition, 'schema');\n\nconst getConditionScope = (condition: Scopable, path: string): string => {\n return composeWithUi(condition, path);\n};\n\nconst evaluateCondition = (\n data: any,\n condition: Condition,\n path: string,\n ajv: Ajv\n): boolean => {\n if (isAndCondition(condition)) {\n return condition.conditions.reduce(\n (acc, cur) => acc && evaluateCondition(data, cur, path, ajv),\n true\n );\n } else if (isOrCondition(condition)) {\n return condition.conditions.reduce(\n (acc, cur) => acc || evaluateCondition(data, cur, path, ajv),\n false\n );\n } else if (isLeafCondition(condition)) {\n const value = resolveData(data, getConditionScope(condition, path));\n return value === condition.expectedValue;\n } else if (isSchemaCondition(condition)) {\n const value = resolveData(data, getConditionScope(condition, path));\n if (condition.failWhenUndefined && value === undefined) {\n return false;\n }\n return ajv.validate(condition.schema, value) as boolean;\n } else {\n // unknown condition\n return true;\n }\n};\n\nconst isRuleFulfilled = (\n uischema: UISchemaElement,\n data: any,\n path: string,\n ajv: Ajv\n): boolean => {\n const condition = uischema.rule.condition;\n return evaluateCondition(data, condition, path, ajv);\n};\n\nexport const evalVisibility = (\n uischema: UISchemaElement,\n data: any,\n path: string = undefined,\n ajv: Ajv\n): boolean => {\n const fulfilled = isRuleFulfilled(uischema, data, path, ajv);\n\n switch (uischema.rule.effect) {\n case RuleEffect.HIDE:\n return !fulfilled;\n case RuleEffect.SHOW:\n return fulfilled;\n // visible by default\n default:\n return true;\n }\n};\n\nexport const evalEnablement = (\n uischema: UISchemaElement,\n data: any,\n path: string = undefined,\n ajv: Ajv\n): boolean => {\n const fulfilled = isRuleFulfilled(uischema, data, path, ajv);\n\n switch (uischema.rule.effect) {\n case RuleEffect.DISABLE:\n return !fulfilled;\n case RuleEffect.ENABLE:\n return fulfilled;\n // enabled by default\n default:\n return true;\n }\n};\n\nexport const hasShowRule = (uischema: UISchemaElement): boolean => {\n if (\n uischema.rule &&\n (uischema.rule.effect === RuleEffect.SHOW ||\n uischema.rule.effect === RuleEffect.HIDE)\n ) {\n return true;\n }\n return false;\n};\n\nexport const hasEnableRule = (uischema: UISchemaElement): boolean => {\n if (\n uischema.rule &&\n (uischema.rule.effect === RuleEffect.ENABLE ||\n uischema.rule.effect === RuleEffect.DISABLE)\n ) {\n return true;\n }\n return false;\n};\n\nexport const isVisible = (\n uischema: UISchemaElement,\n data: any,\n path: string = undefined,\n ajv: Ajv\n): boolean => {\n if (uischema.rule) {\n return evalVisibility(uischema, data, path, ajv);\n }\n\n return true;\n};\n\nexport const isEnabled = (\n uischema: UISchemaElement,\n data: any,\n path: string = undefined,\n ajv: Ajv\n): boolean => {\n if (uischema.rule) {\n return evalEnablement(uischema, data, path, ajv);\n }\n\n return true;\n};\n\n/**\n * Indicates whether the given `uischema` element shall be enabled or disabled.\n * Checks the global readonly flag, uischema rule, uischema options (including the config),\n * the schema and the enablement indicator of the parent.\n */\nexport const isInherentlyEnabled = (\n state: JsonFormsState,\n ownProps: any,\n uischema: UISchemaElement,\n schema: (JsonSchema & { readOnly?: boolean }) | undefined,\n rootData: any,\n config: any\n) => {\n if (state?.jsonforms?.readonly) {\n return false;\n }\n if (uischema && hasEnableRule(uischema)) {\n return isEnabled(uischema, rootData, ownProps?.path, getAjv(state));\n }\n if (typeof uischema?.options?.readonly === 'boolean') {\n return !uischema.options.readonly;\n }\n if (typeof uischema?.options?.readOnly === 'boolean') {\n return !uischema.options.readOnly;\n }\n if (typeof config?.readonly === 'boolean') {\n return !config.readonly;\n }\n if (typeof config?.readOnly === 'boolean') {\n return !config.readOnly;\n }\n if (schema?.readOnly === true) {\n return false;\n }\n if (typeof ownProps?.enabled === 'boolean') {\n return ownProps.enabled;\n }\n return true;\n};\n","/*\n The MIT License\n \n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport isEmpty from 'lodash/isEmpty';\nimport isArray from 'lodash/isArray';\nimport includes from 'lodash/includes';\nimport find from 'lodash/find';\nimport type { JsonSchema, Scoped, UISchemaElement } from '..';\nimport { resolveData, resolveSchema } from './resolvers';\nimport { composePaths, toDataPathSegments } from './path';\nimport { isEnabled, isVisible } from './runtime';\nimport type Ajv from 'ajv';\n\n/**\n * Returns the string representation of the given date. The format of the output string can be specified:\n * - 'date' for a date-only string (YYYY-MM-DD),\n * - 'time' for a time-only string (HH:mm:ss), or\n * - 'date-time' for a full date-time string in ISO format (YYYY-MM-DDTHH:mm:ss.sssZ).\n * If no format is specified, the full date-time ISO string is returned by default.\n *\n * @returns {string} A string representation of the date in the specified format.\n *\n * @example\n * // returns '2023-11-09'\n * convertDateToString(new Date('2023-11-09T14:22:54.131Z'), 'date');\n *\n * @example\n * // returns '14:22:54'\n * convertDateToString(new Date('2023-11-09T14:22:54.131Z'), 'time');\n *\n * @example\n * // returns '2023-11-09T14:22:54.131Z'\n * convertDateToString(new Date('2023-11-09T14:22:54.131Z'), 'date-time');\n *\n * @example\n * // returns '2023-11-09T14:22:54.131Z'\n * convertDateToString(new Date('2023-11-09T14:22:54.131Z'));\n */\nexport const convertDateToString = (\n date: Date,\n format?: 'date' | 'time' | 'date-time'\n): string => {\n //e.g. '2023-11-09T14:22:54.131Z'\n const dateString = date.toISOString();\n if (format === 'date-time') {\n return dateString;\n } else if (format === 'date') {\n // e.g. '2023-11-09'\n return dateString.split('T')[0];\n } else if (format === 'time') {\n //e.g. '14:22:54'\n return dateString.split('T')[1].split('.')[0];\n }\n return dateString;\n};\n\n/**\n * Escape the given string such that it can be used as a class name,\n * i.e. hashes and slashes will be replaced.\n *\n * @param {string} s the string that should be converted to a valid class name\n * @returns {string} the escaped string\n */\nexport const convertToValidClassName = (s: string): string =>\n s.replace('#', 'root').replace(new RegExp('/', 'g'), '_');\n\nexport const formatErrorMessage = (errors: string[]) => {\n if (errors === undefined || errors === null) {\n return '';\n }\n\n return errors.join('\\n');\n};\n\nexport const hasType = (jsonSchema: JsonSchema, expected: string): boolean => {\n return includes(deriveTypes(jsonSchema), expected);\n};\n\n/**\n * Derives the type of the jsonSchema element\n */\nexport const deriveTypes = (jsonSchema: JsonSchema): string[] => {\n if (isEmpty(jsonSchema)) {\n return [];\n }\n if (!isEmpty(jsonSchema.type) && typeof jsonSchema.type === 'string') {\n return [jsonSchema.type];\n }\n if (isArray(jsonSchema.type)) {\n return jsonSchema.type;\n }\n if (\n !isEmpty(jsonSchema.properties) ||\n !isEmpty(jsonSchema.additionalProperties)\n ) {\n return ['object'];\n }\n if (!isEmpty(jsonSchema.items)) {\n return ['array'];\n }\n if (!isEmpty(jsonSchema.enum)) {\n const types: Set = new Set();\n jsonSchema.enum.forEach((enumElement) => {\n if (typeof enumElement === 'string') {\n types.add('string');\n } else {\n deriveTypes(enumElement).forEach((type) => types.add(type));\n }\n });\n return Array.from(types);\n }\n if (!isEmpty(jsonSchema.allOf)) {\n const allOfType = find(\n jsonSchema.allOf,\n (schema: JsonSchema) => deriveTypes(schema).length !== 0\n );\n\n if (allOfType) {\n return deriveTypes(allOfType);\n }\n }\n // ignore all remaining cases\n return [];\n};\n\n/**\n * Convenience wrapper around resolveData and resolveSchema.\n */\nexport const Resolve: {\n schema(\n schema: JsonSchema,\n schemaPath: string,\n rootSchema: JsonSchema\n ): JsonSchema;\n data(data: any, path: string): any;\n} = {\n schema: resolveSchema,\n data: resolveData,\n};\n\n// Paths --\nconst fromScoped = (scopable: Scoped): string =>\n toDataPathSegments(scopable.scope).join('.');\n\nexport const Paths = {\n compose: composePaths,\n fromScoped,\n};\n\n// Runtime --\nexport const Runtime = {\n isEnabled(uischema: UISchemaElement, data: any, ajv: Ajv): boolean {\n return isEnabled(uischema, data, undefined, ajv);\n },\n isVisible(uischema: UISchemaElement, data: any, ajv: Ajv): boolean {\n return isVisible(uischema, data, undefined, ajv);\n },\n};\n","/*\n The MIT License\n \n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport startCase from 'lodash/startCase';\n\nimport type { ControlElement, JsonSchema, LabelDescription } from '../models';\nimport { decode } from './path';\n\nconst deriveLabel = (\n controlElement: ControlElement,\n schemaElement?: JsonSchema\n): string => {\n if (schemaElement && typeof schemaElement.title === 'string') {\n return schemaElement.title;\n }\n if (typeof controlElement.scope === 'string') {\n const ref = controlElement.scope;\n const label = decode(ref.substr(ref.lastIndexOf('/') + 1));\n return startCase(label);\n }\n\n return '';\n};\n\nexport const createCleanLabel = (label: string): string => {\n return startCase(label.replace('_', ' '));\n};\n\n/**\n * Return a label object based on the given control and schema element.\n * @param {ControlElement} withLabel the UI schema to obtain a label object for\n * @param {JsonSchema} schema optional: the corresponding schema element\n * @returns {LabelDescription}\n */\nexport const createLabelDescriptionFrom = (\n withLabel: ControlElement,\n schema?: JsonSchema\n): LabelDescription => {\n const labelProperty = withLabel.label;\n if (typeof labelProperty === 'boolean') {\n return labelDescription(deriveLabel(withLabel, schema), labelProperty);\n }\n if (typeof labelProperty === 'string') {\n return labelDescription(labelProperty, true);\n }\n if (typeof labelProperty === 'object') {\n const label =\n typeof labelProperty.text === 'string'\n ? labelProperty.text\n : deriveLabel(withLabel, schema);\n const show =\n typeof labelProperty.show === 'boolean' ? labelProperty.show : true;\n return labelDescription(label, show);\n }\n return labelDescription(deriveLabel(withLabel, schema), true);\n};\n\nconst labelDescription = (text: string, show: boolean): LabelDescription => ({\n text: text,\n show: show,\n});\n","/*\n The MIT License\n\n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport get from 'lodash/get';\nimport {\n ControlElement,\n isLabelable,\n JsonSchema,\n JsonSchema4,\n JsonSchema7,\n LabelElement,\n UISchemaElement,\n} from '../models';\nimport find from 'lodash/find';\nimport {\n getUISchemas,\n getAjv,\n getCells,\n getConfig,\n getData,\n getErrorAt,\n getErrorTranslator,\n getRenderers,\n getSchema,\n getSubErrorsAt,\n getTranslator,\n getUiSchema,\n} from '../reducers';\nimport type {\n JsonFormsCellRendererRegistryEntry,\n JsonFormsRendererRegistryEntry,\n JsonFormsUISchemaRegistryEntry,\n} from '../reducers';\nimport type { RankedTester } from '../testers';\nimport { hasShowRule, isInherentlyEnabled, isVisible } from './runtime';\nimport { createLabelDescriptionFrom } from './label';\nimport type { CombinatorKeyword } from './combinators';\nimport { moveDown, moveUp } from './array';\nimport type { AnyAction, Dispatch } from './type';\nimport { Resolve, convertDateToString, hasType } from './util';\nimport { composePaths, composeWithUi } from './path';\nimport { CoreActions, update } from '../actions';\nimport type { ErrorObject } from 'ajv';\nimport type { JsonFormsState } from '../store';\nimport {\n deriveLabelForUISchemaElement,\n getCombinedErrorMessage,\n getI18nKey,\n getI18nKeyPrefix,\n getI18nKeyPrefixBySchema,\n getArrayTranslations,\n Translator,\n CombinatorTranslations,\n getCombinatorTranslations,\n combinatorDefaultTranslations,\n} from '../i18n';\nimport {\n arrayDefaultTranslations,\n ArrayTranslations,\n} from '../i18n/arrayTranslations';\nimport { resolveSchema } from './resolvers';\nimport cloneDeep from 'lodash/cloneDeep';\nimport isEqual from 'lodash/isEqual';\nimport has from 'lodash/has';\nimport any from 'lodash/fp/any';\nimport all from 'lodash/fp/all';\n\nconst dataPathToJsonPointer = (dataPath: string): string => {\n const parts = dataPath.split('.');\n let jsonPointer = '#';\n\n parts.forEach((part) => {\n if (part.match(/^\\d+$/)) {\n jsonPointer += '/items';\n } else {\n jsonPointer += `/properties/${part}`;\n }\n });\n\n return jsonPointer;\n};\n\nconst checkDataCondition = (\n propertyCondition: unknown,\n property: string,\n data: Record\n) => {\n if (has(propertyCondition, 'const')) {\n return (\n has(data, property) &&\n isEqual(data[property], get(propertyCondition, 'const'))\n );\n } else if (has(propertyCondition, 'enum')) {\n return (\n has(data, property) &&\n (get(propertyCondition, 'enum') as unknown[]).find((value) =>\n isEqual(value, data[property])\n ) !== undefined\n );\n } else if (has(propertyCondition, 'pattern')) {\n const pattern = new RegExp(get(propertyCondition, 'pattern'));\n\n return (\n has(data, property) &&\n typeof data[property] === 'string' &&\n pattern.test(data[property] as string)\n );\n }\n\n return false;\n};\n\nconst checkPropertyCondition = (\n propertiesCondition: Record,\n property: string,\n data: Record\n): boolean => {\n if (has(propertiesCondition[property], 'not')) {\n return !checkDataCondition(\n get(propertiesCondition[property], 'not'),\n property,\n data\n );\n }\n\n if (has(propertiesCondition[property], 'properties') && has(data, property)) {\n const nextPropertyConditions = get(\n propertiesCondition[property],\n 'properties'\n );\n\n return all(\n (prop) =>\n checkPropertyCondition(\n nextPropertyConditions,\n prop,\n data[property] as Record\n ),\n Object.keys(nextPropertyConditions)\n );\n }\n\n return checkDataCondition(propertiesCondition[property], property, data);\n};\n\nconst evaluateCondition = (\n schema: JsonSchema,\n data: Record\n): boolean => {\n if (has(schema, 'allOf')) {\n return all(\n (subschema: JsonSchema) => evaluateCondition(subschema, data),\n get(schema, 'allOf')\n );\n }\n\n if (has(schema, 'anyOf')) {\n return any(\n (subschema: JsonSchema) => evaluateCondition(subschema, data),\n get(schema, 'anyOf')\n );\n }\n\n if (has(schema, 'oneOf')) {\n const subschemas = get(schema, 'oneOf');\n\n let satisfied = false;\n\n for (let i = 0; i < subschemas.length; i++) {\n const current = evaluateCondition(subschemas[i], data);\n if (current && satisfied) {\n return false;\n }\n\n if (current && !satisfied) {\n satisfied = true;\n }\n }\n\n return satisfied;\n }\n\n let requiredProperties: string[] = [];\n if (has(schema, 'required')) {\n requiredProperties = get(schema, 'required');\n }\n\n const requiredCondition = all(\n (property) => has(data, property),\n requiredProperties\n );\n\n if (has(schema, 'properties')) {\n const propertiesCondition = get(schema, 'properties') as Record<\n string,\n unknown\n >;\n\n const valueCondition = all(\n (property) => checkPropertyCondition(propertiesCondition, property, data),\n Object.keys(propertiesCondition)\n );\n\n return requiredCondition && valueCondition;\n }\n\n return requiredCondition;\n};\n\n/**\n * Go through parent's properties until the segment is found at the exact level it is defined and check if it is required\n */\nconst extractRequired = (\n schema: JsonSchema,\n segment: string,\n prevSegments: string[]\n) => {\n let i = 0;\n let currentSchema = schema;\n while (\n i < prevSegments.length &&\n (has(currentSchema, prevSegments[i]) ||\n (has(currentSchema, 'properties') &&\n has(get(currentSchema, 'properties'), prevSegments[i])))\n ) {\n if (has(currentSchema, 'properties')) {\n currentSchema = get(currentSchema, 'properties');\n }\n currentSchema = get(currentSchema, prevSegments[i]);\n ++i;\n }\n\n if (i < prevSegments.length) {\n return false;\n }\n\n return (\n has(currentSchema, 'required') &&\n (get(currentSchema, 'required') as string[]).includes(segment)\n );\n};\n\n/**\n * Check if property's required attribute is set based on if-then-else condition\n *\n */\nconst checkRequiredInIf = (\n schema: JsonSchema,\n segment: string,\n prevSegments: string[],\n data: Record\n): boolean => {\n const propertiesConditionSchema = get(schema, 'if');\n\n const condition = evaluateCondition(propertiesConditionSchema, data);\n\n const ifInThen = has(get(schema, 'then'), 'if');\n const ifInElse = has(get(schema, 'else'), 'if');\n const allOfInThen = has(get(schema, 'then'), 'allOf');\n const allOfInElse = has(get(schema, 'else'), 'allOf');\n\n return (\n (has(schema, 'then') &&\n condition &&\n extractRequired(get(schema, 'then'), segment, prevSegments)) ||\n (has(schema, 'else') &&\n !condition &&\n extractRequired(get(schema, 'else'), segment, prevSegments)) ||\n (ifInThen &&\n condition &&\n checkRequiredInIf(get(schema, 'then'), segment, prevSegments, data)) ||\n (ifInElse &&\n !condition &&\n checkRequiredInIf(get(schema, 'else'), segment, prevSegments, data)) ||\n (allOfInThen &&\n condition &&\n conditionallyRequired(\n get(schema, 'then'),\n segment,\n prevSegments,\n data\n )) ||\n (allOfInElse &&\n !condition &&\n conditionallyRequired(get(schema, 'else'), segment, prevSegments, data))\n );\n};\n\n/**\n * Check if property becomes required based on some if-then-else condition\n * that is part of allOf combinator\n */\nconst conditionallyRequired = (\n schema: JsonSchema,\n segment: string,\n prevSegments: string[],\n data: any\n) => {\n const nestedAllOfSchema = get(schema, 'allOf');\n\n return any((subschema: JsonSchema4 | JsonSchema7): boolean => {\n return (\n (has(subschema, 'if') &&\n checkRequiredInIf(subschema, segment, prevSegments, data)) ||\n conditionallyRequired(subschema, segment, prevSegments, data)\n );\n }, nestedAllOfSchema);\n};\n\nconst getNextHigherSchemaPath = (schemaPath: string): string => {\n const pathSegments = schemaPath.split('/');\n const lastSegment = pathSegments[pathSegments.length - 1];\n\n // We'd normally jump two segments back, but if we're in an `items` key, we want to check its parent\n // Example path: '#/properties/anotherObject/properties/myArray/items/properties/propertyName'\n const nextHigherSegmentIndexDifference = lastSegment === 'items' ? 1 : 2;\n const nextHigherSchemaSegments = pathSegments.slice(\n 0,\n pathSegments.length - nextHigherSegmentIndexDifference\n );\n\n return nextHigherSchemaSegments.join('/');\n};\n\nconst getNextHigherDataPath = (dataPath: string): string => {\n const dataPathSegments = dataPath.split('.');\n return dataPathSegments.slice(0, dataPathSegments.length - 1).join('.');\n};\n\n/**\n * Check if property is being required in the parent schema\n */\nconst isRequiredInParent = (\n schema: JsonSchema,\n schemaPath: string,\n segment: string,\n prevSegments: string[],\n data: Record,\n dataPath: string\n): boolean => {\n const pathSegments = schemaPath.split('/');\n const lastSegment = pathSegments[pathSegments.length - 1];\n const nextHigherSchemaPath = getNextHigherSchemaPath(schemaPath);\n\n if (!nextHigherSchemaPath) {\n return false;\n }\n\n const nextHigherSchema = Resolve.schema(schema, nextHigherSchemaPath, schema);\n\n const nextHigherDataPath = getNextHigherDataPath(dataPath);\n const currentData = Resolve.data(data, nextHigherDataPath);\n\n return (\n conditionallyRequired(\n nextHigherSchema,\n segment,\n [lastSegment, ...prevSegments],\n currentData\n ) ||\n (has(nextHigherSchema, 'if') &&\n checkRequiredInIf(\n nextHigherSchema,\n segment,\n [lastSegment, ...prevSegments],\n currentData\n )) ||\n // TODO: Were we previously skipping each other parent\n // when calling `isRequiredInParent` recursively (because of\n // the `slice` call with (pathSegments.length - 4) - hence going\n // back two times on each call)\n isRequiredInParent(\n schema,\n nextHigherSchemaPath,\n segment,\n [lastSegment, ...prevSegments],\n // TODO: Why was this currentData?\n data,\n nextHigherDataPath\n )\n );\n};\n\nconst isRequiredInSchema = (schema: JsonSchema, segment: string): boolean => {\n return (\n schema !== undefined &&\n schema.required !== undefined &&\n schema.required.indexOf(segment) !== -1\n );\n};\n\nconst isRequired = (\n schema: JsonSchema,\n schemaPath: string,\n rootSchema: JsonSchema\n): boolean => {\n const pathSegments = schemaPath.split('/');\n const lastSegment = pathSegments[pathSegments.length - 1];\n // TODO: This does not work correctly with \"items\" in the schemaPath\n // Skip \"properties\", \"items\" etc. to resolve the parent\n const nextHigherSchemaSegments = pathSegments.slice(\n 0,\n pathSegments.length - 2\n );\n const nextHigherSchemaPath = nextHigherSchemaSegments.join('/');\n const nextHigherSchema = Resolve.schema(\n schema,\n nextHigherSchemaPath,\n rootSchema\n );\n return isRequiredInSchema(nextHigherSchema, lastSegment);\n};\n\n// TODO: This may now be combinable with `isRequiredInParent` in a\n// single function\nconst isConditionallyRequired = (\n rootSchema: JsonSchema,\n schemaPath: string,\n data: any,\n dataPath: string\n): boolean => {\n const pathSegments = schemaPath.split('/');\n const lastSegment = pathSegments[pathSegments.length - 1];\n\n const nextHigherSchemaPath = getNextHigherSchemaPath(schemaPath);\n const nextHigherSchema = Resolve.schema(\n rootSchema,\n nextHigherSchemaPath,\n rootSchema\n );\n\n // We need the `dataPath` to be able to resolve data in arrays,\n // for example `myObject.myArray.0.myProperty` has no\n // equivalent for the index in the schema syntax\n const nextHigherDataPath = getNextHigherDataPath(dataPath);\n const currentData = Resolve.data(data, nextHigherDataPath);\n\n const requiredInIf =\n has(nextHigherSchema, 'if') &&\n checkRequiredInIf(nextHigherSchema, lastSegment, [], currentData);\n\n const requiredConditionally = conditionallyRequired(\n nextHigherSchema,\n lastSegment,\n [],\n currentData\n );\n\n const requiredConditionallyInParent = isRequiredInParent(\n rootSchema,\n // TODO: Why was this previously schemaPath\n nextHigherSchemaPath,\n lastSegment,\n [],\n data,\n nextHigherDataPath\n );\n\n return requiredInIf || requiredConditionally || requiredConditionallyInParent;\n};\n\n/**\n * Adds an asterisk to the given label string based\n * on the required parameter.\n *\n * @param {string | undefined} label the label string\n * @param {boolean} required whether the label belongs to a control which is required\n * @param {boolean} hideRequiredAsterisk applied UI Schema option\n * @returns {string} the label string\n */\nexport const computeLabel = (\n label: string | undefined,\n required: boolean,\n hideRequiredAsterisk: boolean\n): string => {\n return `${label ?? ''}${required && !hideRequiredAsterisk ? '*' : ''}`;\n};\n\n/**\n * Indicates whether to mark a field as required.\n *\n * @param {boolean} required whether the label belongs to a control which is required\n * @param {boolean} hideRequiredAsterisk applied UI Schema option\n * @returns {boolean} should the field be marked as required\n */\nexport const showAsRequired = (\n required: boolean,\n hideRequiredAsterisk: boolean\n): boolean => {\n return required && !hideRequiredAsterisk;\n};\n\n/**\n * Create a default value based on the given schema.\n * @param schema the schema for which to create a default value.\n * @returns {any}\n */\nexport const createDefaultValue = (\n schema: JsonSchema,\n rootSchema: JsonSchema\n) => {\n const resolvedSchema = Resolve.schema(schema, schema.$ref, rootSchema);\n if (resolvedSchema.default !== undefined) {\n return extractDefaults(resolvedSchema, rootSchema);\n }\n if (hasType(resolvedSchema, 'string')) {\n if (\n resolvedSchema.format === 'date-time' ||\n resolvedSchema.format === 'date' ||\n resolvedSchema.format === 'time'\n ) {\n return convertDateToString(new Date(), resolvedSchema.format);\n }\n return '';\n } else if (\n hasType(resolvedSchema, 'integer') ||\n hasType(resolvedSchema, 'number')\n ) {\n return 0;\n } else if (hasType(resolvedSchema, 'boolean')) {\n return false;\n } else if (hasType(resolvedSchema, 'array')) {\n return [];\n } else if (hasType(resolvedSchema, 'object')) {\n return extractDefaults(resolvedSchema, rootSchema);\n } else if (hasType(resolvedSchema, 'null')) {\n return null;\n } else {\n return {};\n }\n};\n\n/**\n * Returns the default value defined in the given schema.\n * @param schema the schema for which to create a default value.\n * @returns {any}\n */\nexport const extractDefaults = (schema: JsonSchema, rootSchema: JsonSchema) => {\n if (hasType(schema, 'object') && schema.default === undefined) {\n const result: { [key: string]: any } = {};\n for (const key in schema.properties) {\n const property = schema.properties[key];\n const resolvedProperty = property.$ref\n ? Resolve.schema(rootSchema, property.$ref, rootSchema)\n : property;\n if (resolvedProperty.default !== undefined) {\n result[key] = cloneDeep(resolvedProperty.default);\n }\n }\n return result;\n }\n return cloneDeep(schema.default);\n};\n\n/**\n * Whether an element's description should be hidden.\n *\n * @param visible whether an element is visible\n * @param description the element's description\n * @param isFocused whether the element is focused\n *\n * @returns {boolean} true, if the description is to be hidden, false otherwise\n */\nexport const isDescriptionHidden = (\n visible: boolean,\n description: string | undefined,\n isFocused: boolean,\n showUnfocusedDescription: boolean\n): boolean => {\n return (\n description === undefined ||\n (description !== undefined && !visible) ||\n (!showUnfocusedDescription && !isFocused)\n );\n};\n\nexport interface WithClassname {\n className?: string;\n}\n\nexport interface EnumOption {\n label: string;\n value: any;\n}\n\nexport const enumToEnumOptionMapper = (\n e: any,\n t?: Translator,\n i18nKey?: string\n): EnumOption => {\n let label = typeof e === 'string' ? e : JSON.stringify(e);\n if (t) {\n if (i18nKey) {\n label = t(`${i18nKey}.${label}`, label);\n } else {\n label = t(label, label);\n }\n }\n return { label, value: e };\n};\n\nexport const oneOfToEnumOptionMapper = (\n e: any,\n t?: Translator,\n fallbackI18nKey?: string\n): EnumOption => {\n let label =\n e.title ??\n (typeof e.const === 'string' ? e.const : JSON.stringify(e.const));\n if (t) {\n // prefer schema keys as they can be more specialized\n if (e.i18n) {\n label = t(e.i18n, label);\n } else if (fallbackI18nKey) {\n label = t(`${fallbackI18nKey}.${label}`, label);\n } else {\n label = t(label, label);\n }\n }\n return {\n label,\n value: e.const,\n };\n};\n\nexport interface OwnPropsOfRenderer {\n /**\n * The UI schema to be rendered.\n */\n uischema?: UISchemaElement;\n /**\n * The JSON schema that describes the data.\n */\n schema?: JsonSchema;\n /**\n * Whether the rendered element should be enabled.\n */\n enabled?: boolean;\n /**\n * Whether the rendered element should be visible.\n */\n visible?: boolean;\n\n /**\n * Optional instance path. Necessary when the actual data\n * path can not be inferred via the UI schema element as\n * it is the case with nested controls.\n */\n path?: string;\n\n renderers?: JsonFormsRendererRegistryEntry[];\n\n cells?: JsonFormsCellRendererRegistryEntry[];\n\n uischemas?: JsonFormsUISchemaRegistryEntry[];\n}\n\nexport interface OwnPropsOfControl extends OwnPropsOfRenderer {\n id?: string;\n // constraint type\n uischema?: ControlElement;\n}\n\nexport interface OwnPropsOfLabel extends OwnPropsOfRenderer {\n uischema?: LabelElement;\n}\n\nexport interface OwnPropsOfEnum {\n options?: EnumOption[];\n}\n\nexport interface OwnPropsOfLayout extends OwnPropsOfRenderer {\n direction?: 'row' | 'column';\n}\n\n/**\n * State-based props of a {@link Renderer}.\n */\nexport interface StatePropsOfRenderer {\n /**\n * Any configuration options for the element.\n */\n config?: any;\n\n /**\n * The UI schema to be rendered.\n */\n uischema: UISchemaElement;\n\n /**\n * The JSON schema that describes the data.\n */\n schema: JsonSchema;\n\n /**\n * The data to be rendered.\n */\n data?: any;\n\n /**\n * Whether the rendered element should be enabled.\n */\n enabled: boolean;\n /**\n * Whether the rendered element should be visible.\n */\n visible: boolean;\n\n /**\n * Instance path the data is written to, in case of a control.\n */\n path: string;\n\n /**\n * All available renderers.\n */\n renderers?: JsonFormsRendererRegistryEntry[];\n\n /**\n * All available cell renderers.\n */\n\n cells?: JsonFormsCellRendererRegistryEntry[];\n}\n\n/**\n * State-based properties for UI schema elements that have a scope.\n */\nexport interface StatePropsOfScopedRenderer extends StatePropsOfRenderer {\n // constraint type\n uischema: ControlElement;\n\n /**\n * Any validation errors that are caused by the data to be rendered.\n */\n errors: string;\n\n /**\n * The data to be rendered.\n */\n data: any;\n\n /**\n * The root schema as returned by the store.\n */\n rootSchema: JsonSchema;\n\n /**\n * A unique ID that should be used for rendering the scoped UI schema element.\n */\n id: string;\n}\n\n/**\n * Props of a {@link Renderer}.\n */\nexport interface RendererProps extends StatePropsOfRenderer {}\n\n/**\n * State-based props of a Control\n */\nexport interface StatePropsOfControl extends StatePropsOfScopedRenderer {\n cells?: { tester: RankedTester; cell: any }[];\n\n /**\n * The label for the rendered element.\n */\n label: string;\n\n /**\n * Description of input cell\n */\n description?: string;\n\n /**\n * Whether the rendered data is required.\n */\n required?: boolean;\n\n i18nKeyPrefix?: string;\n\n // TODO: renderers?\n}\n\n/**\n * Dispatch-based props of a Control.\n */\nexport interface DispatchPropsOfControl {\n /**\n * Update handler that emits a data change\n *\n * @param {string} path the path to the data to be updated\n * @param {any} value the new value that should be written to the given path\n */\n handleChange(path: string, value: any): void;\n}\n\n/**\n * Props of a Control.\n */\nexport interface ControlProps\n extends StatePropsOfControl,\n DispatchPropsOfControl {}\n\n/**\n * State props of a layout;\n */\nexport interface StatePropsOfLayout extends StatePropsOfRenderer {\n /**\n * Direction for the layout to flow\n */\n direction: 'row' | 'column';\n label?: string;\n}\n\nexport interface LayoutProps extends StatePropsOfLayout {}\n\n/**\n * The state of a control.\n */\nexport interface ControlState {\n /**\n * The current value.\n */\n value: any;\n\n /**\n * Whether the control is focused.\n */\n isFocused: boolean;\n}\n\n/**\n * Map state to control props.\n * @param state the store's state\n * @param ownProps any own props\n * @returns {StatePropsOfControl} state props for a control\n */\nexport const mapStateToControlProps = (\n state: JsonFormsState,\n ownProps: OwnPropsOfControl\n): StatePropsOfControl => {\n const { uischema } = ownProps;\n const rootData = getData(state);\n const path = composeWithUi(uischema, ownProps.path);\n const visible: boolean =\n ownProps.visible === undefined || hasShowRule(uischema)\n ? isVisible(uischema, rootData, ownProps.path, getAjv(state))\n : ownProps.visible;\n const controlElement = uischema as ControlElement;\n const id = ownProps.id;\n const rootSchema = getSchema(state);\n const config = getConfig(state);\n const required =\n controlElement.scope !== undefined &&\n !!(\n isRequired(ownProps.schema, controlElement.scope, rootSchema) ||\n // IMPORTANT: The config.allowDynamicCheck condition was removed here,\n // because this makes it more convenient to use in the author's specific\n // usecase. Do not commit this to the json-forms origin repo.\n isConditionallyRequired(\n rootSchema,\n dataPathToJsonPointer(path),\n rootData,\n path\n )\n );\n const resolvedSchema = Resolve.schema(\n ownProps.schema || rootSchema,\n controlElement.scope,\n rootSchema\n );\n const errors = getErrorAt(path, resolvedSchema)(state);\n\n const description =\n resolvedSchema !== undefined ? resolvedSchema.description : '';\n const data = Resolve.data(rootData, path);\n const labelDesc = createLabelDescriptionFrom(uischema, resolvedSchema);\n const label = labelDesc.show ? labelDesc.text : '';\n const enabled: boolean = isInherentlyEnabled(\n state,\n ownProps,\n uischema,\n resolvedSchema || rootSchema,\n rootData,\n config\n );\n\n const schema = resolvedSchema ?? rootSchema;\n const t = getTranslator()(state);\n const te = getErrorTranslator()(state);\n const i18nKeyPrefix = getI18nKeyPrefix(schema, uischema, path);\n const i18nLabel = t(getI18nKey(schema, uischema, path, 'label'), label, {\n schema,\n uischema,\n path,\n errors,\n });\n const i18nDescription = t(\n getI18nKey(schema, uischema, path, 'description'),\n description,\n { schema, uischema, path, errors }\n );\n const i18nErrorMessage = getCombinedErrorMessage(\n errors,\n te,\n t,\n schema,\n uischema,\n path\n );\n\n return {\n data,\n description: i18nDescription,\n errors: i18nErrorMessage,\n label: i18nLabel,\n visible,\n enabled,\n id,\n path,\n required,\n uischema,\n schema,\n config: getConfig(state),\n cells: ownProps.cells || state.jsonforms.cells,\n rootSchema,\n i18nKeyPrefix,\n };\n};\n\n/**\n *\n * Map dispatch to control props.\n *\n * @param dispatch the store's dispatch method\n * @returns {DispatchPropsOfControl} dispatch props for a control\n */\nexport const mapDispatchToControlProps = (\n dispatch: Dispatch\n): DispatchPropsOfControl => ({\n handleChange(path, value) {\n dispatch(update(path, () => value));\n },\n});\n\n/**\n * Default mapStateToCellProps for enum control. Options is used for populating dropdown list\n * @param state\n * @param ownProps\n * @returns {StatePropsOfControl & OwnPropsOfEnum}\n */\nexport const mapStateToEnumControlProps = (\n state: JsonFormsState,\n ownProps: OwnPropsOfControl & OwnPropsOfEnum\n): StatePropsOfControl & OwnPropsOfEnum => {\n const props: StatePropsOfControl = mapStateToControlProps(state, ownProps);\n const options: EnumOption[] =\n ownProps.options ||\n props.schema.enum?.map((e) =>\n enumToEnumOptionMapper(\n e,\n getTranslator()(state),\n getI18nKeyPrefix(props.schema, props.uischema, props.path)\n )\n ) ||\n (props.schema.const && [\n enumToEnumOptionMapper(\n props.schema.const,\n getTranslator()(state),\n getI18nKeyPrefix(props.schema, props.uischema, props.path)\n ),\n ]);\n return {\n ...props,\n options,\n };\n};\n\n/**\n * Default mapStateToCellProps for enum control based on oneOf. Options is used for populating dropdown list\n * @param state\n * @param ownProps\n * @returns {StatePropsOfControl & OwnPropsOfEnum}\n */\nexport const mapStateToOneOfEnumControlProps = (\n state: JsonFormsState,\n ownProps: OwnPropsOfControl & OwnPropsOfEnum\n): StatePropsOfControl & OwnPropsOfEnum => {\n const props: StatePropsOfControl = mapStateToControlProps(state, ownProps);\n const options: EnumOption[] =\n ownProps.options ||\n (props.schema.oneOf as JsonSchema[])?.map((oneOfSubSchema) =>\n oneOfToEnumOptionMapper(\n oneOfSubSchema,\n getTranslator()(state),\n getI18nKeyPrefix(props.schema, props.uischema, props.path)\n )\n );\n return {\n ...props,\n options,\n };\n};\n\n/**\n * Default mapStateToCellProps for multi enum control. Options is used for populating dropdown list\n * @param state\n * @param ownProps\n * @returns {StatePropsOfControl & OwnPropsOfEnum}\n */\nexport const mapStateToMultiEnumControlProps = (\n state: JsonFormsState,\n ownProps: OwnPropsOfControl & OwnPropsOfEnum\n): StatePropsOfControl & OwnPropsOfEnum => {\n const props: StatePropsOfControl = mapStateToControlProps(state, ownProps);\n let items = props.schema.items as JsonSchema;\n items =\n items && items.$ref\n ? resolveSchema(props.rootSchema, items.$ref, props.rootSchema)\n : items;\n const options: EnumOption[] =\n ownProps.options ||\n (items?.oneOf &&\n (items.oneOf as JsonSchema[]).map((oneOfSubSchema) =>\n oneOfToEnumOptionMapper(\n oneOfSubSchema,\n state.jsonforms.i18n?.translate,\n getI18nKeyPrefix(props.schema, props.uischema, props.path)\n )\n )) ||\n items?.enum?.map((e) =>\n enumToEnumOptionMapper(\n e,\n state.jsonforms.i18n?.translate,\n getI18nKeyPrefix(props.schema, props.uischema, props.path)\n )\n );\n return {\n ...props,\n options,\n };\n};\n\n/**\n * Map state to control props.\n * @param state the store's state\n * @param ownProps any own props\n * @returns {StatePropsOfControl} state props for a control\n */\nexport const mapStateToMasterListItemProps = (\n state: JsonFormsState,\n ownProps: OwnPropsOfMasterListItem\n): StatePropsOfMasterItem => {\n const { schema, path, index } = ownProps;\n const firstPrimitiveProp = schema.properties\n ? find(Object.keys(schema.properties), (propName) => {\n const prop = schema.properties[propName];\n return (\n prop.type === 'string' ||\n prop.type === 'number' ||\n prop.type === 'integer'\n );\n })\n : undefined;\n const childPath = composePaths(path, `${index}`);\n const childData = Resolve.data(getData(state), childPath);\n const childLabel = firstPrimitiveProp ? childData[firstPrimitiveProp] : '';\n\n return {\n ...ownProps,\n childLabel,\n };\n};\n\n/**\n * State-based props of a table control.\n */\nexport interface StatePropsOfControlWithDetail extends StatePropsOfControl {\n uischemas?: JsonFormsUISchemaRegistryEntry[];\n renderers?: JsonFormsRendererRegistryEntry[];\n cells?: JsonFormsCellRendererRegistryEntry[];\n}\n\nexport interface OwnPropsOfMasterListItem {\n index: number;\n selected: boolean;\n path: string;\n enabled: boolean;\n schema: JsonSchema;\n handleSelect(index: number): () => void;\n removeItem(path: string, value: number): () => void;\n translations: ArrayTranslations;\n}\n\nexport interface StatePropsOfMasterItem extends OwnPropsOfMasterListItem {\n childLabel: string;\n}\n\n/**\n * Map state to control with detail props\n *\n * @param state the store's state\n * @param ownProps any element's own props\n * @returns {StatePropsOfArrayControl} state props for a table control\n */\nexport const mapStateToControlWithDetailProps = (\n state: JsonFormsState,\n ownProps: OwnPropsOfControl\n): StatePropsOfControlWithDetail => {\n const { ...props } = mapStateToControlProps(state, ownProps);\n\n return {\n ...props,\n uischemas: state.jsonforms.uischemas,\n };\n};\n\nexport interface ControlWithDetailProps\n extends StatePropsOfControlWithDetail,\n DispatchPropsOfControl {}\n\n/**\n * State-based props of a table control.\n */\nexport interface StatePropsOfArrayControl\n extends StatePropsOfControlWithDetail {\n translations: ArrayTranslations;\n childErrors?: ErrorObject[];\n}\n\n/**\n * Map state to table props\n *\n * @param state the store's state\n * @param ownProps any element's own props\n * @returns {StatePropsOfArrayControl} state props for a table control\n */\nexport const mapStateToArrayControlProps = (\n state: JsonFormsState,\n ownProps: OwnPropsOfControl\n): StatePropsOfArrayControl => {\n const { path, schema, uischema, i18nKeyPrefix, label, ...props } =\n mapStateToControlWithDetailProps(state, ownProps);\n\n const resolvedSchema = Resolve.schema(schema, 'items', props.rootSchema);\n const childErrors = getSubErrorsAt(path, resolvedSchema)(state);\n const t = getTranslator()(state);\n\n return {\n ...props,\n label,\n path,\n uischema,\n schema: resolvedSchema,\n childErrors,\n renderers: ownProps.renderers || getRenderers(state),\n cells: ownProps.cells || getCells(state),\n translations: getArrayTranslations(\n t,\n arrayDefaultTranslations,\n i18nKeyPrefix,\n label\n ),\n };\n};\n\n/**\n * Dispatch props of a table control\n */\nexport interface DispatchPropsOfArrayControl {\n addItem(path: string, value: any): () => void;\n removeItems?(path: string, toDelete: number[]): () => void;\n moveUp?(path: string, toMove: number): () => void;\n moveDown?(path: string, toMove: number): () => void;\n}\n\n/**\n * Maps state to dispatch properties of an array control.\n *\n * @param dispatch the store's dispatch method\n * @returns {DispatchPropsOfArrayControl} dispatch props of an array control\n */\nexport const mapDispatchToArrayControlProps = (\n dispatch: Dispatch\n): DispatchPropsOfArrayControl => ({\n addItem: (path: string, value: any) => () => {\n dispatch(\n update(path, (array) => {\n if (array === undefined || array === null) {\n return [value];\n }\n\n array.push(value);\n return array;\n })\n );\n },\n removeItems: (path: string, toDelete: number[]) => () => {\n dispatch(\n update(path, (array) => {\n toDelete\n .sort((a, b) => a - b)\n .reverse()\n .forEach((s) => array.splice(s, 1));\n return array;\n })\n );\n },\n moveUp: (path, toMove: number) => () => {\n dispatch(\n update(path, (array) => {\n moveUp(array, toMove);\n return array;\n })\n );\n },\n moveDown: (path, toMove: number) => () => {\n dispatch(\n update(path, (array) => {\n moveDown(array, toMove);\n return array;\n })\n );\n },\n});\n\nexport interface DispatchPropsOfMultiEnumControl {\n addItem: (path: string, value: any) => void;\n removeItem?: (path: string, toDelete: any) => void;\n}\n\nexport const mapDispatchToMultiEnumProps = (\n dispatch: Dispatch\n): DispatchPropsOfMultiEnumControl => ({\n addItem: (path: string, value: any) => {\n dispatch(\n update(path, (data) => {\n if (data === undefined || data === null) {\n return [value];\n }\n data.push(value);\n return data;\n })\n );\n },\n removeItem: (path: string, toDelete: any) => {\n dispatch(\n update(path, (data) => {\n const indexInData = data.indexOf(toDelete);\n data.splice(indexInData, 1);\n return data;\n })\n );\n },\n});\n\n/**\n * Props of an array control.\n */\nexport interface ArrayControlProps\n extends StatePropsOfArrayControl,\n DispatchPropsOfArrayControl {}\n\nexport const layoutDefaultProps: {\n visible: boolean;\n enabled: boolean;\n path: string;\n direction: 'row' | 'column';\n} = {\n visible: true,\n enabled: true,\n path: '',\n direction: 'column',\n};\n\nconst getDirection = (uischema: UISchemaElement) => {\n if (uischema.type === 'HorizontalLayout') {\n return 'row';\n }\n if (uischema.type === 'VerticalLayout') {\n return 'column';\n }\n return layoutDefaultProps.direction;\n};\n\n/**\n * Map state to layout props.\n * @param state JSONForms state tree\n * @param ownProps any own props\n * @returns {StatePropsOfLayout}\n */\nexport const mapStateToLayoutProps = (\n state: JsonFormsState,\n ownProps: OwnPropsOfLayout\n): LayoutProps => {\n const rootData = getData(state);\n const { uischema } = ownProps;\n const visible: boolean =\n ownProps.visible === undefined || hasShowRule(uischema)\n ? isVisible(ownProps.uischema, rootData, ownProps.path, getAjv(state))\n : ownProps.visible;\n\n const data = Resolve.data(rootData, ownProps.path);\n const config = getConfig(state);\n const enabled: boolean = isInherentlyEnabled(\n state,\n ownProps,\n uischema,\n undefined, // layouts have no associated schema\n rootData,\n config\n );\n\n // some layouts have labels which might need to be translated\n const t = getTranslator()(state);\n const label = isLabelable(uischema)\n ? deriveLabelForUISchemaElement(uischema, t)\n : undefined;\n\n return {\n ...layoutDefaultProps,\n renderers: ownProps.renderers || getRenderers(state),\n cells: ownProps.cells || getCells(state),\n visible,\n enabled,\n path: ownProps.path,\n data,\n uischema: ownProps.uischema,\n schema: ownProps.schema,\n direction: ownProps.direction ?? getDirection(uischema),\n config,\n label,\n };\n};\n\nexport type RefResolver = (schema: JsonSchema) => Promise;\n\nexport interface OwnPropsOfJsonFormsRenderer extends OwnPropsOfRenderer {}\n\nexport interface StatePropsOfJsonFormsRenderer\n extends OwnPropsOfJsonFormsRenderer {\n rootSchema: JsonSchema;\n config: any;\n}\n\nexport interface JsonFormsProps extends StatePropsOfJsonFormsRenderer {}\n\nexport const mapStateToJsonFormsRendererProps = (\n state: JsonFormsState,\n ownProps: OwnPropsOfJsonFormsRenderer\n): StatePropsOfJsonFormsRenderer => {\n return {\n renderers: ownProps.renderers || get(state.jsonforms, 'renderers'),\n cells: ownProps.cells || get(state.jsonforms, 'cells'),\n schema: ownProps.schema || getSchema(state),\n rootSchema: getSchema(state),\n uischema: ownProps.uischema || getUiSchema(state),\n path: ownProps.path,\n enabled: ownProps.enabled,\n config: getConfig(state),\n };\n};\n\nexport const controlDefaultProps = {\n ...layoutDefaultProps,\n errors: [] as string[],\n};\n\nexport interface StatePropsOfCombinator extends StatePropsOfControl {\n rootSchema: JsonSchema;\n path: string;\n id: string;\n indexOfFittingSchema: number;\n uischemas: JsonFormsUISchemaRegistryEntry[];\n data: any;\n translations: CombinatorTranslations;\n}\n\nexport const mapStateToCombinatorRendererProps = (\n state: JsonFormsState,\n ownProps: OwnPropsOfControl,\n keyword: CombinatorKeyword\n): StatePropsOfCombinator => {\n const { data, schema, rootSchema, i18nKeyPrefix, label, ...props } =\n mapStateToControlProps(state, ownProps);\n\n const ajv = state.jsonforms.core.ajv;\n const t = getTranslator()(state);\n const translations = getCombinatorTranslations(\n t,\n combinatorDefaultTranslations,\n i18nKeyPrefix,\n label\n );\n const structuralKeywords = [\n 'required',\n 'additionalProperties',\n 'type',\n 'enum',\n 'const',\n ];\n const dataIsValid = (errors: ErrorObject[]): boolean => {\n return (\n !errors ||\n errors.length === 0 ||\n !errors.find((e) => structuralKeywords.indexOf(e.keyword) !== -1)\n );\n };\n let indexOfFittingSchema: number;\n // TODO instead of compiling the combinator subschemas we can compile the original schema\n // without the combinator alternatives and then revalidate and check the errors for the\n // element\n for (let i = 0; i < schema[keyword]?.length; i++) {\n try {\n let _schema = schema[keyword][i];\n if (_schema.$ref) {\n _schema = Resolve.schema(rootSchema, _schema.$ref, rootSchema);\n }\n const valFn = ajv.compile(_schema);\n valFn(data);\n if (dataIsValid(valFn.errors)) {\n indexOfFittingSchema = i;\n break;\n }\n } catch (error) {\n console.debug(\n \"Combinator subschema is not self contained, can't hand it over to AJV\"\n );\n }\n }\n\n return {\n data,\n schema,\n rootSchema,\n ...props,\n i18nKeyPrefix,\n label,\n indexOfFittingSchema,\n uischemas: getUISchemas(state),\n translations,\n };\n};\n\nexport interface CombinatorRendererProps\n extends StatePropsOfCombinator,\n DispatchPropsOfControl {}\n/**\n * Map state to all of renderer props.\n * @param state the store's state\n * @param ownProps any own props\n * @returns {StatePropsOfCombinator} state props for a combinator\n */\nexport const mapStateToAllOfProps = (\n state: JsonFormsState,\n ownProps: OwnPropsOfControl\n): StatePropsOfCombinator =>\n mapStateToCombinatorRendererProps(state, ownProps, 'allOf');\n\nexport const mapStateToAnyOfProps = (\n state: JsonFormsState,\n ownProps: OwnPropsOfControl\n): StatePropsOfCombinator => {\n return mapStateToCombinatorRendererProps(state, ownProps, 'anyOf');\n};\n\nexport const mapStateToOneOfProps = (\n state: JsonFormsState,\n ownProps: OwnPropsOfControl\n): StatePropsOfCombinator => {\n return mapStateToCombinatorRendererProps(state, ownProps, 'oneOf');\n};\n\nexport interface StatePropsOfArrayLayout extends StatePropsOfControlWithDetail {\n data: number;\n translations: ArrayTranslations;\n minItems?: number;\n}\n/**\n * Map state to table props\n *\n * @param state the store's state\n * @param ownProps any element's own props\n * @returns {StatePropsOfArrayControl} state props for a table control\n */\nexport const mapStateToArrayLayoutProps = (\n state: JsonFormsState,\n ownProps: OwnPropsOfControl\n): StatePropsOfArrayLayout => {\n const { path, schema, uischema, errors, i18nKeyPrefix, label, ...props } =\n mapStateToControlWithDetailProps(state, ownProps);\n\n const resolvedSchema = Resolve.schema(schema, 'items', props.rootSchema);\n const t = getTranslator()(state);\n // TODO Does not consider 'i18n' keys which are specified in the ui schemas of the sub errors\n const childErrors = getCombinedErrorMessage(\n getSubErrorsAt(path, resolvedSchema)(state),\n getErrorTranslator()(state),\n t,\n undefined,\n undefined,\n undefined\n );\n\n const allErrors =\n errors +\n (errors.length > 0 && childErrors.length > 0 ? '\\n' : '') +\n childErrors;\n return {\n ...props,\n label,\n path,\n uischema,\n schema: resolvedSchema,\n data: props.data ? props.data.length : 0,\n errors: allErrors,\n minItems: schema.minItems,\n translations: getArrayTranslations(\n t,\n arrayDefaultTranslations,\n i18nKeyPrefix,\n label\n ),\n };\n};\n\n/**\n * Props of an array control.\n */\nexport interface ArrayLayoutProps\n extends StatePropsOfArrayLayout,\n DispatchPropsOfArrayControl {}\n\nexport interface StatePropsOfLabel extends StatePropsOfRenderer {\n text?: string;\n}\nexport interface LabelProps extends StatePropsOfLabel {}\n\nexport const mapStateToLabelProps = (\n state: JsonFormsState,\n props: OwnPropsOfLabel\n) => {\n const { uischema } = props;\n\n const visible: boolean =\n props.visible === undefined || hasShowRule(uischema)\n ? isVisible(props.uischema, getData(state), props.path, getAjv(state))\n : props.visible;\n\n const text = uischema.text;\n const t = getTranslator()(state);\n const i18nKeyPrefix = getI18nKeyPrefixBySchema(undefined, uischema);\n const i18nKey = i18nKeyPrefix ? `${i18nKeyPrefix}.text` : text ?? '';\n const i18nText = t(i18nKey, text, { uischema });\n\n return {\n text: i18nText,\n visible,\n config: getConfig(state),\n renderers: props.renderers || getRenderers(state),\n cells: props.cells || getCells(state),\n };\n};\n","/*\n The MIT License\n\n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport isEmpty from 'lodash/isEmpty';\nimport {\n getErrorTranslator,\n getAjv,\n getConfig,\n getData,\n getErrorAt,\n getSchema,\n getTranslator,\n} from '../reducers';\nimport type { JsonFormsCellRendererRegistryEntry } from '../reducers';\nimport type { AnyAction, Dispatch } from './type';\nimport { Resolve } from './util';\nimport { isInherentlyEnabled, isVisible } from './runtime';\nimport {\n DispatchPropsOfControl,\n EnumOption,\n enumToEnumOptionMapper,\n mapDispatchToControlProps,\n oneOfToEnumOptionMapper,\n OwnPropsOfControl,\n OwnPropsOfEnum,\n StatePropsOfScopedRenderer,\n} from './renderer';\nimport { getCombinedErrorMessage, getI18nKeyPrefix } from '../i18n';\nimport type { JsonFormsState } from '../store';\nimport type { JsonSchema } from '../models';\n\nexport interface OwnPropsOfCell extends OwnPropsOfControl {\n data?: any;\n}\n\n/**\n * State props of a cell.\n */\nexport interface StatePropsOfCell extends StatePropsOfScopedRenderer {\n isValid: boolean;\n rootSchema: JsonSchema;\n}\n\nexport interface OwnPropsOfEnumCell extends OwnPropsOfCell, OwnPropsOfEnum {}\n\n/**\n * State props of a cell for enum cell\n */\nexport interface StatePropsOfEnumCell\n extends StatePropsOfCell,\n OwnPropsOfEnum {}\n\n/**\n * Props of an enum cell.\n */\nexport interface EnumCellProps\n extends StatePropsOfEnumCell,\n DispatchPropsOfControl {}\n\nexport type DispatchPropsOfCell = DispatchPropsOfControl;\n\n/**\n * Props of a cell.\n */\nexport interface CellProps extends StatePropsOfCell, DispatchPropsOfCell {}\n/**\n * Registers the given cell renderer when a JSON Forms store is created.\n * @param {RankedTester} tester\n * @param cell the cell to be registered\n * @returns {any}\n */\nexport interface DispatchCellStateProps extends StatePropsOfCell {\n cells?: JsonFormsCellRendererRegistryEntry[];\n}\n\n/**\n * Map state to cell props.\n *\n * @param state JSONForms state tree\n * @param ownProps any own props\n * @returns {StatePropsOfCell} state props of a cell\n */\nexport const mapStateToCellProps = (\n state: JsonFormsState,\n ownProps: OwnPropsOfCell\n): StatePropsOfCell => {\n const { id, schema, path, uischema, renderers, cells } = ownProps;\n const rootData = getData(state);\n const visible =\n ownProps.visible !== undefined\n ? ownProps.visible\n : isVisible(uischema, rootData, undefined, getAjv(state));\n\n const rootSchema = getSchema(state);\n const config = getConfig(state);\n\n /* When determining the enabled state of cells we take a shortcut: At the\n * moment it's only possible to configure enablement and disablement at the\n * control level. Therefore the renderer using the cell, for example a\n * table renderer, determines whether a cell is enabled and should hand\n * over the prop themselves. If that prop was given, we prefer it over\n * anything else to save evaluation effort (except for the global readonly\n * flag). For example it would be quite expensive to evaluate the same ui schema\n * rule again and again for each cell of a table. */\n let enabled;\n if (state.jsonforms.readonly === true) {\n enabled = false;\n } else if (typeof ownProps.enabled === 'boolean') {\n enabled = ownProps.enabled;\n } else {\n enabled = isInherentlyEnabled(\n state,\n ownProps,\n uischema,\n schema || rootSchema,\n rootData,\n config\n );\n }\n\n const t = getTranslator()(state);\n const te = getErrorTranslator()(state);\n const errors = getCombinedErrorMessage(\n getErrorAt(path, schema)(state),\n te,\n t,\n schema,\n uischema,\n path\n );\n const isValid = isEmpty(errors);\n\n return {\n data: Resolve.data(rootData, path),\n visible,\n enabled,\n id,\n path,\n errors,\n isValid,\n schema,\n uischema,\n config: getConfig(state),\n rootSchema,\n renderers,\n cells,\n };\n};\n\nexport const mapStateToDispatchCellProps = (\n state: JsonFormsState,\n ownProps: OwnPropsOfCell\n): DispatchCellStateProps => {\n const props: StatePropsOfCell = mapStateToCellProps(state, ownProps);\n const { renderers: _renderers, cells, ...otherOwnProps } = ownProps;\n return {\n ...props,\n ...otherOwnProps,\n cells: cells || state.jsonforms.cells || [],\n };\n};\n\nexport interface DispatchCellProps extends DispatchCellStateProps {}\n\n/**\n * Default mapStateToCellProps for enum cell. Options is used for populating dropdown list\n * @param state\n * @param ownProps\n * @returns {StatePropsOfEnumCell}\n */\nexport const defaultMapStateToEnumCellProps = (\n state: JsonFormsState,\n ownProps: OwnPropsOfEnumCell\n): StatePropsOfEnumCell => {\n const props: StatePropsOfCell = mapStateToCellProps(state, ownProps);\n const options: EnumOption[] =\n ownProps.options ||\n props.schema.enum?.map((e) =>\n enumToEnumOptionMapper(\n e,\n getTranslator()(state),\n getI18nKeyPrefix(props.schema, props.uischema, props.path)\n )\n ) ||\n (props.schema.const && [\n enumToEnumOptionMapper(\n props.schema.const,\n getTranslator()(state),\n getI18nKeyPrefix(props.schema, props.uischema, props.path)\n ),\n ]);\n return {\n ...props,\n options,\n };\n};\n\n/**\n * mapStateToOneOfEnumCellProps for one of enum cell. Options is used for populating dropdown list from oneOf\n * @param state\n * @param ownProps\n * @returns {StatePropsOfEnumCell}\n */\nexport const mapStateToOneOfEnumCellProps = (\n state: JsonFormsState,\n ownProps: OwnPropsOfEnumCell\n): StatePropsOfEnumCell => {\n const props: StatePropsOfCell = mapStateToCellProps(state, ownProps);\n const options: EnumOption[] =\n ownProps.options ||\n (props.schema.oneOf as JsonSchema[])?.map((oneOfSubSchema) =>\n oneOfToEnumOptionMapper(\n oneOfSubSchema,\n getTranslator()(state),\n getI18nKeyPrefix(props.schema, props.uischema, props.path)\n )\n );\n return {\n ...props,\n options,\n };\n};\n\n/**\n * Synonym for mapDispatchToControlProps.\n *\n * @type {(dispatch) => {handleChange(path, value): void}}\n */\nexport const mapDispatchToCellProps: (\n dispatch: Dispatch\n) => DispatchPropsOfControl = mapDispatchToControlProps;\n\n/**\n * Default dispatch to control props which can be customized to set handleChange action\n *\n */\nexport const defaultMapDispatchToControlProps =\n // TODO: ownProps types\n (dispatch: Dispatch, ownProps: any): DispatchPropsOfControl => {\n const { handleChange } = mapDispatchToCellProps(dispatch);\n\n return {\n handleChange: ownProps.handleChange || handleChange,\n };\n };\n","/*\n The MIT License\n \n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport type { ControlElement, JsonSchema, UISchemaElement } from '../models';\nimport { findUISchema, JsonFormsUISchemaRegistryEntry } from '../reducers';\nimport { Resolve } from './util';\n\nexport interface CombinatorSubSchemaRenderInfo {\n schema: JsonSchema;\n uischema: UISchemaElement;\n label: string;\n}\n\nexport type CombinatorKeyword = 'anyOf' | 'oneOf' | 'allOf';\n\nexport const createCombinatorRenderInfos = (\n combinatorSubSchemas: JsonSchema[],\n rootSchema: JsonSchema,\n keyword: CombinatorKeyword,\n control: ControlElement,\n path: string,\n uischemas: JsonFormsUISchemaRegistryEntry[]\n): CombinatorSubSchemaRenderInfo[] =>\n combinatorSubSchemas.map((subSchema, subSchemaIndex) => {\n const resolvedSubSchema =\n subSchema.$ref && Resolve.schema(rootSchema, subSchema.$ref, rootSchema);\n\n const schema = resolvedSubSchema ?? subSchema;\n\n return {\n schema,\n uischema: findUISchema(\n uischemas,\n schema,\n control.scope,\n path,\n undefined,\n control,\n rootSchema\n ),\n label:\n subSchema.title ??\n resolvedSubSchema?.title ??\n `${keyword}-${subSchemaIndex}`,\n };\n });\n","/*\n The MIT License\n \n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nconst usedIds: Set = new Set();\n\nconst makeId = (idBase: string, iteration: number) =>\n iteration <= 1 ? idBase : idBase + iteration.toString();\n\nconst isUniqueId = (idBase: string, iteration: number) => {\n const newID = makeId(idBase, iteration);\n return !usedIds.has(newID);\n};\n\nexport const createId = (proposedId: string) => {\n if (proposedId === undefined) {\n // failsafe to avoid endless loops in error cases\n proposedId = 'undefined';\n }\n let tries = 0;\n while (!isUniqueId(proposedId, tries)) {\n tries++;\n }\n const newID = makeId(proposedId, tries);\n usedIds.add(newID);\n return newID;\n};\n\nexport const removeId = (id: string) => usedIds.delete(id);\n\nexport const clearAllIds = () => usedIds.clear();\n","/*\n The MIT License\n\n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport find from 'lodash/find';\nimport { JsonSchema } from '../models';\n\nexport const getFirstPrimitiveProp = (schema: any) => {\n if (schema.properties) {\n return find(Object.keys(schema.properties), (propName) => {\n const prop = schema.properties[propName];\n return (\n prop.type === 'string' ||\n prop.type === 'number' ||\n prop.type === 'integer'\n );\n });\n }\n return undefined;\n};\n\n/**\n * Tests whether the schema has an enum based on oneOf.\n */\nexport const isOneOfEnumSchema = (schema: JsonSchema) =>\n !!schema &&\n Object.prototype.hasOwnProperty.call(schema, 'oneOf') &&\n schema.oneOf &&\n (schema.oneOf as JsonSchema[]).every((s) => s.const !== undefined);\n","/*\n The MIT License\n\n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport isEmpty from 'lodash/isEmpty';\nimport { isLayout, UISchemaElement } from '../models';\n\nexport type IterateCallback = (uischema: UISchemaElement) => void;\n\nconst setReadonlyPropertyValue =\n (value: boolean): IterateCallback =>\n (child: UISchemaElement): void => {\n if (!child.options) {\n child.options = {};\n }\n child.options.readonly = value;\n };\nexport const setReadonly = (uischema: UISchemaElement): void => {\n iterateSchema(uischema, setReadonlyPropertyValue(true));\n};\nexport const unsetReadonly = (uischema: UISchemaElement): void => {\n iterateSchema(uischema, setReadonlyPropertyValue(false));\n};\nexport const iterateSchema = (\n uischema: UISchemaElement,\n toApply: IterateCallback\n): void => {\n if (isEmpty(uischema)) {\n return;\n }\n if (isLayout(uischema)) {\n uischema.elements.forEach((child) => iterateSchema(child, toApply));\n return;\n }\n toApply(uischema);\n};\n","/*\n The MIT License\n \n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\nimport Ajv from 'ajv';\nimport addFormats from 'ajv-formats';\nimport type { Options } from 'ajv';\n\nexport const createAjv = (options?: Options) => {\n const ajv = new Ajv({\n allErrors: true,\n verbose: true,\n strict: false,\n addUsedSchema: false,\n ...options,\n });\n addFormats(ajv);\n return ajv;\n};\n","/*\n The MIT License\n \n Copyright (c) 2023-2023 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nexport const defaultDateFormat = 'YYYY-MM-DD';\nexport const defaultTimeFormat = 'HH:mm:ss';\nexport const defaultDateTimeFormat = 'YYYY-MM-DDTHH:mm:ss.sssZ';\n","/*\n The MIT License\n\n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport isEmpty from 'lodash/isEmpty';\nimport startCase from 'lodash/startCase';\nimport keys from 'lodash/keys';\nimport {\n ControlElement,\n isGroup,\n isLayout,\n JsonSchema,\n LabelElement,\n Layout,\n UISchemaElement,\n} from '../models';\nimport { deriveTypes, encode, resolveSchema } from '../util';\n\n/**\n * Creates a new ILayout.\n * @param layoutType The type of the laoyut\n * @returns the new ILayout\n */\nconst createLayout = (layoutType: string): Layout => ({\n type: layoutType,\n elements: [],\n});\n\n/**\n * Creates a IControlObject with the given label referencing the given ref\n */\nexport const createControlElement = (ref: string): ControlElement => ({\n type: 'Control',\n scope: ref,\n});\n\n/**\n * Wraps the given {@code uiSchema} in a Layout if there is none already.\n * @param uischema The ui schema to wrap in a layout.\n * @param layoutType The type of the layout to create.\n * @returns the wrapped uiSchema.\n */\nconst wrapInLayoutIfNecessary = (\n uischema: UISchemaElement,\n layoutType: string\n): Layout => {\n if (!isEmpty(uischema) && !isLayout(uischema)) {\n const verticalLayout: Layout = createLayout(layoutType);\n verticalLayout.elements.push(uischema);\n\n return verticalLayout;\n }\n\n return uischema as Layout;\n};\n\n/**\n * Adds the given {@code labelName} to the {@code layout} if it exists\n * @param layout\n * The layout which is to receive the label\n * @param labelName\n * The name of the schema\n */\nconst addLabel = (layout: Layout, labelName: string) => {\n if (!isEmpty(labelName)) {\n const fixedLabel = startCase(labelName);\n if (isGroup(layout)) {\n layout.label = fixedLabel;\n } else {\n // add label with name\n const label: LabelElement = {\n type: 'Label',\n text: fixedLabel,\n };\n layout.elements.push(label);\n }\n }\n};\n\n/**\n * Returns whether the given {@code jsonSchema} is a combinator ({@code oneOf}, {@code anyOf}, {@code allOf}) at the root level\n * @param jsonSchema\n * the schema to check\n */\nconst isCombinator = (jsonSchema: JsonSchema): boolean => {\n return (\n !isEmpty(jsonSchema) &&\n (!isEmpty(jsonSchema.oneOf) ||\n !isEmpty(jsonSchema.anyOf) ||\n !isEmpty(jsonSchema.allOf))\n );\n};\n\nconst generateUISchema = (\n jsonSchema: JsonSchema,\n schemaElements: UISchemaElement[],\n currentRef: string,\n schemaName: string,\n layoutType: string,\n rootSchema?: JsonSchema\n): UISchemaElement => {\n if (!isEmpty(jsonSchema) && jsonSchema.$ref !== undefined) {\n return generateUISchema(\n resolveSchema(rootSchema, jsonSchema.$ref, rootSchema),\n schemaElements,\n currentRef,\n schemaName,\n layoutType,\n rootSchema\n );\n }\n\n if (isCombinator(jsonSchema)) {\n const controlObject: ControlElement = createControlElement(currentRef);\n schemaElements.push(controlObject);\n\n return controlObject;\n }\n\n const types = deriveTypes(jsonSchema);\n if (types.length === 0) {\n return null;\n }\n\n if (types.length > 1) {\n const controlObject: ControlElement = createControlElement(currentRef);\n schemaElements.push(controlObject);\n return controlObject;\n }\n\n if (currentRef === '#' && types[0] === 'object') {\n const layout: Layout = createLayout(layoutType);\n schemaElements.push(layout);\n\n if (jsonSchema.properties && keys(jsonSchema.properties).length > 1) {\n addLabel(layout, schemaName);\n }\n\n if (!isEmpty(jsonSchema.properties)) {\n // traverse properties\n const nextRef: string = currentRef + '/properties';\n Object.keys(jsonSchema.properties).map((propName) => {\n let value = jsonSchema.properties[propName];\n const ref = `${nextRef}/${encode(propName)}`;\n if (value.$ref !== undefined) {\n value = resolveSchema(rootSchema, value.$ref, rootSchema);\n }\n generateUISchema(\n value,\n layout.elements,\n ref,\n propName,\n layoutType,\n rootSchema\n );\n });\n }\n\n return layout;\n }\n\n switch (types[0]) {\n case 'object': // object items will be handled by the object control itself\n /* falls through */\n case 'array': // array items will be handled by the array control itself\n /* falls through */\n case 'string':\n /* falls through */\n case 'number':\n /* falls through */\n case 'integer':\n /* falls through */\n case 'null':\n /* falls through */\n case 'boolean': {\n const controlObject: ControlElement = createControlElement(currentRef);\n schemaElements.push(controlObject);\n\n return controlObject;\n }\n default:\n throw new Error('Unknown type: ' + JSON.stringify(jsonSchema));\n }\n};\n\n/**\n * Generate a default UI schema.\n * @param {JsonSchema} jsonSchema the JSON schema to generated a UI schema for\n * @param {string} layoutType the desired layout type for the root layout\n * of the generated UI schema\n */\nexport const generateDefaultUISchema = (\n jsonSchema: JsonSchema,\n layoutType = 'VerticalLayout',\n prefix = '#',\n rootSchema = jsonSchema\n): UISchemaElement =>\n wrapInLayoutIfNecessary(\n generateUISchema(jsonSchema, [], prefix, '', layoutType, rootSchema),\n layoutType\n );\n","/*\n The MIT License\n \n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport { generateJsonSchema } from './schema';\nimport { createControlElement, generateDefaultUISchema } from './uischema';\nimport type { ControlElement, JsonSchema, UISchemaElement } from '../';\n\nexport const Generate: {\n // TODO fix @typescript-eslint/ban-types\n // eslint-disable-next-line @typescript-eslint/ban-types\n jsonSchema(instance: Object, options?: any): JsonSchema;\n uiSchema(\n jsonSchema: JsonSchema,\n layoutType?: string,\n prefix?: string,\n rootSchema?: JsonSchema\n ): UISchemaElement;\n controlElement(ref: string): ControlElement;\n} = {\n jsonSchema: generateJsonSchema,\n uiSchema: generateDefaultUISchema,\n controlElement: createControlElement,\n};\n","/*\n The MIT License\n \n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport type AJV from 'ajv';\nimport type { ErrorObject } from 'ajv';\nimport type { JsonSchema, UISchemaElement } from '../models';\nimport { generateDefaultUISchema, generateJsonSchema } from '../generators';\n\nimport type { RankedTester } from '../testers';\nimport type { UISchemaTester, ValidationMode } from '../reducers';\nimport type { ErrorTranslator, Translator } from '../i18n';\n\nexport const INIT = 'jsonforms/INIT' as const;\nexport const UPDATE_CORE = 'jsonforms/UPDATE_CORE' as const;\nexport const SET_AJV = 'jsonforms/SET_AJV' as const;\nexport const UPDATE_DATA = 'jsonforms/UPDATE' as const;\nexport const UPDATE_ERRORS = 'jsonforms/UPDATE_ERRORS' as const;\nexport const VALIDATE = 'jsonforms/VALIDATE' as const;\nexport const ADD_RENDERER = 'jsonforms/ADD_RENDERER' as const;\nexport const REMOVE_RENDERER = 'jsonforms/REMOVE_RENDERER' as const;\nexport const ADD_CELL = 'jsonforms/ADD_CELL' as const;\nexport const REMOVE_CELL = 'jsonforms/REMOVE_CELL' as const;\nexport const SET_CONFIG = 'jsonforms/SET_CONFIG' as const;\nexport const ADD_UI_SCHEMA = 'jsonforms/ADD_UI_SCHEMA' as const;\nexport const REMOVE_UI_SCHEMA = 'jsonforms/REMOVE_UI_SCHEMA' as const;\nexport const SET_SCHEMA = 'jsonforms/SET_SCHEMA' as const;\nexport const SET_UISCHEMA = 'jsonforms/SET_UISCHEMA' as const;\nexport const SET_VALIDATION_MODE = 'jsonforms/SET_VALIDATION_MODE' as const;\n\nexport const SET_LOCALE = 'jsonforms/SET_LOCALE' as const;\nexport const SET_TRANSLATOR = 'jsonforms/SET_TRANSLATOR' as const;\nexport const UPDATE_I18N = 'jsonforms/UPDATE_I18N' as const;\n\nexport const ADD_DEFAULT_DATA = 'jsonforms/ADD_DEFAULT_DATA' as const;\nexport const REMOVE_DEFAULT_DATA = 'jsonforms/REMOVE_DEFAULT_DATA' as const;\n\nexport type CoreActions =\n | InitAction\n | UpdateCoreAction\n | UpdateAction\n | UpdateErrorsAction\n | SetAjvAction\n | SetSchemaAction\n | SetUISchemaAction\n | SetValidationModeAction;\n\nexport interface UpdateAction {\n type: 'jsonforms/UPDATE';\n path: string;\n updater(existingData?: any): any;\n}\n\nexport interface UpdateErrorsAction {\n type: 'jsonforms/UPDATE_ERRORS';\n errors: ErrorObject[];\n}\n\nexport interface InitAction {\n type: 'jsonforms/INIT';\n data: any;\n schema: JsonSchema;\n uischema: UISchemaElement;\n options?: InitActionOptions | AJV;\n}\n\nexport interface UpdateCoreAction {\n type: 'jsonforms/UPDATE_CORE';\n data?: any;\n schema?: JsonSchema;\n uischema?: UISchemaElement;\n options?: InitActionOptions | AJV;\n}\n\nexport interface InitActionOptions {\n ajv?: AJV;\n validationMode?: ValidationMode;\n additionalErrors?: ErrorObject[];\n}\n\nexport interface SetValidationModeAction {\n type: 'jsonforms/SET_VALIDATION_MODE';\n validationMode: ValidationMode;\n}\n\nexport const init = (\n data: any,\n schema: JsonSchema = generateJsonSchema(data),\n uischema?: UISchemaElement,\n options?: InitActionOptions | AJV\n) => ({\n type: INIT,\n data,\n schema,\n uischema:\n typeof uischema === 'object' ? uischema : generateDefaultUISchema(schema),\n options,\n});\n\nexport const updateCore = (\n data: any,\n schema: JsonSchema,\n uischema?: UISchemaElement,\n options?: AJV | InitActionOptions\n): UpdateCoreAction => ({\n type: UPDATE_CORE,\n data,\n schema,\n uischema,\n options,\n});\n\nexport interface RegisterDefaultDataAction {\n type: 'jsonforms/ADD_DEFAULT_DATA';\n schemaPath: string;\n data: any;\n}\n\nexport const registerDefaultData = (schemaPath: string, data: any) => ({\n type: ADD_DEFAULT_DATA,\n schemaPath,\n data,\n});\n\nexport interface UnregisterDefaultDataAction {\n type: 'jsonforms/REMOVE_DEFAULT_DATA';\n schemaPath: string;\n}\n\nexport const unregisterDefaultData = (schemaPath: string) => ({\n type: REMOVE_DEFAULT_DATA,\n schemaPath,\n});\n\nexport interface SetAjvAction {\n type: 'jsonforms/SET_AJV';\n ajv: AJV;\n}\n\nexport const setAjv = (ajv: AJV) => ({\n type: SET_AJV,\n ajv,\n});\n\nexport const update = (\n path: string,\n updater: (existingData: any) => any\n): UpdateAction => ({\n type: UPDATE_DATA,\n path,\n updater,\n});\n\nexport const updateErrors = (errors: ErrorObject[]): UpdateErrorsAction => ({\n type: UPDATE_ERRORS,\n errors,\n});\n\nexport interface AddRendererAction {\n type: 'jsonforms/ADD_RENDERER';\n tester: RankedTester;\n renderer: any;\n}\n\nexport const registerRenderer = (tester: RankedTester, renderer: any) => ({\n type: ADD_RENDERER,\n tester,\n renderer,\n});\n\nexport interface AddCellRendererAction {\n type: 'jsonforms/ADD_CELL';\n tester: RankedTester;\n cell: any;\n}\n\nexport const registerCell = (tester: RankedTester, cell: any) => ({\n type: ADD_CELL,\n tester,\n cell,\n});\n\nexport interface RemoveCellRendererAction {\n type: 'jsonforms/REMOVE_CELL';\n tester: RankedTester;\n cell: any;\n}\n\nexport const unregisterCell = (tester: RankedTester, cell: any) => ({\n type: REMOVE_CELL,\n tester,\n cell,\n});\n\nexport interface RemoveRendererAction {\n type: 'jsonforms/REMOVE_RENDERER';\n tester: RankedTester;\n renderer: any;\n}\n\nexport const unregisterRenderer = (tester: RankedTester, renderer: any) => ({\n type: REMOVE_RENDERER,\n tester,\n renderer,\n});\n\nexport interface SetConfigAction {\n type: 'jsonforms/SET_CONFIG';\n config: any;\n}\n\nexport const setConfig = (config: any): SetConfigAction => ({\n type: SET_CONFIG,\n config,\n});\n\nexport const setValidationMode = (\n validationMode: ValidationMode\n): SetValidationModeAction => ({\n type: SET_VALIDATION_MODE,\n validationMode,\n});\n\nexport type UISchemaActions = AddUISchemaAction | RemoveUISchemaAction;\n\nexport interface AddUISchemaAction {\n type: 'jsonforms/ADD_UI_SCHEMA';\n tester: UISchemaTester;\n uischema: UISchemaElement;\n}\n\nexport const registerUISchema = (\n tester: UISchemaTester,\n uischema: UISchemaElement\n): AddUISchemaAction => {\n return {\n type: ADD_UI_SCHEMA,\n tester,\n uischema,\n };\n};\n\nexport interface RemoveUISchemaAction {\n type: 'jsonforms/REMOVE_UI_SCHEMA';\n tester: UISchemaTester;\n}\n\nexport const unregisterUISchema = (\n tester: UISchemaTester\n): RemoveUISchemaAction => {\n return {\n type: REMOVE_UI_SCHEMA,\n tester,\n };\n};\n\nexport type I18nActions =\n | SetLocaleAction\n | SetTranslatorAction\n | UpdateI18nAction;\n\nexport interface SetLocaleAction {\n type: 'jsonforms/SET_LOCALE';\n locale: string | undefined;\n}\n\nexport const setLocale = (locale: string | undefined): SetLocaleAction => ({\n type: SET_LOCALE,\n locale,\n});\n\nexport interface SetSchemaAction {\n type: 'jsonforms/SET_SCHEMA';\n schema: JsonSchema;\n}\n\nexport const setSchema = (schema: JsonSchema): SetSchemaAction => ({\n type: SET_SCHEMA,\n schema,\n});\n\nexport interface SetTranslatorAction {\n type: 'jsonforms/SET_TRANSLATOR';\n translator?: Translator;\n errorTranslator?: ErrorTranslator;\n}\n\nexport const setTranslator = (\n translator?: Translator,\n errorTranslator?: ErrorTranslator\n): SetTranslatorAction => ({\n type: SET_TRANSLATOR,\n translator,\n errorTranslator,\n});\n\nexport interface UpdateI18nAction {\n type: 'jsonforms/UPDATE_I18N';\n locale: string | undefined;\n translator: Translator | undefined;\n errorTranslator: ErrorTranslator | undefined;\n}\n\nexport const updateI18n = (\n locale: string | undefined,\n translator: Translator | undefined,\n errorTranslator: ErrorTranslator | undefined\n): UpdateI18nAction => ({\n type: UPDATE_I18N,\n locale,\n translator,\n errorTranslator,\n});\n\nexport interface SetUISchemaAction {\n type: 'jsonforms/SET_UISCHEMA';\n uischema: UISchemaElement;\n}\n\nexport const setUISchema = (uischema: UISchemaElement): SetUISchemaAction => ({\n type: SET_UISCHEMA,\n uischema,\n});\n","/*\n The MIT License\n \n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport { convertToValidClassName, createLabelDescriptionFrom } from './util';\nimport type { ControlElement, JsonSchema, LabelDescription } from './models';\n\nexport const Helpers: {\n createLabelDescriptionFrom(\n withLabel: ControlElement,\n schema: JsonSchema\n ): LabelDescription;\n convertToValidClassName(s: string): string;\n} = {\n createLabelDescriptionFrom,\n convertToValidClassName,\n};\n"],"names":["RuleEffect","merge","isFunction","isEqual","cloneDeep","get","setFp","unsetFp","filter","isObjectSchema","ArrayTranslationEnum","CombinatorTranslationEnum","isEmpty","endsWith","last","isArray","reduce","toPairs","includes","remove","maxBy","range","has","evaluateCondition","find","composePaths","startCase","all","any","Ajv","addFormats","keys"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,IAAM,qBAAqB,GAAG,sBAAsB,CAAC;AACrD,IAAM,mBAAmB,GAAG,UAAU,CAAC;AAIvC,IAAM,QAAQ,GAAG,UACf,UAAiB,EACjB,aAAoC,EAAA;IAEpC,IAAM,KAAK,GAAoC,EAAE,CAAC;AA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of file diff --git a/packages/core/lib/jsonforms-core.esm.js b/packages/core/lib/jsonforms-core.esm.js index 43af93f7d2..9bdde4c35d 100644 --- a/packages/core/lib/jsonforms-core.esm.js +++ b/packages/core/lib/jsonforms-core.esm.js @@ -1548,6 +1548,19 @@ const labelDescription = (text, show) => ({ show: show, }); +const dataPathToJsonPointer = (dataPath) => { + const parts = dataPath.split('.'); + let jsonPointer = '#'; + parts.forEach((part) => { + if (part.match(/^\d+$/)) { + jsonPointer += '/items'; + } + else { + jsonPointer += `/properties/${part}`; + } + }); + return jsonPointer; +}; const checkDataCondition = (propertyCondition, property, data) => { if (has(propertyCondition, 'const')) { return (has(data, property) && @@ -1569,7 +1582,7 @@ const checkPropertyCondition = (propertiesCondition, property, data) => { if (has(propertiesCondition[property], 'not')) { return !checkDataCondition(get(propertiesCondition[property], 'not'), property, data); } - if (has(propertiesCondition[property], 'properties')) { + if (has(propertiesCondition[property], 'properties') && has(data, property)) { const nextPropertyConditions = get(propertiesCondition[property], 'properties'); return all((prop) => checkPropertyCondition(nextPropertyConditions, prop, data[property]), Object.keys(nextPropertyConditions)); } @@ -1612,9 +1625,13 @@ const extractRequired = (schema, segment, prevSegments) => { let i = 0; let currentSchema = schema; while (i < prevSegments.length && - has(currentSchema, 'properties') && - has(get(currentSchema, 'properties'), prevSegments[i])) { - currentSchema = get(get(currentSchema, 'properties'), prevSegments[i]); + (has(currentSchema, prevSegments[i]) || + (has(currentSchema, 'properties') && + has(get(currentSchema, 'properties'), prevSegments[i])))) { + if (has(currentSchema, 'properties')) { + currentSchema = get(currentSchema, 'properties'); + } + currentSchema = get(currentSchema, prevSegments[i]); ++i; } if (i < prevSegments.length) { @@ -1657,43 +1674,59 @@ const conditionallyRequired = (schema, segment, prevSegments, data) => { conditionallyRequired(subschema, segment, prevSegments, data)); }, nestedAllOfSchema); }; -const isRequiredInParent = (schema, rootSchema, path, segment, prevSegments, data) => { - const pathSegments = path.split('/'); - const lastSegment = pathSegments[pathSegments.length - 3]; - const nextHigherSchemaSegments = pathSegments.slice(0, pathSegments.length - 4); - if (!nextHigherSchemaSegments.length) { +const getNextHigherSchemaPath = (schemaPath) => { + const pathSegments = schemaPath.split('/'); + const lastSegment = pathSegments[pathSegments.length - 1]; + const nextHigherSegmentIndexDifference = lastSegment === 'items' ? 1 : 2; + const nextHigherSchemaSegments = pathSegments.slice(0, pathSegments.length - nextHigherSegmentIndexDifference); + return nextHigherSchemaSegments.join('/'); +}; +const getNextHigherDataPath = (dataPath) => { + const dataPathSegments = dataPath.split('.'); + return dataPathSegments.slice(0, dataPathSegments.length - 1).join('.'); +}; +const isRequiredInParent = (schema, schemaPath, segment, prevSegments, data, dataPath) => { + const pathSegments = schemaPath.split('/'); + const lastSegment = pathSegments[pathSegments.length - 1]; + const nextHigherSchemaPath = getNextHigherSchemaPath(schemaPath); + if (!nextHigherSchemaPath) { return false; } - const nextHigherSchemaPath = nextHigherSchemaSegments.join('/'); - const nextHigherSchema = Resolve.schema(schema, nextHigherSchemaPath, rootSchema); - const currentData = Resolve.data(data, toDataPath(nextHigherSchemaPath)); + const nextHigherSchema = Resolve.schema(schema, nextHigherSchemaPath, schema); + const nextHigherDataPath = getNextHigherDataPath(dataPath); + const currentData = Resolve.data(data, nextHigherDataPath); return (conditionallyRequired(nextHigherSchema, segment, [lastSegment, ...prevSegments], currentData) || (has(nextHigherSchema, 'if') && checkRequiredInIf(nextHigherSchema, segment, [lastSegment, ...prevSegments], currentData)) || - isRequiredInParent(schema, rootSchema, nextHigherSchemaPath, segment, [lastSegment, ...prevSegments], currentData)); + isRequiredInParent(schema, nextHigherSchemaPath, segment, [lastSegment, ...prevSegments], + data, nextHigherDataPath)); }; -const isRequired = (schema, schemaPath, rootSchema, data, config) => { +const isRequiredInSchema = (schema, segment) => { + return (schema !== undefined && + schema.required !== undefined && + schema.required.indexOf(segment) !== -1); +}; +const isRequired = (schema, schemaPath, rootSchema) => { const pathSegments = schemaPath.split('/'); const lastSegment = pathSegments[pathSegments.length - 1]; const nextHigherSchemaSegments = pathSegments.slice(0, pathSegments.length - 2); const nextHigherSchemaPath = nextHigherSchemaSegments.join('/'); const nextHigherSchema = Resolve.schema(schema, nextHigherSchemaPath, rootSchema); - const currentData = Resolve.data(data, toDataPath(nextHigherSchemaPath)); - if (!config?.allowDynamicCheck) { - return (nextHigherSchema !== undefined && - nextHigherSchema.required !== undefined && - nextHigherSchema.required.indexOf(lastSegment) !== -1); - } + return isRequiredInSchema(nextHigherSchema, lastSegment); +}; +const isConditionallyRequired = (rootSchema, schemaPath, data, dataPath) => { + const pathSegments = schemaPath.split('/'); + const lastSegment = pathSegments[pathSegments.length - 1]; + const nextHigherSchemaPath = getNextHigherSchemaPath(schemaPath); + const nextHigherSchema = Resolve.schema(rootSchema, nextHigherSchemaPath, rootSchema); + const nextHigherDataPath = getNextHigherDataPath(dataPath); + const currentData = Resolve.data(data, nextHigherDataPath); const requiredInIf = has(nextHigherSchema, 'if') && checkRequiredInIf(nextHigherSchema, lastSegment, [], currentData); const requiredConditionally = conditionallyRequired(nextHigherSchema, lastSegment, [], currentData); - const requiredConditionallyInParent = isRequiredInParent(rootSchema, rootSchema, schemaPath, lastSegment, [], data); - return ((nextHigherSchema !== undefined && - nextHigherSchema.required !== undefined && - nextHigherSchema.required.indexOf(lastSegment) !== -1) || - requiredInIf || - requiredConditionally || - requiredConditionallyInParent); + const requiredConditionallyInParent = isRequiredInParent(rootSchema, + nextHigherSchemaPath, lastSegment, [], data, nextHigherDataPath); + return requiredInIf || requiredConditionally || requiredConditionallyInParent; }; const computeLabel = (label, required, hideRequiredAsterisk) => { return `${label ?? ''}${required && !hideRequiredAsterisk ? '*' : ''}`; @@ -1798,7 +1831,8 @@ const mapStateToControlProps = (state, ownProps) => { const rootSchema = getSchema(state); const config = getConfig(state); const required = controlElement.scope !== undefined && - isRequired(ownProps.schema, controlElement.scope, rootSchema, rootData, config); + !!(isRequired(ownProps.schema, controlElement.scope, rootSchema) || + isConditionallyRequired(rootSchema, dataPathToJsonPointer(path), rootData, path)); const resolvedSchema = Resolve.schema(ownProps.schema || rootSchema, controlElement.scope, rootSchema); const errors = getErrorAt(path, resolvedSchema)(state); const description = resolvedSchema !== undefined ? resolvedSchema.description : ''; diff --git a/packages/core/lib/jsonforms-core.esm.js.map b/packages/core/lib/jsonforms-core.esm.js.map index 4c049eef59..75854e6e46 100644 --- a/packages/core/lib/jsonforms-core.esm.js.map +++ b/packages/core/lib/jsonforms-core.esm.js.map @@ -1 +1 @@ -{"version":3,"file":"jsonforms-core.esm.js","sources":["../src/generators/schema.ts","../src/models/draft4.ts","../src/models/uischema.ts","../src/util/array.ts","../src/reducers/cells.ts","../src/configDefault.ts","../src/reducers/config.ts","../src/reducers/core.ts","../src/reducers/default-data.ts","../src/i18n/i18nUtil.ts","../src/i18n/arrayTranslations.ts","../src/i18n/combinatorTranslations.ts","../src/reducers/i18n.ts","../src/reducers/renderers.ts","../src/testers/testers.ts","../src/reducers/uischemas.ts","../src/reducers/reducers.ts","../src/reducers/selectors.ts","../src/reducers/middleware.ts","../src/util/path.ts","../src/util/resolvers.ts","../src/util/runtime.ts","../src/util/util.ts","../src/util/label.ts","../src/util/renderer.ts","../src/util/cell.ts","../src/util/combinators.ts","../src/util/ids.ts","../src/util/schema.ts","../src/util/uischema.ts","../src/util/validator.ts","../src/util/defaultDateFormat.ts","../src/generators/uischema.ts","../src/generators/Generate.ts","../src/actions/actions.ts","../src/Helpers.ts"],"sourcesContent":["/*\n The MIT License\n \n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport type { JsonSchema4 } from '../models';\n\nconst ADDITIONAL_PROPERTIES = 'additionalProperties';\nconst REQUIRED_PROPERTIES = 'required';\n\ntype Properties = { [property: string]: JsonSchema4 };\n\nconst distinct = (\n properties: any[],\n discriminator: (item: any) => string\n): JsonSchema4[] => {\n const known: { [property: string]: boolean } = {};\n\n return properties.filter((item) => {\n const discriminatorValue = discriminator(item);\n if (Object.prototype.hasOwnProperty.call(known, discriminatorValue)) {\n return false;\n } else {\n known[discriminatorValue] = true;\n return true;\n }\n });\n};\n\nclass Gen {\n constructor(\n private findOption: (props: Properties) => (optionName: string) => any\n ) {}\n\n // TODO fix @typescript-eslint/ban-types\n // eslint-disable-next-line @typescript-eslint/ban-types\n schemaObject = (data: Object): JsonSchema4 => {\n const props: Properties = this.properties(data);\n const schema: JsonSchema4 = {\n type: 'object',\n properties: props,\n additionalProperties: this.findOption(props)(ADDITIONAL_PROPERTIES),\n };\n const required = this.findOption(props)(REQUIRED_PROPERTIES);\n if (required.length > 0) {\n schema.required = required;\n }\n\n return schema;\n };\n\n properties = (data: any): Properties => {\n const emptyProps: Properties = {};\n\n return Object.keys(data).reduce((acc: Properties, propName: string) => {\n acc[propName] = this.property(data[propName]);\n\n return acc;\n }, emptyProps);\n };\n\n property = (data: any): JsonSchema4 => {\n switch (typeof data) {\n case 'string':\n return { type: 'string' };\n case 'boolean':\n return { type: 'boolean' };\n case 'number':\n if (Number.isInteger(data)) {\n return { type: 'integer' };\n }\n\n return { type: 'number' };\n case 'object':\n if (data == null) {\n return { type: 'null' };\n }\n\n return this.schemaObjectOrArray(data);\n default:\n return {};\n }\n };\n\n schemaObjectOrArray = (data: any): JsonSchema4 => {\n if (data instanceof Array) {\n return this.schemaArray(data as any[]);\n } else {\n return this.schemaObject(data);\n }\n };\n\n schemaArray = (data: any[]): JsonSchema4 => {\n if (data.length > 0) {\n const allProperties: JsonSchema4[] = data.map(this.property);\n const uniqueProperties = distinct(allProperties, (prop) =>\n JSON.stringify(prop)\n );\n if (uniqueProperties.length === 1) {\n return {\n type: 'array',\n items: uniqueProperties[0],\n };\n } else {\n return {\n type: 'array',\n items: {\n oneOf: uniqueProperties,\n },\n };\n }\n } else {\n return {\n type: 'array',\n items: {},\n };\n }\n };\n}\n\n/**\n * Generate a JSON schema based on the given data and any additional options.\n * @param {Object} instance the data to create a JSON schema for\n * @param {any} options any additional options that may alter the generated JSON schema\n * @returns {JsonSchema} the generated schema\n */\nexport const generateJsonSchema = (\n // TODO fix @typescript-eslint/ban-types\n // eslint-disable-next-line @typescript-eslint/ban-types\n instance: Object,\n options: any = {}\n): JsonSchema4 => {\n const findOption =\n (props: Properties) =>\n (optionName: string): boolean | string[] => {\n switch (optionName) {\n case ADDITIONAL_PROPERTIES:\n if (\n Object.prototype.hasOwnProperty.call(options, ADDITIONAL_PROPERTIES)\n ) {\n return options[ADDITIONAL_PROPERTIES];\n }\n\n return true;\n case REQUIRED_PROPERTIES:\n if (\n Object.prototype.hasOwnProperty.call(options, REQUIRED_PROPERTIES)\n ) {\n return options[REQUIRED_PROPERTIES](props);\n }\n\n return Object.keys(props);\n default:\n return;\n }\n };\n\n const gen = new Gen(findOption);\n\n return gen.schemaObject(instance);\n};\n","/*\n The MIT License\n \n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nexport const Draft4 = {\n id: 'http://json-schema.org/draft-04/schema#',\n $schema: 'http://json-schema.org/draft-04/schema#',\n description: 'Core schema meta-schema',\n definitions: {\n schemaArray: {\n type: 'array',\n minItems: 1,\n items: { $ref: '#' },\n },\n positiveInteger: {\n type: 'integer',\n minimum: 0,\n },\n positiveIntegerDefault0: {\n allOf: [{ $ref: '#/definitions/positiveInteger' }, { default: 0 }],\n },\n simpleTypes: {\n enum: [\n 'array',\n 'boolean',\n 'integer',\n 'null',\n 'number',\n 'object',\n 'string',\n ],\n },\n stringArray: {\n type: 'array',\n items: { type: 'string' },\n minItems: 1,\n uniqueItems: true,\n },\n },\n type: 'object',\n properties: {\n id: {\n type: 'string',\n format: 'uri',\n },\n $schema: {\n type: 'string',\n format: 'uri',\n },\n title: {\n type: 'string',\n },\n description: {\n type: 'string',\n },\n default: {},\n multipleOf: {\n type: 'number',\n minimum: 0,\n exclusiveMinimum: true,\n },\n maximum: {\n type: 'number',\n },\n exclusiveMaximum: {\n type: 'boolean',\n default: false,\n },\n minimum: {\n type: 'number',\n },\n exclusiveMinimum: {\n type: 'boolean',\n default: false,\n },\n maxLength: { $ref: '#/definitions/positiveInteger' },\n minLength: { $ref: '#/definitions/positiveIntegerDefault0' },\n pattern: {\n type: 'string',\n format: 'regex',\n },\n additionalItems: {\n anyOf: [{ type: 'boolean' }, { $ref: '#' }],\n default: {},\n },\n items: {\n anyOf: [{ $ref: '#' }, { $ref: '#/definitions/schemaArray' }],\n default: {},\n },\n maxItems: { $ref: '#/definitions/positiveInteger' },\n minItems: { $ref: '#/definitions/positiveIntegerDefault0' },\n uniqueItems: {\n type: 'boolean',\n default: false,\n },\n maxProperties: { $ref: '#/definitions/positiveInteger' },\n minProperties: { $ref: '#/definitions/positiveIntegerDefault0' },\n required: { $ref: '#/definitions/stringArray' },\n additionalProperties: {\n anyOf: [{ type: 'boolean' }, { $ref: '#' }],\n default: {},\n },\n definitions: {\n type: 'object',\n additionalProperties: { $ref: '#' },\n default: {},\n },\n properties: {\n type: 'object',\n additionalProperties: { $ref: '#' },\n default: {},\n },\n patternProperties: {\n type: 'object',\n additionalProperties: { $ref: '#' },\n default: {},\n },\n dependencies: {\n type: 'object',\n additionalProperties: {\n anyOf: [{ $ref: '#' }, { $ref: '#/definitions/stringArray' }],\n },\n },\n enum: {\n type: 'array',\n minItems: 1,\n uniqueItems: true,\n },\n type: {\n anyOf: [\n { $ref: '#/definitions/simpleTypes' },\n {\n type: 'array',\n items: { $ref: '#/definitions/simpleTypes' },\n minItems: 1,\n uniqueItems: true,\n },\n ],\n },\n allOf: { $ref: '#/definitions/schemaArray' },\n anyOf: { $ref: '#/definitions/schemaArray' },\n oneOf: { $ref: '#/definitions/schemaArray' },\n not: { $ref: '#' },\n },\n dependencies: {\n exclusiveMaximum: ['maximum'],\n exclusiveMinimum: ['minimum'],\n },\n default: {},\n};\n","/*\n The MIT License\n \n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport type { JsonSchema } from './jsonSchema';\n\n/**\n * Interface for describing an UI schema element that is referencing\n * a subschema. The value of the scope may be a JSON Pointer.\n */\nexport interface Scopable {\n /**\n * The scope that determines to which part this element should be bound to.\n */\n scope?: string;\n}\n\n/**\n * Interface for describing an UI schema element that is referencing\n * a subschema. The value of the scope must be a JSON Pointer.\n */\nexport interface Scoped extends Scopable {\n /**\n * The scope that determines to which part this element should be bound to.\n */\n scope: string;\n}\n\n/**\n * Interface for describing an UI schema element that may be labeled.\n */\nexport interface Labelable {\n /**\n * Label for UI schema element.\n */\n label?: string | T;\n}\n\n/**\n * Interface for describing an UI schema element that is labeled.\n */\nexport interface Labeled extends Labelable {\n label: string | T;\n}\n\n/*\n * Interface for describing an UI schema element that can provide an internationalization base key.\n * If defined, this key is suffixed to derive applicable message keys for the UI schema element.\n * For example, such suffixes are `.label` or `.description` to derive the corresponding message keys for a control element.\n */\nexport interface Internationalizable {\n i18n?: string;\n}\n\n/**\n * A rule that may be attached to any UI schema element.\n */\nexport interface Rule {\n /**\n * The effect of the rule\n */\n effect: RuleEffect;\n\n /**\n * The condition of the rule that must evaluate to true in order\n * to trigger the effect.\n */\n condition: Condition;\n}\n\n/**\n * The different rule effects.\n */\nexport enum RuleEffect {\n /**\n * Effect that hides the associated element.\n */\n HIDE = 'HIDE',\n /**\n * Effect that shows the associated element.\n */\n SHOW = 'SHOW',\n /**\n * Effect that enables the associated element.\n */\n ENABLE = 'ENABLE',\n /**\n * Effect that disables the associated element.\n */\n DISABLE = 'DISABLE',\n}\n\n/**\n * Represents a condition to be evaluated.\n */\nexport interface Condition {\n /**\n * The type of condition.\n */\n readonly type?: string;\n}\n\n/**\n * A leaf condition.\n */\nexport interface LeafCondition extends Condition, Scoped {\n type: 'LEAF';\n\n /**\n * The expected value when evaluating the condition\n */\n expectedValue: any;\n}\n\nexport interface SchemaBasedCondition extends Condition, Scoped {\n schema: JsonSchema;\n\n /**\n * When the scope resolves to undefined and `failWhenUndefined` is set to `true`, the condition\n * will fail. Therefore the reverse effect will be applied.\n *\n * Background:\n * Most JSON Schemas will successfully validate against `undefined` data. Specifying that a\n * condition shall fail when data is `undefined` requires to lift the scope to being able to use\n * JSON Schema's `required`.\n *\n * Using `failWhenUndefined` allows to more conveniently express this condition.\n */\n failWhenUndefined?: boolean;\n}\n\n/**\n * A composable condition.\n */\nexport interface ComposableCondition extends Condition {\n conditions: Condition[];\n}\n\n/**\n * An or condition.\n */\nexport interface OrCondition extends ComposableCondition {\n type: 'OR';\n}\n\n/**\n * An and condition.\n */\nexport interface AndCondition extends ComposableCondition {\n type: 'AND';\n}\n\n/**\n * Common base interface for any UI schema element.\n */\nexport interface UISchemaElement {\n /**\n * The type of this UI schema element.\n */\n type: string;\n\n /**\n * An optional rule.\n */\n rule?: Rule;\n\n /**\n * Any additional options.\n */\n options?: { [key: string]: any };\n}\n\n/**\n * Represents a layout element which can order its children\n * in a specific way.\n */\nexport interface Layout extends UISchemaElement {\n /**\n * The child elements of this layout.\n */\n elements: UISchemaElement[];\n}\n\n/**\n * A layout which orders its child elements vertically (i.e. from top to bottom).\n */\nexport interface VerticalLayout extends Layout {\n type: 'VerticalLayout';\n}\n\n/**\n * A layout which orders its children horizontally (i.e. from left to right).\n */\nexport interface HorizontalLayout extends Layout {\n type: 'HorizontalLayout';\n}\n\n/**\n * A group resembles a vertical layout, but additionally might have a label.\n * This layout is useful when grouping different elements by a certain criteria.\n */\nexport interface GroupLayout extends Layout, Labelable, Internationalizable {\n type: 'Group';\n}\n\n/**\n * Represents an object that can be used to configure a label.\n */\nexport interface LabelDescription {\n /**\n * An optional text to be displayed.\n */\n text?: string;\n /**\n * Optional property that determines whether to show this label.\n */\n show?: boolean;\n}\n\n/**\n * A label element.\n */\nexport interface LabelElement extends UISchemaElement, Internationalizable {\n type: 'Label';\n /**\n * The text of label.\n */\n text: string;\n}\n\n/**\n * A control element. The scope property of the control determines\n * to which part of the schema the control should be bound.\n */\nexport interface ControlElement\n extends UISchemaElement,\n Scoped,\n Labelable,\n Internationalizable {\n type: 'Control';\n}\n\n/**\n * The category layout.\n */\nexport interface Category extends Layout, Labeled, Internationalizable {\n type: 'Category';\n}\n\n/**\n * The categorization element, which may have children elements.\n * A child element may either be itself a Categorization or a Category, hence\n * the categorization element can be used to represent recursive structures like trees.\n */\nexport interface Categorization\n extends UISchemaElement,\n Labeled,\n Internationalizable {\n type: 'Categorization';\n /**\n * The child elements of this categorization which are either of type\n * {@link Category} or {@link Categorization}.\n */\n elements: (Category | Categorization)[];\n}\n\nexport const isInternationalized = (\n element: unknown\n): element is Required =>\n typeof element === 'object' &&\n element !== null &&\n typeof (element as Internationalizable).i18n === 'string';\n\nexport const isGroup = (layout: Layout): layout is GroupLayout =>\n layout.type === 'Group';\n\nexport const isLayout = (uischema: UISchemaElement): uischema is Layout =>\n (uischema as Layout).elements !== undefined;\n\nexport const isScopable = (obj: unknown): obj is Scopable =>\n !!obj && typeof obj === 'object';\n\nexport const isScoped = (obj: unknown): obj is Scoped =>\n isScopable(obj) && typeof obj.scope === 'string';\n\nexport const isLabelable = (obj: unknown): obj is Labelable =>\n !!obj && typeof obj === 'object';\n\nexport const isLabeled = (obj: unknown): obj is Labeled =>\n isLabelable(obj) && ['string', 'boolean'].includes(typeof obj.label);\n","/*\n The MIT License\n\n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nconst move = (array: any[], index: number, delta: number) => {\n const newIndex: number = index + delta;\n if (newIndex < 0 || newIndex >= array.length) {\n return;\n } // Already at the top or bottom.\n const indexes: number[] = [index, newIndex].sort((a, b) => a - b); // Sort the indixes\n array.splice(indexes[0], 2, array[indexes[1]], array[indexes[0]]);\n};\n\nconst moveUp = (array: any[], toMove: number) => {\n move(array, toMove, -1);\n};\n\nconst moveDown = (array: any[], toMove: number) => {\n move(array, toMove, 1);\n};\n\nexport { moveUp, moveDown };\n","/*\n The MIT License\n \n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport type { RankedTester } from '../testers';\nimport {\n ADD_CELL,\n AddCellRendererAction,\n REMOVE_CELL,\n RemoveCellRendererAction,\n} from '../actions';\nimport type { Reducer } from '../util';\n\ntype ValidCellReducerActions = AddCellRendererAction | RemoveCellRendererAction;\n\nexport type JsonFormsCellRendererRegistryState =\n JsonFormsCellRendererRegistryEntry[];\n\nexport interface JsonFormsCellRendererRegistryEntry {\n tester: RankedTester;\n cell: any;\n}\n\nexport const cellReducer: Reducer<\n JsonFormsCellRendererRegistryState,\n ValidCellReducerActions\n> = (state = [], { type, tester, cell }) => {\n switch (type) {\n case ADD_CELL:\n return state.concat([{ tester, cell }]);\n case REMOVE_CELL:\n return state.filter((t) => t.tester !== tester);\n default:\n return state;\n }\n};\n","/*\n The MIT License\n\n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nexport const configDefault = {\n /*\n * [text] whether to restrict the number of characters to maxLength,\n * if specified in the JSON schema\n */\n restrict: false,\n\n /*\n * [text] whether to resize the input's width to maxLength,\n * if specified in the JSON schema\n */\n trim: false,\n\n /*\n * [text] if input descriptions should hide when not focused\n */\n showUnfocusedDescription: false,\n\n /*\n * [text] if asterisks in labels for required fields should be hidden\n */\n hideRequiredAsterisk: false,\n\n /**\n * [text] if dynamic checks for conditional application of properties\n * should be performed (e.g. check for conditional required)\n */\n allowDynamicCheck: false,\n};\n","/*\n The MIT License\n \n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport merge from 'lodash/merge';\nimport { SET_CONFIG, SetConfigAction } from '../actions';\nimport { configDefault } from '../configDefault';\nimport type { Reducer } from '../util';\n\nconst applyDefaultConfiguration = (config: any = {}) =>\n merge({}, configDefault, config);\n\nexport const configReducer: Reducer = (\n state = applyDefaultConfiguration(),\n action\n) => {\n switch (action.type) {\n case SET_CONFIG:\n return applyDefaultConfiguration(action.config);\n default:\n return state;\n }\n};\n","/*\n The MIT License\n\n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport cloneDeep from 'lodash/cloneDeep';\nimport setFp from 'lodash/fp/set';\nimport unsetFp from 'lodash/fp/unset';\nimport get from 'lodash/get';\nimport filter from 'lodash/filter';\nimport isEqual from 'lodash/isEqual';\nimport isFunction from 'lodash/isFunction';\nimport type Ajv from 'ajv';\nimport type { ErrorObject, ValidateFunction } from 'ajv';\nimport {\n CoreActions,\n INIT,\n InitAction,\n InitActionOptions,\n SET_AJV,\n SET_SCHEMA,\n SET_UISCHEMA,\n SET_VALIDATION_MODE,\n UPDATE_DATA,\n UPDATE_ERRORS,\n UPDATE_CORE,\n UpdateCoreAction,\n} from '../actions';\nimport { createAjv, decode, isOneOfEnumSchema, Reducer } from '../util';\nimport type { JsonSchema, UISchemaElement } from '../models';\n\nexport const validate = (\n validator: ValidateFunction | undefined,\n data: any\n): ErrorObject[] => {\n if (validator === undefined) {\n return [];\n }\n const valid = validator(data);\n if (valid) {\n return [];\n }\n return validator.errors;\n};\n\nexport type ValidationMode =\n | 'ValidateAndShow'\n | 'ValidateAndHide'\n | 'NoValidation';\n\nexport interface JsonFormsCore {\n data: any;\n schema: JsonSchema;\n uischema: UISchemaElement;\n errors?: ErrorObject[];\n additionalErrors?: ErrorObject[];\n validator?: ValidateFunction;\n ajv?: Ajv;\n validationMode?: ValidationMode;\n}\n\nconst initState: JsonFormsCore = {\n data: {},\n schema: {},\n uischema: undefined,\n errors: [],\n validator: undefined,\n ajv: undefined,\n validationMode: 'ValidateAndShow',\n additionalErrors: [],\n};\n\nconst getOrCreateAjv = (\n state: JsonFormsCore,\n action?: InitAction | UpdateCoreAction\n): Ajv => {\n if (action) {\n if (hasAjvOption(action.options)) {\n // options object with ajv\n return action.options.ajv;\n } else if (action.options !== undefined) {\n // it is not an option object => should be ajv itself => check for compile function\n if (isFunction(action.options.compile)) {\n return action.options;\n }\n }\n }\n return state.ajv ? state.ajv : createAjv();\n};\n\nconst hasAjvOption = (option: any): option is InitActionOptions => {\n if (option) {\n return option.ajv !== undefined;\n }\n return false;\n};\n\nconst getValidationMode = (\n state: JsonFormsCore,\n action?: InitAction | UpdateCoreAction\n): ValidationMode => {\n if (action && hasValidationModeOption(action.options)) {\n return action.options.validationMode;\n }\n return state.validationMode;\n};\n\nconst hasValidationModeOption = (option: any): option is InitActionOptions => {\n if (option) {\n return option.validationMode !== undefined;\n }\n return false;\n};\n\nconst hasAdditionalErrorsOption = (\n option: any\n): option is InitActionOptions => {\n if (option) {\n return option.additionalErrors !== undefined;\n }\n return false;\n};\n\nconst getAdditionalErrors = (\n state: JsonFormsCore,\n action?: InitAction | UpdateCoreAction\n): ErrorObject[] => {\n if (action && hasAdditionalErrorsOption(action.options)) {\n return action.options.additionalErrors;\n }\n return state.additionalErrors;\n};\n\nexport const coreReducer: Reducer = (\n state = initState,\n action\n) => {\n switch (action.type) {\n case INIT: {\n const thisAjv = getOrCreateAjv(state, action);\n\n const validationMode = getValidationMode(state, action);\n const v =\n validationMode === 'NoValidation'\n ? undefined\n : thisAjv.compile(action.schema);\n const e = validate(v, action.data);\n const additionalErrors = getAdditionalErrors(state, action);\n\n return {\n ...state,\n data: action.data,\n schema: action.schema,\n uischema: action.uischema,\n additionalErrors,\n errors: e,\n validator: v,\n ajv: thisAjv,\n validationMode,\n };\n }\n case UPDATE_CORE: {\n const thisAjv = getOrCreateAjv(state, action);\n const validationMode = getValidationMode(state, action);\n let validator = state.validator;\n let errors = state.errors;\n if (\n state.schema !== action.schema ||\n state.validationMode !== validationMode ||\n state.ajv !== thisAjv\n ) {\n // revalidate only if necessary\n validator =\n validationMode === 'NoValidation'\n ? undefined\n : thisAjv.compile(action.schema);\n errors = validate(validator, action.data);\n } else if (state.data !== action.data) {\n errors = validate(validator, action.data);\n }\n const additionalErrors = getAdditionalErrors(state, action);\n\n const stateChanged =\n state.data !== action.data ||\n state.schema !== action.schema ||\n state.uischema !== action.uischema ||\n state.ajv !== thisAjv ||\n state.errors !== errors ||\n state.validator !== validator ||\n state.validationMode !== validationMode ||\n state.additionalErrors !== additionalErrors;\n return stateChanged\n ? {\n ...state,\n data: action.data,\n schema: action.schema,\n uischema: action.uischema,\n ajv: thisAjv,\n errors: isEqual(errors, state.errors) ? state.errors : errors,\n validator: validator,\n validationMode: validationMode,\n additionalErrors,\n }\n : state;\n }\n case SET_AJV: {\n const currentAjv = action.ajv;\n const validator =\n state.validationMode === 'NoValidation'\n ? undefined\n : currentAjv.compile(state.schema);\n const errors = validate(validator, state.data);\n return {\n ...state,\n validator,\n errors,\n };\n }\n case SET_SCHEMA: {\n const needsNewValidator =\n action.schema && state.ajv && state.validationMode !== 'NoValidation';\n const v = needsNewValidator\n ? state.ajv.compile(action.schema)\n : state.validator;\n const errors = validate(v, state.data);\n return {\n ...state,\n validator: v,\n schema: action.schema,\n errors,\n };\n }\n case SET_UISCHEMA: {\n return {\n ...state,\n uischema: action.uischema,\n };\n }\n case UPDATE_DATA: {\n if (action.path === undefined || action.path === null) {\n return state;\n } else if (action.path === '') {\n // empty path is ok\n const result = action.updater(cloneDeep(state.data));\n const errors = validate(state.validator, result);\n return {\n ...state,\n data: result,\n errors,\n };\n } else {\n const oldData: any = get(state.data, action.path);\n const newData = action.updater(cloneDeep(oldData));\n let newState: any;\n if (newData !== undefined) {\n newState = setFp(\n action.path,\n newData,\n state.data === undefined ? {} : state.data\n );\n } else {\n newState = unsetFp(\n action.path,\n state.data === undefined ? {} : state.data\n );\n }\n const errors = validate(state.validator, newState);\n return {\n ...state,\n data: newState,\n errors,\n };\n }\n }\n case UPDATE_ERRORS: {\n return {\n ...state,\n errors: action.errors,\n };\n }\n case SET_VALIDATION_MODE: {\n if (state.validationMode === action.validationMode) {\n return state;\n }\n if (action.validationMode === 'NoValidation') {\n const errors = validate(undefined, state.data);\n return {\n ...state,\n errors,\n validationMode: action.validationMode,\n };\n }\n if (state.validationMode === 'NoValidation') {\n const validator = state.ajv.compile(state.schema);\n const errors = validate(validator, state.data);\n return {\n ...state,\n validator,\n errors,\n validationMode: action.validationMode,\n };\n }\n return {\n ...state,\n validationMode: action.validationMode,\n };\n }\n default:\n return state;\n }\n};\n\nexport const extractData = (state: JsonFormsCore) => get(state, 'data');\nexport const extractSchema = (state: JsonFormsCore) => get(state, 'schema');\nexport const extractUiSchema = (state: JsonFormsCore) => get(state, 'uischema');\nexport const extractAjv = (state: JsonFormsCore) => get(state, 'ajv');\n\nconst getInvalidProperty = (error: ErrorObject): string | undefined => {\n switch (error.keyword) {\n case 'required':\n case 'dependencies':\n return error.params.missingProperty;\n case 'additionalProperties':\n return error.params.additionalProperty;\n default:\n return undefined;\n }\n};\n\nexport const getControlPath = (error: ErrorObject) => {\n // Up until AJV v7 the path property was called 'dataPath'\n // With AJV v8 the property was renamed to 'instancePath'\n let controlPath = (error as any).dataPath || error.instancePath || '';\n\n // change '/' chars to '.'\n controlPath = controlPath.replace(/\\//g, '.');\n\n const invalidProperty = getInvalidProperty(error);\n if (invalidProperty !== undefined && !controlPath.endsWith(invalidProperty)) {\n controlPath = `${controlPath}.${invalidProperty}`;\n }\n\n // remove '.' chars at the beginning of paths\n controlPath = controlPath.replace(/^./, '');\n\n // decode JSON Pointer escape sequences\n controlPath = decode(controlPath);\n return controlPath;\n};\n\nexport const errorsAt =\n (\n instancePath: string,\n schema: JsonSchema,\n matchPath: (path: string) => boolean\n ) =>\n (errors: ErrorObject[]): ErrorObject[] => {\n // Get data paths of oneOf and anyOf errors to later determine whether an error occurred inside a subschema of oneOf or anyOf.\n const combinatorPaths = filter(\n errors,\n (error) => error.keyword === 'oneOf' || error.keyword === 'anyOf'\n ).map((error) => getControlPath(error));\n\n return filter(errors, (error) => {\n // Filter errors that match any keyword that we don't want to show in the UI\n // but keep the errors for oneOf enums\n if (\n filteredErrorKeywords.indexOf(error.keyword) !== -1 &&\n !isOneOfEnumSchema(error.parentSchema)\n ) {\n return false;\n }\n const controlPath = getControlPath(error);\n let result = matchPath(controlPath);\n // In anyOf and oneOf blocks with \"primitive\" (i.e. string, number etc.) or array subschemas,\n // we want to make sure that errors are only shown for the correct subschema.\n // Therefore, we compare the error's parent schema with the property's schema.\n // In the primitive case the error's data path is the same for all subschemas:\n // It directly points to the property defining the anyOf/oneOf.\n // The same holds true for errors on the array level (e.g. min item amount).\n // In contrast, this comparison must not be done for errors whose parent schema defines an object or a oneOf enum,\n // because the parent schema can never match the property schema (e.g. for 'required' checks).\n const parentSchema: JsonSchema | undefined = error.parentSchema;\n if (\n result &&\n !isObjectSchema(parentSchema) &&\n !isOneOfEnumSchema(parentSchema) &&\n combinatorPaths.findIndex((p) => instancePath.startsWith(p)) !== -1\n ) {\n result = result && isEqual(parentSchema, schema);\n }\n return result;\n });\n };\n\n/**\n * @returns true if the schema describes an object.\n */\nconst isObjectSchema = (schema?: JsonSchema): boolean => {\n return schema?.type === 'object' || !!schema?.properties;\n};\n\n/**\n * The error-type of an AJV error is defined by its `keyword` property.\n * Certain errors are filtered because they don't fit to any rendered control.\n * All of them have in common that we don't want to show them in the UI\n * because controls will show the actual reason why they don't match their correponding sub schema.\n * - additionalProperties: Indicates that a property is present that is not defined in the schema.\n * Jsonforms only allows to edit defined properties. These errors occur if an oneOf doesn't match.\n * - allOf: Indicates that not all of the allOf definitions match as a whole.\n * - anyOf: Indicates that an anyOf definition itself is not valid because none of its subschemas matches.\n * - oneOf: Indicates that an oneOf definition itself is not valid because not exactly one of its subschemas matches.\n */\nconst filteredErrorKeywords = [\n 'additionalProperties',\n 'allOf',\n 'anyOf',\n 'oneOf',\n];\n\nconst getErrorsAt =\n (\n instancePath: string,\n schema: JsonSchema,\n matchPath: (path: string) => boolean\n ) =>\n (state: JsonFormsCore): ErrorObject[] => {\n const errors = state.errors ?? [];\n const additionalErrors = state.additionalErrors ?? [];\n return errorsAt(\n instancePath,\n schema,\n matchPath\n )(\n state.validationMode === 'ValidateAndHide'\n ? additionalErrors\n : [...errors, ...additionalErrors]\n );\n };\n\nexport const errorAt = (instancePath: string, schema: JsonSchema) =>\n getErrorsAt(instancePath, schema, (path) => path === instancePath);\nexport const subErrorsAt = (instancePath: string, schema: JsonSchema) =>\n getErrorsAt(instancePath, schema, (path) =>\n path.startsWith(instancePath + '.')\n );\n","/*\n The MIT License\n\n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport {\n ADD_DEFAULT_DATA,\n RegisterDefaultDataAction,\n REMOVE_DEFAULT_DATA,\n UnregisterDefaultDataAction,\n} from '../actions';\nimport type { Reducer } from '../util';\n\nexport interface JsonFormsDefaultDataRegistryEntry {\n schemaPath: string;\n data: any;\n}\n\ntype ValidDefaultDataActions =\n | RegisterDefaultDataAction\n | UnregisterDefaultDataAction;\n\nexport const defaultDataReducer: Reducer<\n JsonFormsDefaultDataRegistryEntry[],\n ValidDefaultDataActions\n> = (state = [], action) => {\n switch (action.type) {\n case ADD_DEFAULT_DATA:\n return state.concat([\n { schemaPath: action.schemaPath, data: action.data },\n ]);\n case REMOVE_DEFAULT_DATA:\n return state.filter((t) => t.schemaPath !== action.schemaPath);\n default:\n return state;\n }\n};\n\nexport const extractDefaultData = (\n state: JsonFormsDefaultDataRegistryEntry[]\n): JsonFormsDefaultDataRegistryEntry[] => state;\n","import type { ErrorObject } from 'ajv';\nimport { isInternationalized, Labelable, UISchemaElement } from '../models';\nimport { getControlPath } from '../reducers';\nimport { formatErrorMessage } from '../util';\nimport type { i18nJsonSchema, ErrorTranslator, Translator } from './i18nTypes';\nimport {\n ArrayDefaultTranslation,\n ArrayTranslations,\n} from './arrayTranslations';\nimport {\n CombinatorDefaultTranslation,\n CombinatorTranslations,\n} from './combinatorTranslations';\n\nexport const getI18nKeyPrefixBySchema = (\n schema: i18nJsonSchema | undefined,\n uischema: unknown | undefined\n): string | undefined => {\n if (isInternationalized(uischema)) {\n return uischema.i18n;\n }\n return schema?.i18n ?? undefined;\n};\n\n/**\n * Transforms a given path to a prefix which can be used for i18n keys.\n * Returns 'root' for empty paths and removes array indices\n */\nexport const transformPathToI18nPrefix = (path: string): string => {\n return (\n path\n ?.split('.')\n .filter((segment) => !/^\\d+$/.test(segment))\n .join('.') || 'root'\n );\n};\n\nexport const getI18nKeyPrefix = (\n schema: i18nJsonSchema | undefined,\n uischema: unknown | undefined,\n path: string | undefined\n): string => {\n return (\n getI18nKeyPrefixBySchema(schema, uischema) ??\n transformPathToI18nPrefix(path)\n );\n};\n\nexport const getI18nKey = (\n schema: i18nJsonSchema | undefined,\n uischema: unknown | undefined,\n path: string | undefined,\n key: string\n): string => {\n return `${getI18nKeyPrefix(schema, uischema, path)}.${key}`;\n};\n\nexport const addI18nKeyToPrefix = (\n i18nKeyPrefix: string,\n key: string\n): string => {\n return `${i18nKeyPrefix}.${key}`;\n};\n\nexport const defaultTranslator: Translator = (\n _id: string,\n defaultMessage: string | undefined\n) => defaultMessage;\n\nexport const defaultErrorTranslator: ErrorTranslator = (error, t, uischema) => {\n // check whether there is a special keyword message\n const i18nKey = getI18nKey(\n error.parentSchema,\n uischema,\n getControlPath(error),\n `error.${error.keyword}`\n );\n const specializedKeywordMessage = t(i18nKey, undefined, { error });\n if (specializedKeywordMessage !== undefined) {\n return specializedKeywordMessage;\n }\n\n // check whether there is a generic keyword message\n const genericKeywordMessage = t(`error.${error.keyword}`, undefined, {\n error,\n });\n if (genericKeywordMessage !== undefined) {\n return genericKeywordMessage;\n }\n\n // check whether there is a customization for the default message\n const messageCustomization = t(error.message, undefined, { error });\n if (messageCustomization !== undefined) {\n return messageCustomization;\n }\n\n // rewrite required property messages (if they were not customized) as we place them next to the respective input\n if (\n error.keyword === 'required' &&\n error.message?.startsWith('must have required property')\n ) {\n return t('is a required property', 'is a required property', { error });\n }\n\n return error.message;\n};\n\n/**\n * Returns the determined error message for the given errors.\n * All errors must correspond to the given schema, uischema or path.\n */\nexport const getCombinedErrorMessage = (\n errors: ErrorObject[],\n et: ErrorTranslator,\n t: Translator,\n schema?: i18nJsonSchema,\n uischema?: UISchemaElement,\n path?: string\n) => {\n if (errors.length > 0 && t) {\n // check whether there is a special message which overwrites all others\n const customErrorKey = getI18nKey(schema, uischema, path, 'error.custom');\n const specializedErrorMessage = t(customErrorKey, undefined, {\n schema,\n uischema,\n path,\n errors,\n });\n if (specializedErrorMessage !== undefined) {\n return specializedErrorMessage;\n }\n }\n return formatErrorMessage(errors.map((error) => et(error, t, uischema)));\n};\n\n/**\n * This can be used to internationalize the label of the given Labelable (e.g. UI Schema elements).\n * This should not be used for controls as there we have additional context in the form of the JSON Schema available.\n */\nexport const deriveLabelForUISchemaElement = (\n uischema: Labelable,\n t: Translator\n): string | undefined => {\n if (uischema.label === false) {\n return undefined;\n }\n if (\n (uischema.label === undefined ||\n uischema.label === null ||\n uischema.label === true) &&\n !isInternationalized(uischema)\n ) {\n return undefined;\n }\n const stringifiedLabel =\n typeof uischema.label === 'string'\n ? uischema.label\n : JSON.stringify(uischema.label);\n const i18nKeyPrefix = getI18nKeyPrefixBySchema(undefined, uischema);\n const i18nKey =\n typeof i18nKeyPrefix === 'string'\n ? `${i18nKeyPrefix}.label`\n : stringifiedLabel;\n return t(i18nKey, stringifiedLabel, { uischema: uischema });\n};\n\nexport const getArrayTranslations = (\n t: Translator,\n defaultTranslations: ArrayDefaultTranslation[],\n i18nKeyPrefix: string,\n label: string\n): ArrayTranslations => {\n const translations: ArrayTranslations = {};\n defaultTranslations.forEach((controlElement) => {\n const key = addI18nKeyToPrefix(i18nKeyPrefix, controlElement.key);\n translations[controlElement.key] = t(key, controlElement.default(label));\n });\n return translations;\n};\n\nexport const getCombinatorTranslations = (\n t: Translator,\n defaultTranslations: CombinatorDefaultTranslation[],\n i18nKeyPrefix: string,\n label: string\n): CombinatorTranslations => {\n const translations: CombinatorTranslations = {};\n defaultTranslations.forEach((controlElement) => {\n const key = addI18nKeyToPrefix(i18nKeyPrefix, controlElement.key);\n translations[controlElement.key] = t(key, controlElement.default(label));\n });\n return translations;\n};\n","export interface ArrayDefaultTranslation {\n key: ArrayTranslationEnum;\n default: (variable?: string) => string;\n}\n\nexport enum ArrayTranslationEnum {\n addTooltip = 'addTooltip',\n addAriaLabel = 'addAriaLabel',\n removeTooltip = 'removeTooltip',\n upAriaLabel = 'upAriaLabel',\n downAriaLabel = 'downAriaLabel',\n noSelection = 'noSelection',\n removeAriaLabel = 'removeAriaLabel',\n noDataMessage = 'noDataMessage',\n deleteDialogTitle = 'deleteDialogTitle',\n deleteDialogMessage = 'deleteDialogMessage',\n deleteDialogAccept = 'deleteDialogAccept',\n deleteDialogDecline = 'deleteDialogDecline',\n up = 'up',\n down = 'down',\n}\n\nexport type ArrayTranslations = {\n [key in ArrayTranslationEnum]?: string;\n};\n\nexport const arrayDefaultTranslations: ArrayDefaultTranslation[] = [\n {\n key: ArrayTranslationEnum.addTooltip,\n default: (input) => (input ? `Add to ${input}` : 'Add'),\n },\n {\n key: ArrayTranslationEnum.addAriaLabel,\n default: (input) => (input ? `Add to ${input} button` : 'Add button'),\n },\n { key: ArrayTranslationEnum.removeTooltip, default: () => 'Delete' },\n { key: ArrayTranslationEnum.removeAriaLabel, default: () => 'Delete button' },\n { key: ArrayTranslationEnum.upAriaLabel, default: () => `Move item up` },\n { key: ArrayTranslationEnum.up, default: () => 'Up' },\n { key: ArrayTranslationEnum.down, default: () => 'Down' },\n { key: ArrayTranslationEnum.downAriaLabel, default: () => `Move item down` },\n { key: ArrayTranslationEnum.noDataMessage, default: () => 'No data' },\n { key: ArrayTranslationEnum.noSelection, default: () => 'No selection' },\n {\n key: ArrayTranslationEnum.deleteDialogTitle,\n default: () => 'Confirm Deletion',\n },\n {\n key: ArrayTranslationEnum.deleteDialogMessage,\n default: () => 'Are you sure you want to delete the selected entry?',\n },\n { key: ArrayTranslationEnum.deleteDialogAccept, default: () => 'Yes' },\n { key: ArrayTranslationEnum.deleteDialogDecline, default: () => 'No' },\n];\n","export interface CombinatorDefaultTranslation {\n key: CombinatorTranslationEnum;\n default: (variable?: string) => string;\n}\n\nexport enum CombinatorTranslationEnum {\n clearDialogTitle = 'clearDialogTitle',\n clearDialogMessage = 'clearDialogMessage',\n clearDialogAccept = 'clearDialogAccept',\n clearDialogDecline = 'clearDialogDecline',\n}\n\nexport type CombinatorTranslations = {\n [key in CombinatorTranslationEnum]?: string;\n};\n\nexport const combinatorDefaultTranslations: CombinatorDefaultTranslation[] = [\n {\n key: CombinatorTranslationEnum.clearDialogTitle,\n default: () => 'Clear form?',\n },\n {\n key: CombinatorTranslationEnum.clearDialogMessage,\n default: () => 'Your data will be cleared. Do you want to proceed?',\n },\n { key: CombinatorTranslationEnum.clearDialogAccept, default: () => 'Yes' },\n { key: CombinatorTranslationEnum.clearDialogDecline, default: () => 'No' },\n];\n","/*\n The MIT License\n\n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport {\n defaultErrorTranslator,\n defaultTranslator,\n JsonFormsI18nState,\n} from '../i18n';\nimport {\n I18nActions,\n SET_LOCALE,\n SET_TRANSLATOR,\n UPDATE_I18N,\n} from '../actions';\nimport type { Reducer } from '../util';\n\nexport const defaultJsonFormsI18nState: Required = {\n locale: 'en',\n translate: defaultTranslator,\n translateError: defaultErrorTranslator,\n};\n\nexport const i18nReducer: Reducer = (\n state = defaultJsonFormsI18nState,\n action\n) => {\n switch (action.type) {\n case UPDATE_I18N: {\n const locale = action.locale ?? defaultJsonFormsI18nState.locale;\n const translate =\n action.translator ?? defaultJsonFormsI18nState.translate;\n const translateError =\n action.errorTranslator ?? defaultJsonFormsI18nState.translateError;\n\n if (\n locale !== state.locale ||\n translate !== state.translate ||\n translateError !== state.translateError\n ) {\n return {\n ...state,\n locale,\n translate,\n translateError,\n };\n }\n return state;\n }\n case SET_TRANSLATOR:\n return {\n ...state,\n translate: action.translator ?? defaultTranslator,\n translateError: action.errorTranslator ?? defaultErrorTranslator,\n };\n case SET_LOCALE:\n return {\n ...state,\n locale: action.locale ?? navigator.languages[0],\n };\n default:\n return state;\n }\n};\n\nexport const fetchLocale = (state?: JsonFormsI18nState) => {\n if (state === undefined) {\n return undefined;\n }\n return state.locale;\n};\n\nexport const fetchTranslator = (state?: JsonFormsI18nState) => {\n if (state === undefined) {\n return defaultTranslator;\n }\n return state.translate;\n};\n\nexport const fetchErrorTranslator = (state?: JsonFormsI18nState) => {\n if (state === undefined) {\n return defaultErrorTranslator;\n }\n return state.translateError;\n};\n","/*\n The MIT License\n \n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport type { RankedTester } from '../testers';\nimport {\n ADD_RENDERER,\n AddRendererAction,\n REMOVE_RENDERER,\n RemoveRendererAction,\n} from '../actions';\nimport type { Reducer } from '../util';\n\nexport interface JsonFormsRendererRegistryEntry {\n tester: RankedTester;\n renderer: any;\n}\n\ntype ValidRendererReducerActions = AddRendererAction | RemoveRendererAction;\n\nexport const rendererReducer: Reducer<\n JsonFormsRendererRegistryEntry[],\n ValidRendererReducerActions\n> = (state = [], action) => {\n switch (action.type) {\n case ADD_RENDERER:\n return state.concat([\n { tester: action.tester, renderer: action.renderer },\n ]);\n case REMOVE_RENDERER:\n return state.filter((t) => t.tester !== action.tester);\n default:\n return state;\n }\n};\n","/*\n The MIT License\n\n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport isEmpty from 'lodash/isEmpty';\nimport get from 'lodash/get';\nimport endsWith from 'lodash/endsWith';\nimport last from 'lodash/last';\nimport isArray from 'lodash/isArray';\nimport reduce from 'lodash/reduce';\nimport toPairs from 'lodash/toPairs';\nimport includes from 'lodash/includes';\nimport type {\n Categorization,\n ControlElement,\n JsonSchema,\n UISchemaElement,\n} from '../models';\nimport {\n deriveTypes,\n hasType,\n isOneOfEnumSchema,\n resolveSchema,\n} from '../util';\n\n/**\n * Constant that indicates that a tester is not capable of handling\n * a combination of schema/data.\n * @type {number}\n */\nexport const NOT_APPLICABLE = -1;\n/**\n * A tester is a function that receives an UI schema and a JSON schema and returns a boolean.\n * The rootSchema is handed over as context. Can be used to resolve references.\n */\nexport type Tester = (\n uischema: UISchemaElement,\n schema: JsonSchema,\n context: TesterContext\n) => boolean;\n\n/**\n * A ranked tester associates a tester with a number.\n */\nexport type RankedTester = (\n uischema: UISchemaElement,\n schema: JsonSchema,\n context: TesterContext\n) => number;\n\n/**\n * Additional context given to a tester in addition to UISchema and JsonSchema.\n */\nexport interface TesterContext {\n /** The root JsonSchema of the form. Can be used to resolve references. */\n rootSchema: JsonSchema;\n /** The form wide configuration object given to JsonForms. */\n config: any;\n}\n\nexport const isControl = (uischema: any): uischema is ControlElement =>\n !isEmpty(uischema) && uischema.scope !== undefined;\n\n/**\n * Only applicable for Controls.\n *\n * This function checks whether the given UI schema is of type Control\n * and if so, resolves the sub-schema referenced by the control and applies\n * the given predicate\n *\n * @param {(JsonSchema) => boolean} predicate the predicate that should be\n * applied to the resolved sub-schema\n */\nexport const schemaMatches =\n (\n predicate: (schema: JsonSchema, rootSchema: JsonSchema) => boolean\n ): Tester =>\n (\n uischema: UISchemaElement,\n schema: JsonSchema,\n context: TesterContext\n ): boolean => {\n if (isEmpty(uischema) || !isControl(uischema)) {\n return false;\n }\n if (isEmpty(schema)) {\n return false;\n }\n const schemaPath = uischema.scope;\n if (isEmpty(schemaPath)) {\n return false;\n }\n let currentDataSchema = schema;\n if (hasType(schema, 'object')) {\n currentDataSchema = resolveSchema(\n schema,\n schemaPath,\n context?.rootSchema\n );\n }\n if (currentDataSchema === undefined) {\n return false;\n }\n\n return predicate(currentDataSchema, context?.rootSchema);\n };\n\nexport const schemaSubPathMatches =\n (\n subPath: string,\n predicate: (schema: JsonSchema, rootSchema: JsonSchema) => boolean\n ): Tester =>\n (\n uischema: UISchemaElement,\n schema: JsonSchema,\n context: TesterContext\n ): boolean => {\n if (isEmpty(uischema) || !isControl(uischema)) {\n return false;\n }\n const schemaPath = uischema.scope;\n let currentDataSchema: JsonSchema = schema;\n if (hasType(schema, 'object')) {\n currentDataSchema = resolveSchema(\n schema,\n schemaPath,\n context?.rootSchema\n );\n }\n currentDataSchema = get(currentDataSchema, subPath);\n\n if (currentDataSchema === undefined) {\n return false;\n }\n\n return predicate(currentDataSchema, context?.rootSchema);\n };\n\n/**\n * Only applicable for Controls.\n *\n * This function checks whether the given UI schema is of type Control\n * and if so, resolves the sub-schema referenced by the control and checks\n * whether the type of the sub-schema matches the expected one.\n *\n * @param {string} expectedType the expected type of the resolved sub-schema\n */\nexport const schemaTypeIs = (expectedType: string): Tester =>\n schemaMatches((schema) => !isEmpty(schema) && hasType(schema, expectedType));\n\n/**\n * Only applicable for Controls.\n *\n * This function checks whether the given UI schema is of type Control\n * and if so, resolves the sub-schema referenced by the control and checks\n * whether the format of the sub-schema matches the expected one.\n *\n * @param {string} expectedFormat the expected format of the resolved sub-schema\n */\nexport const formatIs = (expectedFormat: string): Tester =>\n schemaMatches(\n (schema) =>\n !isEmpty(schema) &&\n schema.format === expectedFormat &&\n hasType(schema, 'string')\n );\n\n/**\n * Checks whether the given UI schema has the expected type.\n *\n * @param {string} expected the expected UI schema type\n */\nexport const uiTypeIs =\n (expected: string): Tester =>\n (uischema: UISchemaElement): boolean =>\n !isEmpty(uischema) && uischema.type === expected;\n\n/**\n * Checks whether the given UI schema has an option with the given\n * name and whether it has the expected value. If no options property\n * is set, returns false.\n *\n * @param {string} optionName the name of the option to check\n * @param {any} optionValue the expected value of the option\n */\nexport const optionIs =\n (optionName: string, optionValue: any): Tester =>\n (uischema: UISchemaElement): boolean => {\n if (isEmpty(uischema)) {\n return false;\n }\n\n const options = uischema.options;\n return !isEmpty(options) && options[optionName] === optionValue;\n };\n\n/**\n * Only applicable for Controls.\n *\n * Checks whether the scope of a control ends with the expected string.\n *\n * @param {string} expected the expected ending of the reference\n */\nexport const scopeEndsWith =\n (expected: string): Tester =>\n (uischema: UISchemaElement): boolean => {\n if (isEmpty(expected) || !isControl(uischema)) {\n return false;\n }\n\n return endsWith(uischema.scope, expected);\n };\n\n/**\n * Only applicable for Controls.\n *\n * Checks whether the last segment of the scope matches the expected string.\n *\n * @param {string} expected the expected ending of the reference\n */\nexport const scopeEndIs =\n (expected: string): Tester =>\n (uischema: UISchemaElement): boolean => {\n if (isEmpty(expected) || !isControl(uischema)) {\n return false;\n }\n const schemaPath = uischema.scope;\n\n return !isEmpty(schemaPath) && last(schemaPath.split('/')) === expected;\n };\n\n/**\n * A tester that allow composing other testers by && them.\n *\n * @param {Array} testers the testers to be composed\n */\nexport const and =\n (...testers: Tester[]): Tester =>\n (uischema: UISchemaElement, schema: JsonSchema, context: TesterContext) =>\n testers.reduce(\n (acc, tester) => acc && tester(uischema, schema, context),\n true\n );\n\n/**\n * A tester that allow composing other testers by || them.\n *\n * @param {Array} testers the testers to be composed\n */\nexport const or =\n (...testers: Tester[]): Tester =>\n (uischema: UISchemaElement, schema: JsonSchema, context: TesterContext) =>\n testers.reduce(\n (acc, tester) => acc || tester(uischema, schema, context),\n false\n );\n/**\n * Create a ranked tester that will associate a number with a given tester, if the\n * latter returns true.\n *\n * @param {number} rank the rank to be returned in case the tester returns true\n * @param {Tester} tester a tester\n */\nexport const rankWith =\n (rank: number, tester: Tester) =>\n (\n uischema: UISchemaElement,\n schema: JsonSchema,\n context: TesterContext\n ): number => {\n if (tester(uischema, schema, context)) {\n return rank;\n }\n\n return NOT_APPLICABLE;\n };\n\nexport const withIncreasedRank =\n (by: number, rankedTester: RankedTester) =>\n (\n uischema: UISchemaElement,\n schema: JsonSchema,\n context: TesterContext\n ): number => {\n const rank = rankedTester(uischema, schema, context);\n if (rank === NOT_APPLICABLE) {\n return NOT_APPLICABLE;\n }\n\n return rank + by;\n };\n\n/**\n * Default tester for boolean.\n * @type {RankedTester}\n */\nexport const isBooleanControl = and(\n uiTypeIs('Control'),\n schemaTypeIs('boolean')\n);\n\n// TODO: rather check for properties property\nexport const isObjectControl = and(uiTypeIs('Control'), schemaTypeIs('object'));\n\nexport const isAllOfControl = and(\n uiTypeIs('Control'),\n schemaMatches((schema) =>\n Object.prototype.hasOwnProperty.call(schema, 'allOf')\n )\n);\n\nexport const isAnyOfControl = and(\n uiTypeIs('Control'),\n schemaMatches((schema) =>\n Object.prototype.hasOwnProperty.call(schema, 'anyOf')\n )\n);\n\nexport const isOneOfControl = and(\n uiTypeIs('Control'),\n schemaMatches((schema) =>\n Object.prototype.hasOwnProperty.call(schema, 'oneOf')\n )\n);\n\n/**\n * Tests whether the given UI schema is of type Control and if the schema\n * has an enum.\n * @type {Tester}\n */\nexport const isEnumControl = and(\n uiTypeIs('Control'),\n or(\n schemaMatches((schema) =>\n Object.prototype.hasOwnProperty.call(schema, 'enum')\n ),\n schemaMatches((schema) =>\n Object.prototype.hasOwnProperty.call(schema, 'const')\n )\n )\n);\n\n/**\n * Tests whether the given UI schema is of type Control and if the schema\n * has an enum based on oneOf.\n * @type {Tester}\n */\nexport const isOneOfEnumControl = and(\n uiTypeIs('Control'),\n schemaMatches((schema) => isOneOfEnumSchema(schema))\n);\n\n/**\n * Tests whether the given UI schema is of type Control and if the schema\n * is of type integer\n * @type {Tester}\n */\nexport const isIntegerControl = and(\n uiTypeIs('Control'),\n schemaTypeIs('integer')\n);\n\n/**\n * Tests whether the given UI schema is of type Control and if the schema\n * is of type number\n * @type {Tester}\n */\nexport const isNumberControl = and(uiTypeIs('Control'), schemaTypeIs('number'));\n\n/**\n * Tests whether the given UI schema is of type Control and if the schema\n * is of type string\n * @type {Tester}\n */\nexport const isStringControl = and(uiTypeIs('Control'), schemaTypeIs('string'));\n\n/**\n * Tests whether the given UI schema is of type Control and if is has\n * a 'multi' option.\n * @type {Tester}\n */\nexport const isMultiLineControl = and(\n uiTypeIs('Control'),\n optionIs('multi', true)\n);\n\n/**\n * Tests whether the given UI schema is of type Control and whether the schema\n * or uischema options has a 'date' format.\n * @type {Tester}\n */\nexport const isDateControl = and(\n uiTypeIs('Control'),\n or(formatIs('date'), optionIs('format', 'date'))\n);\n\n/**\n * Tests whether the given UI schema is of type Control and whether the schema\n * or the uischema options has a 'time' format.\n * @type {Tester}\n */\nexport const isTimeControl = and(\n uiTypeIs('Control'),\n or(formatIs('time'), optionIs('format', 'time'))\n);\n\n/**\n * Tests whether the given UI schema is of type Control and whether the schema\n * or the uischema options has a 'date-time' format.\n * @type {Tester}\n */\nexport const isDateTimeControl = and(\n uiTypeIs('Control'),\n or(formatIs('date-time'), optionIs('format', 'date-time'))\n);\n\n/**\n * Tests whether the given schema is an array of objects.\n * @type {Tester}\n */\nexport const isObjectArray = and(\n schemaMatches(\n (schema, rootSchema) =>\n hasType(schema, 'array') &&\n !Array.isArray(resolveSchema(schema, 'items', rootSchema)) // we don't care about tuples\n ),\n schemaSubPathMatches('items', (schema, rootSchema) => {\n const resolvedSchema = schema.$ref\n ? resolveSchema(rootSchema, schema.$ref, rootSchema)\n : schema;\n return hasType(resolvedSchema, 'object');\n })\n);\n\n/**\n * Tests whether the given UI schema is of type Control and if the schema\n * is an array of objects.\n * @type {Tester}\n */\nexport const isObjectArrayControl = and(uiTypeIs('Control'), isObjectArray);\n\nconst traverse = (\n any: JsonSchema | JsonSchema[],\n pred: (obj: JsonSchema) => boolean,\n rootSchema: JsonSchema\n): boolean => {\n if (isArray(any)) {\n return reduce(\n any,\n (acc, el) => acc || traverse(el, pred, rootSchema),\n false\n );\n }\n\n if (pred(any)) {\n return true;\n }\n\n if (any.$ref) {\n const toTraverse = resolveSchema(rootSchema, any.$ref, rootSchema);\n if (toTraverse && !toTraverse.$ref) {\n return traverse(toTraverse, pred, rootSchema);\n }\n }\n\n if (any.items) {\n return traverse(any.items, pred, rootSchema);\n }\n if (any.properties) {\n return reduce(\n toPairs(any.properties),\n (acc, [_key, val]) => acc || traverse(val, pred, rootSchema),\n false\n );\n }\n\n return false;\n};\n\nexport const isObjectArrayWithNesting = (\n uischema: UISchemaElement,\n schema: JsonSchema,\n context: TesterContext\n): boolean => {\n if (!uiTypeIs('Control')(uischema, schema, context)) {\n return false;\n }\n const schemaPath = (uischema as ControlElement).scope;\n const resolvedSchema = resolveSchema(\n schema,\n schemaPath,\n context?.rootSchema ?? schema\n );\n let objectDepth = 0;\n if (resolvedSchema !== undefined && resolvedSchema.items !== undefined) {\n // check if nested arrays\n if (\n traverse(\n resolvedSchema.items,\n (val) => {\n if (val === schema) {\n return false;\n }\n if (val.$ref !== undefined) {\n return false;\n }\n if (val.anyOf || val.allOf) {\n return true;\n }\n if (val.oneOf && !isOneOfEnumSchema(val)) {\n return true;\n }\n if (hasType(val, 'object')) {\n objectDepth++;\n if (objectDepth === 2) {\n return true;\n }\n }\n if (hasType(val, 'array')) {\n return true;\n }\n return false;\n },\n context?.rootSchema\n )\n ) {\n return true;\n }\n // check if uischema options detail is set\n if (uischema.options && uischema.options.detail) {\n if (typeof uischema.options.detail === 'string') {\n return uischema.options.detail.toUpperCase() !== 'DEFAULT';\n } else if (\n typeof uischema.options.detail === 'object' &&\n uischema.options.detail.type\n ) {\n return true;\n }\n }\n }\n return false;\n};\n\n/**\n * Synonym for isObjectArrayControl\n */\nexport const isArrayObjectControl = isObjectArrayControl;\n\n/**\n * Tests whether the given UI schema is of type Control and if the schema\n * is an array of a primitive type.\n * @type {Tester}\n */\nexport const isPrimitiveArrayControl = and(\n uiTypeIs('Control'),\n schemaMatches(\n (schema, rootSchema) =>\n deriveTypes(schema).length !== 0 &&\n !Array.isArray(resolveSchema(schema, 'items', rootSchema)) // we don't care about tuples\n ),\n schemaSubPathMatches('items', (schema, rootSchema) => {\n const resolvedSchema = schema.$ref\n ? resolveSchema(rootSchema, schema.$ref, rootSchema)\n : schema;\n const types = deriveTypes(resolvedSchema);\n return (\n types.length === 1 &&\n includes(['integer', 'number', 'boolean', 'string'], types[0])\n );\n })\n);\n\n/**\n * Tests whether a given UI schema is of type Control,\n * if the schema is of type number or integer and\n * whether the schema defines a numerical range with a default value.\n * @type {Tester}\n */\nexport const isRangeControl = and(\n uiTypeIs('Control'),\n or(schemaTypeIs('number'), schemaTypeIs('integer')),\n schemaMatches(\n (schema) =>\n Object.prototype.hasOwnProperty.call(schema, 'maximum') &&\n Object.prototype.hasOwnProperty.call(schema, 'minimum') &&\n Object.prototype.hasOwnProperty.call(schema, 'default')\n ),\n optionIs('slider', true)\n);\n\n/**\n * Tests whether the given UI schema is of type Control, if the schema\n * is of type integer and has option format\n * @type {Tester}\n */\nexport const isNumberFormatControl = and(\n uiTypeIs('Control'),\n schemaTypeIs('integer'),\n optionIs('format', true)\n);\n\nexport const isCategorization = (\n category: UISchemaElement\n): category is Categorization => category.type === 'Categorization';\n\nexport const isCategory = (uischema: UISchemaElement): boolean =>\n uischema.type === 'Category';\n\nexport const hasCategory = (categorization: Categorization): boolean => {\n if (isEmpty(categorization.elements)) {\n return false;\n }\n // all children of the categorization have to be categories\n return categorization.elements\n .map((elem) =>\n isCategorization(elem) ? hasCategory(elem) : isCategory(elem)\n )\n .reduce((prev, curr) => prev && curr, true);\n};\n\nexport const categorizationHasCategory = (uischema: UISchemaElement) =>\n hasCategory(uischema as Categorization);\n\nexport const not =\n (tester: Tester): Tester =>\n (uischema: UISchemaElement, schema: JsonSchema, context: TesterContext) =>\n !tester(uischema, schema, context);\n","/*\n The MIT License\n \n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport maxBy from 'lodash/maxBy';\nimport remove from 'lodash/remove';\nimport { ADD_UI_SCHEMA, REMOVE_UI_SCHEMA, UISchemaActions } from '../actions';\nimport { NOT_APPLICABLE } from '../testers';\nimport type { JsonSchema, UISchemaElement } from '../models';\nimport type { Reducer } from '../util';\n\nexport type UISchemaTester = (\n schema: JsonSchema,\n schemaPath: string,\n path: string\n) => number;\n\nexport interface JsonFormsUISchemaRegistryEntry {\n tester: UISchemaTester;\n uischema: UISchemaElement;\n}\n\nexport const uischemaRegistryReducer: Reducer<\n JsonFormsUISchemaRegistryEntry[],\n UISchemaActions\n> = (state = [], action) => {\n switch (action.type) {\n case ADD_UI_SCHEMA:\n return state\n .slice()\n .concat({ tester: action.tester, uischema: action.uischema });\n case REMOVE_UI_SCHEMA: {\n const copy = state.slice();\n remove(copy, (entry) => entry.tester === action.tester);\n return copy;\n }\n default:\n return state;\n }\n};\n\nexport const findMatchingUISchema =\n (state: JsonFormsUISchemaRegistryEntry[]) =>\n (\n jsonSchema: JsonSchema,\n schemaPath: string,\n path: string\n ): UISchemaElement => {\n const match = maxBy(state, (entry) =>\n entry.tester(jsonSchema, schemaPath, path)\n );\n if (\n match !== undefined &&\n match.tester(jsonSchema, schemaPath, path) !== NOT_APPLICABLE\n ) {\n return match.uischema;\n }\n return undefined;\n };\n","/*\n The MIT License\n \n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport type { ControlElement, UISchemaElement } from '../models';\nimport { coreReducer, errorAt, subErrorsAt } from './core';\nimport { defaultDataReducer } from './default-data';\nimport { rendererReducer } from './renderers';\nimport type { JsonFormsState } from '../store';\nimport type { JsonFormsUISchemaRegistryEntry } from './uischemas';\nimport { findMatchingUISchema, uischemaRegistryReducer } from './uischemas';\nimport { fetchErrorTranslator, fetchLocale, i18nReducer } from './i18n';\n\nimport { Generate } from '../generators';\nimport type { JsonSchema } from '../models/jsonSchema';\n\nimport { cellReducer } from './cells';\nimport { configReducer } from './config';\nimport get from 'lodash/get';\nimport { fetchTranslator } from '.';\nimport type { ErrorTranslator, Translator } from '../i18n';\n\nexport const jsonFormsReducerConfig = {\n core: coreReducer,\n renderers: rendererReducer,\n cells: cellReducer,\n config: configReducer,\n uischemas: uischemaRegistryReducer,\n defaultData: defaultDataReducer,\n i18n: i18nReducer,\n};\n\n/**\n * Finds a registered UI schema to use, if any.\n * @param schema the JSON schema describing the data to be rendered\n * @param schemaPath the according schema path\n * @param path the instance path\n * @param fallback the type of the layout to use or a UI-schema-generator function\n * @param control may be checked for embedded inline uischema options\n */\nexport const findUISchema = (\n uischemas: JsonFormsUISchemaRegistryEntry[],\n schema: JsonSchema,\n schemaPath: string,\n path: string,\n fallback: string | (() => UISchemaElement) = 'VerticalLayout',\n control?: ControlElement,\n rootSchema?: JsonSchema\n): UISchemaElement => {\n // handle options\n if (control && control.options && control.options.detail) {\n if (typeof control.options.detail === 'string') {\n if (control.options.detail.toUpperCase() === 'GENERATE') {\n //use fallback generation function\n if (typeof fallback === 'function') {\n return fallback();\n }\n // force generation of uischema\n return Generate.uiSchema(schema, fallback, undefined, rootSchema);\n }\n } else if (typeof control.options.detail === 'object') {\n // check if detail is a valid uischema\n if (\n control.options.detail.type &&\n typeof control.options.detail.type === 'string'\n ) {\n return control.options.detail as UISchemaElement;\n }\n }\n }\n // default\n const uiSchema = findMatchingUISchema(uischemas)(schema, schemaPath, path);\n if (uiSchema === undefined) {\n //use fallback generation function\n if (typeof fallback === 'function') {\n return fallback();\n }\n return Generate.uiSchema(schema, fallback, '#', rootSchema);\n }\n return uiSchema;\n};\n\nexport const getErrorAt =\n (instancePath: string, schema: JsonSchema) => (state: JsonFormsState) => {\n return errorAt(instancePath, schema)(state.jsonforms.core);\n };\n\nexport const getSubErrorsAt =\n (instancePath: string, schema: JsonSchema) => (state: JsonFormsState) =>\n subErrorsAt(instancePath, schema)(state.jsonforms.core);\n\nexport const getConfig = (state: JsonFormsState) => state.jsonforms.config;\n\nexport const getLocale = (state: JsonFormsState) =>\n fetchLocale(get(state, 'jsonforms.i18n'));\n\nexport const getTranslator =\n () =>\n (state: JsonFormsState): Translator =>\n fetchTranslator(get(state, 'jsonforms.i18n'));\n\nexport const getErrorTranslator =\n () =>\n (state: JsonFormsState): ErrorTranslator =>\n fetchErrorTranslator(get(state, 'jsonforms.i18n'));\n","/*\n The MIT License\n \n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport get from 'lodash/get';\nimport type Ajv from 'ajv';\nimport type { JsonFormsState } from '../store';\nimport type { JsonSchema, UISchemaElement } from '../models';\nimport {\n extractAjv,\n extractData,\n extractSchema,\n extractUiSchema,\n} from './core';\nimport {\n extractDefaultData,\n JsonFormsDefaultDataRegistryEntry,\n} from './default-data';\nimport type { JsonFormsRendererRegistryEntry } from './renderers';\nimport type { JsonFormsCellRendererRegistryEntry } from './cells';\nimport type { JsonFormsUISchemaRegistryEntry } from './uischemas';\n\nexport const getData = (state: JsonFormsState) =>\n extractData(get(state, 'jsonforms.core'));\nexport const getSchema = (state: JsonFormsState): JsonSchema =>\n extractSchema(get(state, 'jsonforms.core'));\nexport const getUiSchema = (state: JsonFormsState): UISchemaElement =>\n extractUiSchema(get(state, 'jsonforms.core'));\nexport const getAjv = (state: JsonFormsState): Ajv =>\n extractAjv(get(state, 'jsonforms.core'));\nexport const getDefaultData = (\n state: JsonFormsState\n): JsonFormsDefaultDataRegistryEntry[] =>\n extractDefaultData(get(state, 'jsonforms.defaultData'));\nexport const getRenderers = (\n state: JsonFormsState\n): JsonFormsRendererRegistryEntry[] => get(state, 'jsonforms.renderers');\nexport const getCells = (\n state: JsonFormsState\n): JsonFormsCellRendererRegistryEntry[] => get(state, 'jsonforms.cells');\nexport const getUISchemas = (\n state: JsonFormsState\n): JsonFormsUISchemaRegistryEntry[] => get(state, 'jsonforms.uischemas');\n","/*\n The MIT License\n\n Copyright (c) 2023 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\nimport { CoreActions } from '../actions';\nimport { JsonFormsCore } from './core';\n\nexport interface Middleware {\n (\n state: JsonFormsCore,\n action: CoreActions,\n defaultReducer: (state: JsonFormsCore, action: CoreActions) => JsonFormsCore\n ): JsonFormsCore;\n}\nexport const defaultMiddleware: Middleware = (state, action, defaultReducer) =>\n defaultReducer(state, action);\n","/*\n The MIT License\n \n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport isEmpty from 'lodash/isEmpty';\nimport range from 'lodash/range';\nimport { isScoped, Scopable } from '../models';\n\nexport const compose = (path1: string, path2: string) => {\n let p1 = path1;\n if (!isEmpty(path1) && !isEmpty(path2) && !path2.startsWith('[')) {\n p1 = path1 + '.';\n }\n\n if (isEmpty(p1)) {\n return path2;\n } else if (isEmpty(path2)) {\n return p1;\n } else {\n return `${p1}${path2}`;\n }\n};\n\nexport { compose as composePaths };\n\n/**\n * Convert a schema path (i.e. JSON pointer) to an array by splitting\n * at the '/' character and removing all schema-specific keywords.\n *\n * The returned value can be used to de-reference a root object by folding over it\n * and de-referencing the single segments to obtain a new object.\n *\n *\n * @param {string} schemaPath the schema path to be converted\n * @returns {string[]} an array containing only non-schema-specific segments\n */\nexport const toDataPathSegments = (schemaPath: string): string[] => {\n const s = schemaPath\n .replace(/(anyOf|allOf|oneOf)\\/[\\d]+\\//g, '')\n .replace(/(then|else)\\//g, '');\n const segments = s.split('/');\n\n const decodedSegments = segments.map(decode);\n\n const startFromRoot = decodedSegments[0] === '#' || decodedSegments[0] === '';\n const startIndex = startFromRoot ? 2 : 1;\n return range(startIndex, decodedSegments.length, 2).map(\n (idx) => decodedSegments[idx]\n );\n};\n\n/**\n * Convert a schema path (i.e. JSON pointer) to a data path.\n *\n * Data paths can be used in field change event handlers like handleChange.\n *\n * @example\n * toDataPath('#/properties/foo/properties/bar') === 'foo.bar')\n *\n * @param {string} schemaPath the schema path to be converted\n * @returns {string} the data path\n */\nexport const toDataPath = (schemaPath: string): string => {\n return toDataPathSegments(schemaPath).join('.');\n};\n\nexport const composeWithUi = (scopableUi: Scopable, path: string): string => {\n if (!isScoped(scopableUi)) {\n return path ?? '';\n }\n\n const segments = toDataPathSegments(scopableUi.scope);\n\n if (isEmpty(segments)) {\n return path ?? '';\n }\n\n return compose(path, segments.join('.'));\n};\n\n/**\n * Encodes the given segment to be used as part of a JSON Pointer\n *\n * JSON Pointer has special meaning for \"/\" and \"~\", therefore these must be encoded\n */\nexport const encode = (segment: string) =>\n segment?.replace(/~/g, '~0').replace(/\\//g, '~1');\n/**\n * Decodes a given JSON Pointer segment to its \"normal\" representation\n */\nexport const decode = (pointerSegment: string) =>\n pointerSegment?.replace(/~1/g, '/').replace(/~0/, '~');\n","/*\n The MIT License\n\n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport isEmpty from 'lodash/isEmpty';\nimport get from 'lodash/get';\nimport type { JsonSchema, JsonSchema7 } from '../models';\nimport { decode } from './path';\n\n/**\n * Map for storing refs and the respective schemas they are pointing to.\n */\nexport interface ReferenceSchemaMap {\n [ref: string]: JsonSchema;\n}\n\nconst isObjectSchema = (schema: JsonSchema): boolean => {\n return schema.properties !== undefined;\n};\nconst isArraySchema = (schema: JsonSchema): boolean => {\n return schema.type === 'array' && schema.items !== undefined;\n};\n\nexport const resolveData = (instance: any, dataPath: string): any => {\n if (isEmpty(dataPath)) {\n return instance;\n }\n const dataPathSegments = dataPath.split('.');\n\n return dataPathSegments.reduce((curInstance, decodedSegment) => {\n if (\n !curInstance ||\n !Object.prototype.hasOwnProperty.call(curInstance, decodedSegment)\n ) {\n return undefined;\n }\n\n return curInstance[decodedSegment];\n }, instance);\n};\n\n/**\n * Finds all references inside the given schema.\n *\n * @param schema The {@link JsonSchema} to find the references in\n * @param result The initial result map, default: empty map (this parameter is used for recursion\n * inside the function)\n * @param resolveTuples Whether arrays of tuples should be considered; default: false\n */\nexport const findAllRefs = (\n schema: JsonSchema,\n result: ReferenceSchemaMap = {},\n resolveTuples = false\n): ReferenceSchemaMap => {\n if (isObjectSchema(schema)) {\n Object.keys(schema.properties).forEach((key) =>\n findAllRefs(schema.properties[key], result)\n );\n }\n if (isArraySchema(schema)) {\n if (Array.isArray(schema.items)) {\n if (resolveTuples) {\n const items: JsonSchema[] = schema.items;\n items.forEach((child) => findAllRefs(child, result));\n }\n } else {\n findAllRefs(schema.items, result);\n }\n }\n if (Array.isArray(schema.anyOf)) {\n const anyOf: JsonSchema[] = schema.anyOf;\n anyOf.forEach((child) => findAllRefs(child, result));\n }\n if (schema.$ref !== undefined) {\n result[schema.$ref] = schema;\n }\n\n return result;\n};\n\nconst invalidSegment = (pathSegment: string) =>\n pathSegment === '#' || pathSegment === undefined || pathSegment === '';\n\n/**\n * Resolve the given schema path in order to obtain a subschema.\n * @param {JsonSchema} schema the root schema from which to start\n * @param {string} schemaPath the schema path to be resolved\n * @param {JsonSchema} rootSchema the actual root schema\n * @returns {JsonSchema} the resolved sub-schema\n */\nexport const resolveSchema = (\n schema: JsonSchema,\n schemaPath: string,\n rootSchema: JsonSchema\n): JsonSchema => {\n const segments = schemaPath?.split('/').map(decode);\n return resolveSchemaWithSegments(schema, segments, rootSchema);\n};\n\nconst resolveSchemaWithSegments = (\n schema: JsonSchema,\n pathSegments: string[],\n rootSchema: JsonSchema\n): JsonSchema => {\n if (isEmpty(schema)) {\n return undefined;\n }\n\n if (schema.$ref) {\n schema = resolveSchema(rootSchema, schema.$ref, rootSchema);\n }\n\n if (!pathSegments || pathSegments.length === 0) {\n return schema;\n }\n\n const [segment, ...remainingSegments] = pathSegments;\n\n if (invalidSegment(segment)) {\n return resolveSchemaWithSegments(schema, remainingSegments, rootSchema);\n }\n\n const singleSegmentResolveSchema = get(schema, segment);\n\n const resolvedSchema = resolveSchemaWithSegments(\n singleSegmentResolveSchema,\n remainingSegments,\n rootSchema\n );\n if (resolvedSchema) {\n return resolvedSchema;\n }\n\n if (segment === 'properties' || segment === 'items') {\n // Let's try to resolve the path, assuming oneOf/allOf/anyOf/then/else was omitted.\n // We only do this when traversing an object or array as we want to avoid\n // following a property which is named oneOf, allOf, anyOf, then or else.\n let alternativeResolveResult = undefined;\n\n const subSchemas = [].concat(\n schema.oneOf ?? [],\n schema.allOf ?? [],\n schema.anyOf ?? [],\n (schema as JsonSchema7).then ?? [],\n (schema as JsonSchema7).else ?? []\n );\n\n for (const subSchema of subSchemas) {\n alternativeResolveResult = resolveSchemaWithSegments(\n subSchema,\n [segment, ...remainingSegments],\n rootSchema\n );\n if (alternativeResolveResult) {\n break;\n }\n }\n return alternativeResolveResult;\n }\n\n return undefined;\n};\n","/*\n The MIT License\n\n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport has from 'lodash/has';\nimport {\n AndCondition,\n Condition,\n JsonSchema,\n LeafCondition,\n OrCondition,\n RuleEffect,\n SchemaBasedCondition,\n Scopable,\n UISchemaElement,\n} from '../models';\nimport { resolveData } from './resolvers';\nimport { composeWithUi } from './path';\nimport type Ajv from 'ajv';\nimport { getAjv } from '../reducers';\nimport type { JsonFormsState } from '../store';\n\nconst isOrCondition = (condition: Condition): condition is OrCondition =>\n condition.type === 'OR';\n\nconst isAndCondition = (condition: Condition): condition is AndCondition =>\n condition.type === 'AND';\n\nconst isLeafCondition = (condition: Condition): condition is LeafCondition =>\n condition.type === 'LEAF';\n\nconst isSchemaCondition = (\n condition: Condition\n): condition is SchemaBasedCondition => has(condition, 'schema');\n\nconst getConditionScope = (condition: Scopable, path: string): string => {\n return composeWithUi(condition, path);\n};\n\nconst evaluateCondition = (\n data: any,\n condition: Condition,\n path: string,\n ajv: Ajv\n): boolean => {\n if (isAndCondition(condition)) {\n return condition.conditions.reduce(\n (acc, cur) => acc && evaluateCondition(data, cur, path, ajv),\n true\n );\n } else if (isOrCondition(condition)) {\n return condition.conditions.reduce(\n (acc, cur) => acc || evaluateCondition(data, cur, path, ajv),\n false\n );\n } else if (isLeafCondition(condition)) {\n const value = resolveData(data, getConditionScope(condition, path));\n return value === condition.expectedValue;\n } else if (isSchemaCondition(condition)) {\n const value = resolveData(data, getConditionScope(condition, path));\n if (condition.failWhenUndefined && value === undefined) {\n return false;\n }\n return ajv.validate(condition.schema, value) as boolean;\n } else {\n // unknown condition\n return true;\n }\n};\n\nconst isRuleFulfilled = (\n uischema: UISchemaElement,\n data: any,\n path: string,\n ajv: Ajv\n): boolean => {\n const condition = uischema.rule.condition;\n return evaluateCondition(data, condition, path, ajv);\n};\n\nexport const evalVisibility = (\n uischema: UISchemaElement,\n data: any,\n path: string = undefined,\n ajv: Ajv\n): boolean => {\n const fulfilled = isRuleFulfilled(uischema, data, path, ajv);\n\n switch (uischema.rule.effect) {\n case RuleEffect.HIDE:\n return !fulfilled;\n case RuleEffect.SHOW:\n return fulfilled;\n // visible by default\n default:\n return true;\n }\n};\n\nexport const evalEnablement = (\n uischema: UISchemaElement,\n data: any,\n path: string = undefined,\n ajv: Ajv\n): boolean => {\n const fulfilled = isRuleFulfilled(uischema, data, path, ajv);\n\n switch (uischema.rule.effect) {\n case RuleEffect.DISABLE:\n return !fulfilled;\n case RuleEffect.ENABLE:\n return fulfilled;\n // enabled by default\n default:\n return true;\n }\n};\n\nexport const hasShowRule = (uischema: UISchemaElement): boolean => {\n if (\n uischema.rule &&\n (uischema.rule.effect === RuleEffect.SHOW ||\n uischema.rule.effect === RuleEffect.HIDE)\n ) {\n return true;\n }\n return false;\n};\n\nexport const hasEnableRule = (uischema: UISchemaElement): boolean => {\n if (\n uischema.rule &&\n (uischema.rule.effect === RuleEffect.ENABLE ||\n uischema.rule.effect === RuleEffect.DISABLE)\n ) {\n return true;\n }\n return false;\n};\n\nexport const isVisible = (\n uischema: UISchemaElement,\n data: any,\n path: string = undefined,\n ajv: Ajv\n): boolean => {\n if (uischema.rule) {\n return evalVisibility(uischema, data, path, ajv);\n }\n\n return true;\n};\n\nexport const isEnabled = (\n uischema: UISchemaElement,\n data: any,\n path: string = undefined,\n ajv: Ajv\n): boolean => {\n if (uischema.rule) {\n return evalEnablement(uischema, data, path, ajv);\n }\n\n return true;\n};\n\n/**\n * Indicates whether the given `uischema` element shall be enabled or disabled.\n * Checks the global readonly flag, uischema rule, uischema options (including the config),\n * the schema and the enablement indicator of the parent.\n */\nexport const isInherentlyEnabled = (\n state: JsonFormsState,\n ownProps: any,\n uischema: UISchemaElement,\n schema: (JsonSchema & { readOnly?: boolean }) | undefined,\n rootData: any,\n config: any\n) => {\n if (state?.jsonforms?.readonly) {\n return false;\n }\n if (uischema && hasEnableRule(uischema)) {\n return isEnabled(uischema, rootData, ownProps?.path, getAjv(state));\n }\n if (typeof uischema?.options?.readonly === 'boolean') {\n return !uischema.options.readonly;\n }\n if (typeof uischema?.options?.readOnly === 'boolean') {\n return !uischema.options.readOnly;\n }\n if (typeof config?.readonly === 'boolean') {\n return !config.readonly;\n }\n if (typeof config?.readOnly === 'boolean') {\n return !config.readOnly;\n }\n if (schema?.readOnly === true) {\n return false;\n }\n if (typeof ownProps?.enabled === 'boolean') {\n return ownProps.enabled;\n }\n return true;\n};\n","/*\n The MIT License\n \n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport isEmpty from 'lodash/isEmpty';\nimport isArray from 'lodash/isArray';\nimport includes from 'lodash/includes';\nimport find from 'lodash/find';\nimport type { JsonSchema, Scoped, UISchemaElement } from '..';\nimport { resolveData, resolveSchema } from './resolvers';\nimport { composePaths, toDataPathSegments } from './path';\nimport { isEnabled, isVisible } from './runtime';\nimport type Ajv from 'ajv';\n\n/**\n * Returns the string representation of the given date. The format of the output string can be specified:\n * - 'date' for a date-only string (YYYY-MM-DD),\n * - 'time' for a time-only string (HH:mm:ss), or\n * - 'date-time' for a full date-time string in ISO format (YYYY-MM-DDTHH:mm:ss.sssZ).\n * If no format is specified, the full date-time ISO string is returned by default.\n *\n * @returns {string} A string representation of the date in the specified format.\n *\n * @example\n * // returns '2023-11-09'\n * convertDateToString(new Date('2023-11-09T14:22:54.131Z'), 'date');\n *\n * @example\n * // returns '14:22:54'\n * convertDateToString(new Date('2023-11-09T14:22:54.131Z'), 'time');\n *\n * @example\n * // returns '2023-11-09T14:22:54.131Z'\n * convertDateToString(new Date('2023-11-09T14:22:54.131Z'), 'date-time');\n *\n * @example\n * // returns '2023-11-09T14:22:54.131Z'\n * convertDateToString(new Date('2023-11-09T14:22:54.131Z'));\n */\nexport const convertDateToString = (\n date: Date,\n format?: 'date' | 'time' | 'date-time'\n): string => {\n //e.g. '2023-11-09T14:22:54.131Z'\n const dateString = date.toISOString();\n if (format === 'date-time') {\n return dateString;\n } else if (format === 'date') {\n // e.g. '2023-11-09'\n return dateString.split('T')[0];\n } else if (format === 'time') {\n //e.g. '14:22:54'\n return dateString.split('T')[1].split('.')[0];\n }\n return dateString;\n};\n\n/**\n * Escape the given string such that it can be used as a class name,\n * i.e. hashes and slashes will be replaced.\n *\n * @param {string} s the string that should be converted to a valid class name\n * @returns {string} the escaped string\n */\nexport const convertToValidClassName = (s: string): string =>\n s.replace('#', 'root').replace(new RegExp('/', 'g'), '_');\n\nexport const formatErrorMessage = (errors: string[]) => {\n if (errors === undefined || errors === null) {\n return '';\n }\n\n return errors.join('\\n');\n};\n\nexport const hasType = (jsonSchema: JsonSchema, expected: string): boolean => {\n return includes(deriveTypes(jsonSchema), expected);\n};\n\n/**\n * Derives the type of the jsonSchema element\n */\nexport const deriveTypes = (jsonSchema: JsonSchema): string[] => {\n if (isEmpty(jsonSchema)) {\n return [];\n }\n if (!isEmpty(jsonSchema.type) && typeof jsonSchema.type === 'string') {\n return [jsonSchema.type];\n }\n if (isArray(jsonSchema.type)) {\n return jsonSchema.type;\n }\n if (\n !isEmpty(jsonSchema.properties) ||\n !isEmpty(jsonSchema.additionalProperties)\n ) {\n return ['object'];\n }\n if (!isEmpty(jsonSchema.items)) {\n return ['array'];\n }\n if (!isEmpty(jsonSchema.enum)) {\n const types: Set = new Set();\n jsonSchema.enum.forEach((enumElement) => {\n if (typeof enumElement === 'string') {\n types.add('string');\n } else {\n deriveTypes(enumElement).forEach((type) => types.add(type));\n }\n });\n return Array.from(types);\n }\n if (!isEmpty(jsonSchema.allOf)) {\n const allOfType = find(\n jsonSchema.allOf,\n (schema: JsonSchema) => deriveTypes(schema).length !== 0\n );\n\n if (allOfType) {\n return deriveTypes(allOfType);\n }\n }\n // ignore all remaining cases\n return [];\n};\n\n/**\n * Convenience wrapper around resolveData and resolveSchema.\n */\nexport const Resolve: {\n schema(\n schema: JsonSchema,\n schemaPath: string,\n rootSchema: JsonSchema\n ): JsonSchema;\n data(data: any, path: string): any;\n} = {\n schema: resolveSchema,\n data: resolveData,\n};\n\n// Paths --\nconst fromScoped = (scopable: Scoped): string =>\n toDataPathSegments(scopable.scope).join('.');\n\nexport const Paths = {\n compose: composePaths,\n fromScoped,\n};\n\n// Runtime --\nexport const Runtime = {\n isEnabled(uischema: UISchemaElement, data: any, ajv: Ajv): boolean {\n return isEnabled(uischema, data, undefined, ajv);\n },\n isVisible(uischema: UISchemaElement, data: any, ajv: Ajv): boolean {\n return isVisible(uischema, data, undefined, ajv);\n },\n};\n","/*\n The MIT License\n \n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport startCase from 'lodash/startCase';\n\nimport type { ControlElement, JsonSchema, LabelDescription } from '../models';\nimport { decode } from './path';\n\nconst deriveLabel = (\n controlElement: ControlElement,\n schemaElement?: JsonSchema\n): string => {\n if (schemaElement && typeof schemaElement.title === 'string') {\n return schemaElement.title;\n }\n if (typeof controlElement.scope === 'string') {\n const ref = controlElement.scope;\n const label = decode(ref.substr(ref.lastIndexOf('/') + 1));\n return startCase(label);\n }\n\n return '';\n};\n\nexport const createCleanLabel = (label: string): string => {\n return startCase(label.replace('_', ' '));\n};\n\n/**\n * Return a label object based on the given control and schema element.\n * @param {ControlElement} withLabel the UI schema to obtain a label object for\n * @param {JsonSchema} schema optional: the corresponding schema element\n * @returns {LabelDescription}\n */\nexport const createLabelDescriptionFrom = (\n withLabel: ControlElement,\n schema?: JsonSchema\n): LabelDescription => {\n const labelProperty = withLabel.label;\n if (typeof labelProperty === 'boolean') {\n return labelDescription(deriveLabel(withLabel, schema), labelProperty);\n }\n if (typeof labelProperty === 'string') {\n return labelDescription(labelProperty, true);\n }\n if (typeof labelProperty === 'object') {\n const label =\n typeof labelProperty.text === 'string'\n ? labelProperty.text\n : deriveLabel(withLabel, schema);\n const show =\n typeof labelProperty.show === 'boolean' ? labelProperty.show : true;\n return labelDescription(label, show);\n }\n return labelDescription(deriveLabel(withLabel, schema), true);\n};\n\nconst labelDescription = (text: string, show: boolean): LabelDescription => ({\n text: text,\n show: show,\n});\n","/*\n The MIT License\n\n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport get from 'lodash/get';\nimport {\n ControlElement,\n isLabelable,\n JsonSchema,\n JsonSchema4,\n JsonSchema7,\n LabelElement,\n UISchemaElement,\n} from '../models';\nimport find from 'lodash/find';\nimport {\n getUISchemas,\n getAjv,\n getCells,\n getConfig,\n getData,\n getErrorAt,\n getErrorTranslator,\n getRenderers,\n getSchema,\n getSubErrorsAt,\n getTranslator,\n getUiSchema,\n} from '../reducers';\nimport type {\n JsonFormsCellRendererRegistryEntry,\n JsonFormsRendererRegistryEntry,\n JsonFormsUISchemaRegistryEntry,\n} from '../reducers';\nimport type { RankedTester } from '../testers';\nimport { hasShowRule, isInherentlyEnabled, isVisible } from './runtime';\nimport { createLabelDescriptionFrom } from './label';\nimport type { CombinatorKeyword } from './combinators';\nimport { moveDown, moveUp } from './array';\nimport type { AnyAction, Dispatch } from './type';\nimport { Resolve, convertDateToString, hasType } from './util';\nimport { composePaths, composeWithUi, toDataPath } from './path';\nimport { CoreActions, update } from '../actions';\nimport type { ErrorObject } from 'ajv';\nimport type { JsonFormsState } from '../store';\nimport {\n deriveLabelForUISchemaElement,\n getCombinedErrorMessage,\n getI18nKey,\n getI18nKeyPrefix,\n getI18nKeyPrefixBySchema,\n getArrayTranslations,\n Translator,\n CombinatorTranslations,\n getCombinatorTranslations,\n combinatorDefaultTranslations,\n} from '../i18n';\nimport {\n arrayDefaultTranslations,\n ArrayTranslations,\n} from '../i18n/arrayTranslations';\nimport { resolveSchema } from './resolvers';\nimport cloneDeep from 'lodash/cloneDeep';\nimport isEqual from 'lodash/isEqual';\nimport has from 'lodash/has';\nimport any from 'lodash/fp/any';\nimport all from 'lodash/fp/all';\n\nconst checkDataCondition = (\n propertyCondition: unknown,\n property: string,\n data: Record\n) => {\n if (has(propertyCondition, 'const')) {\n return (\n has(data, property) &&\n isEqual(data[property], get(propertyCondition, 'const'))\n );\n } else if (has(propertyCondition, 'enum')) {\n return (\n has(data, property) &&\n (get(propertyCondition, 'enum') as unknown[]).find((value) =>\n isEqual(value, data[property])\n ) !== undefined\n );\n } else if (has(propertyCondition, 'pattern')) {\n const pattern = new RegExp(get(propertyCondition, 'pattern'));\n\n return (\n has(data, property) &&\n typeof data[property] === 'string' &&\n pattern.test(data[property] as string)\n );\n }\n\n return false;\n};\n\nconst checkPropertyCondition = (\n propertiesCondition: Record,\n property: string,\n data: Record\n): boolean => {\n if (has(propertiesCondition[property], 'not')) {\n return !checkDataCondition(\n get(propertiesCondition[property], 'not'),\n property,\n data\n );\n }\n\n if (has(propertiesCondition[property], 'properties')) {\n const nextPropertyConditions = get(\n propertiesCondition[property],\n 'properties'\n );\n\n return all(\n (prop) =>\n checkPropertyCondition(\n nextPropertyConditions,\n prop,\n data[property] as Record\n ),\n Object.keys(nextPropertyConditions)\n );\n }\n\n return checkDataCondition(propertiesCondition[property], property, data);\n};\n\nconst evaluateCondition = (\n schema: JsonSchema,\n data: Record\n): boolean => {\n if (has(schema, 'allOf')) {\n return all(\n (subschema: JsonSchema) => evaluateCondition(subschema, data),\n get(schema, 'allOf')\n );\n }\n\n if (has(schema, 'anyOf')) {\n return any(\n (subschema: JsonSchema) => evaluateCondition(subschema, data),\n get(schema, 'anyOf')\n );\n }\n\n if (has(schema, 'oneOf')) {\n const subschemas = get(schema, 'oneOf');\n\n let satisfied = false;\n\n for (let i = 0; i < subschemas.length; i++) {\n const current = evaluateCondition(subschemas[i], data);\n if (current && satisfied) {\n return false;\n }\n\n if (current && !satisfied) {\n satisfied = true;\n }\n }\n\n return satisfied;\n }\n\n let requiredProperties: string[] = [];\n if (has(schema, 'required')) {\n requiredProperties = get(schema, 'required');\n }\n\n const requiredCondition = all(\n (property) => has(data, property),\n requiredProperties\n );\n\n if (has(schema, 'properties')) {\n const propertiesCondition = get(schema, 'properties') as Record<\n string,\n unknown\n >;\n\n const valueCondition = all(\n (property) => checkPropertyCondition(propertiesCondition, property, data),\n Object.keys(propertiesCondition)\n );\n\n return requiredCondition && valueCondition;\n }\n\n return requiredCondition;\n};\n\n/**\n * Go through parent's properties untill the segment is found at the exact level it is defined and check if it is required\n */\nconst extractRequired = (\n schema: JsonSchema,\n segment: string,\n prevSegments: string[]\n) => {\n let i = 0;\n let currentSchema = schema;\n while (\n i < prevSegments.length &&\n has(currentSchema, 'properties') &&\n has(get(currentSchema, 'properties'), prevSegments[i])\n ) {\n currentSchema = get(get(currentSchema, 'properties'), prevSegments[i]);\n ++i;\n }\n\n if (i < prevSegments.length) {\n return false;\n }\n\n return (\n has(currentSchema, 'required') &&\n (get(currentSchema, 'required') as string[]).includes(segment)\n );\n};\n\n/**\n * Check if property's required attribute is set based on if-then-else condition\n *\n */\nconst checkRequiredInIf = (\n schema: JsonSchema,\n segment: string,\n prevSegments: string[],\n data: Record\n): boolean => {\n const propertiesConditionSchema = get(schema, 'if');\n\n const condition = evaluateCondition(propertiesConditionSchema, data);\n\n const ifInThen = has(get(schema, 'then'), 'if');\n const ifInElse = has(get(schema, 'else'), 'if');\n const allOfInThen = has(get(schema, 'then'), 'allOf');\n const allOfInElse = has(get(schema, 'else'), 'allOf');\n\n return (\n (has(schema, 'then') &&\n condition &&\n extractRequired(get(schema, 'then'), segment, prevSegments)) ||\n (has(schema, 'else') &&\n !condition &&\n extractRequired(get(schema, 'else'), segment, prevSegments)) ||\n (ifInThen &&\n condition &&\n checkRequiredInIf(get(schema, 'then'), segment, prevSegments, data)) ||\n (ifInElse &&\n !condition &&\n checkRequiredInIf(get(schema, 'else'), segment, prevSegments, data)) ||\n (allOfInThen &&\n condition &&\n conditionallyRequired(\n get(schema, 'then'),\n segment,\n prevSegments,\n data\n )) ||\n (allOfInElse &&\n !condition &&\n conditionallyRequired(get(schema, 'else'), segment, prevSegments, data))\n );\n};\n\n/**\n * Check if property becomes required based on some if-then-else condition\n * that is part of allOf combinator\n */\nconst conditionallyRequired = (\n schema: JsonSchema,\n segment: string,\n prevSegments: string[],\n data: any\n) => {\n const nestedAllOfSchema = get(schema, 'allOf');\n\n return any((subschema: JsonSchema4 | JsonSchema7): boolean => {\n return (\n (has(subschema, 'if') &&\n checkRequiredInIf(subschema, segment, prevSegments, data)) ||\n conditionallyRequired(subschema, segment, prevSegments, data)\n );\n }, nestedAllOfSchema);\n};\n\n/**\n * Check if property is being required in the parent schema\n */\nconst isRequiredInParent = (\n schema: JsonSchema,\n rootSchema: JsonSchema,\n path: string,\n segment: string,\n prevSegments: string[],\n data: Record\n): boolean => {\n const pathSegments = path.split('/');\n const lastSegment = pathSegments[pathSegments.length - 3];\n const nextHigherSchemaSegments = pathSegments.slice(\n 0,\n pathSegments.length - 4\n );\n\n if (!nextHigherSchemaSegments.length) {\n return false;\n }\n\n const nextHigherSchemaPath = nextHigherSchemaSegments.join('/');\n\n const nextHigherSchema = Resolve.schema(\n schema,\n nextHigherSchemaPath,\n rootSchema\n );\n\n const currentData = Resolve.data(data, toDataPath(nextHigherSchemaPath));\n\n return (\n conditionallyRequired(\n nextHigherSchema,\n segment,\n [lastSegment, ...prevSegments],\n currentData\n ) ||\n (has(nextHigherSchema, 'if') &&\n checkRequiredInIf(\n nextHigherSchema,\n segment,\n [lastSegment, ...prevSegments],\n currentData\n )) ||\n isRequiredInParent(\n schema,\n rootSchema,\n nextHigherSchemaPath,\n segment,\n [lastSegment, ...prevSegments],\n currentData\n )\n );\n};\n\nconst isRequired = (\n schema: JsonSchema,\n schemaPath: string,\n rootSchema: JsonSchema,\n data: any,\n config: any\n): boolean => {\n const pathSegments = schemaPath.split('/');\n const lastSegment = pathSegments[pathSegments.length - 1];\n // Skip \"properties\", \"items\" etc. to resolve the parent\n const nextHigherSchemaSegments = pathSegments.slice(\n 0,\n pathSegments.length - 2\n );\n const nextHigherSchemaPath = nextHigherSchemaSegments.join('/');\n const nextHigherSchema = Resolve.schema(\n schema,\n nextHigherSchemaPath,\n rootSchema\n );\n const currentData = Resolve.data(data, toDataPath(nextHigherSchemaPath));\n\n if (!config?.allowDynamicCheck) {\n return (\n nextHigherSchema !== undefined &&\n nextHigherSchema.required !== undefined &&\n nextHigherSchema.required.indexOf(lastSegment) !== -1\n );\n }\n\n const requiredInIf =\n has(nextHigherSchema, 'if') &&\n checkRequiredInIf(nextHigherSchema, lastSegment, [], currentData);\n\n const requiredConditionally = conditionallyRequired(\n nextHigherSchema,\n lastSegment,\n [],\n currentData\n );\n\n const requiredConditionallyInParent = isRequiredInParent(\n rootSchema,\n rootSchema,\n schemaPath,\n lastSegment,\n [],\n data\n );\n\n return (\n (nextHigherSchema !== undefined &&\n nextHigherSchema.required !== undefined &&\n nextHigherSchema.required.indexOf(lastSegment) !== -1) ||\n requiredInIf ||\n requiredConditionally ||\n requiredConditionallyInParent\n );\n};\n\n/**\n * Adds an asterisk to the given label string based\n * on the required parameter.\n *\n * @param {string | undefined} label the label string\n * @param {boolean} required whether the label belongs to a control which is required\n * @param {boolean} hideRequiredAsterisk applied UI Schema option\n * @returns {string} the label string\n */\nexport const computeLabel = (\n label: string | undefined,\n required: boolean,\n hideRequiredAsterisk: boolean\n): string => {\n return `${label ?? ''}${required && !hideRequiredAsterisk ? '*' : ''}`;\n};\n\n/**\n * Indicates whether to mark a field as required.\n *\n * @param {boolean} required whether the label belongs to a control which is required\n * @param {boolean} hideRequiredAsterisk applied UI Schema option\n * @returns {boolean} should the field be marked as required\n */\nexport const showAsRequired = (\n required: boolean,\n hideRequiredAsterisk: boolean\n): boolean => {\n return required && !hideRequiredAsterisk;\n};\n\n/**\n * Create a default value based on the given schema.\n * @param schema the schema for which to create a default value.\n * @returns {any}\n */\nexport const createDefaultValue = (\n schema: JsonSchema,\n rootSchema: JsonSchema\n) => {\n const resolvedSchema = Resolve.schema(schema, schema.$ref, rootSchema);\n if (resolvedSchema.default !== undefined) {\n return extractDefaults(resolvedSchema, rootSchema);\n }\n if (hasType(resolvedSchema, 'string')) {\n if (\n resolvedSchema.format === 'date-time' ||\n resolvedSchema.format === 'date' ||\n resolvedSchema.format === 'time'\n ) {\n return convertDateToString(new Date(), resolvedSchema.format);\n }\n return '';\n } else if (\n hasType(resolvedSchema, 'integer') ||\n hasType(resolvedSchema, 'number')\n ) {\n return 0;\n } else if (hasType(resolvedSchema, 'boolean')) {\n return false;\n } else if (hasType(resolvedSchema, 'array')) {\n return [];\n } else if (hasType(resolvedSchema, 'object')) {\n return extractDefaults(resolvedSchema, rootSchema);\n } else if (hasType(resolvedSchema, 'null')) {\n return null;\n } else {\n return {};\n }\n};\n\n/**\n * Returns the default value defined in the given schema.\n * @param schema the schema for which to create a default value.\n * @returns {any}\n */\nexport const extractDefaults = (schema: JsonSchema, rootSchema: JsonSchema) => {\n if (hasType(schema, 'object') && schema.default === undefined) {\n const result: { [key: string]: any } = {};\n for (const key in schema.properties) {\n const property = schema.properties[key];\n const resolvedProperty = property.$ref\n ? Resolve.schema(rootSchema, property.$ref, rootSchema)\n : property;\n if (resolvedProperty.default !== undefined) {\n result[key] = cloneDeep(resolvedProperty.default);\n }\n }\n return result;\n }\n return cloneDeep(schema.default);\n};\n\n/**\n * Whether an element's description should be hidden.\n *\n * @param visible whether an element is visible\n * @param description the element's description\n * @param isFocused whether the element is focused\n *\n * @returns {boolean} true, if the description is to be hidden, false otherwise\n */\nexport const isDescriptionHidden = (\n visible: boolean,\n description: string | undefined,\n isFocused: boolean,\n showUnfocusedDescription: boolean\n): boolean => {\n return (\n description === undefined ||\n (description !== undefined && !visible) ||\n (!showUnfocusedDescription && !isFocused)\n );\n};\n\nexport interface WithClassname {\n className?: string;\n}\n\nexport interface EnumOption {\n label: string;\n value: any;\n}\n\nexport const enumToEnumOptionMapper = (\n e: any,\n t?: Translator,\n i18nKey?: string\n): EnumOption => {\n let label = typeof e === 'string' ? e : JSON.stringify(e);\n if (t) {\n if (i18nKey) {\n label = t(`${i18nKey}.${label}`, label);\n } else {\n label = t(label, label);\n }\n }\n return { label, value: e };\n};\n\nexport const oneOfToEnumOptionMapper = (\n e: any,\n t?: Translator,\n fallbackI18nKey?: string\n): EnumOption => {\n let label =\n e.title ??\n (typeof e.const === 'string' ? e.const : JSON.stringify(e.const));\n if (t) {\n // prefer schema keys as they can be more specialized\n if (e.i18n) {\n label = t(e.i18n, label);\n } else if (fallbackI18nKey) {\n label = t(`${fallbackI18nKey}.${label}`, label);\n } else {\n label = t(label, label);\n }\n }\n return {\n label,\n value: e.const,\n };\n};\n\nexport interface OwnPropsOfRenderer {\n /**\n * The UI schema to be rendered.\n */\n uischema?: UISchemaElement;\n /**\n * The JSON schema that describes the data.\n */\n schema?: JsonSchema;\n /**\n * Whether the rendered element should be enabled.\n */\n enabled?: boolean;\n /**\n * Whether the rendered element should be visible.\n */\n visible?: boolean;\n\n /**\n * Optional instance path. Necessary when the actual data\n * path can not be inferred via the UI schema element as\n * it is the case with nested controls.\n */\n path?: string;\n\n renderers?: JsonFormsRendererRegistryEntry[];\n\n cells?: JsonFormsCellRendererRegistryEntry[];\n\n uischemas?: JsonFormsUISchemaRegistryEntry[];\n}\n\nexport interface OwnPropsOfControl extends OwnPropsOfRenderer {\n id?: string;\n // constraint type\n uischema?: ControlElement;\n}\n\nexport interface OwnPropsOfLabel extends OwnPropsOfRenderer {\n uischema?: LabelElement;\n}\n\nexport interface OwnPropsOfEnum {\n options?: EnumOption[];\n}\n\nexport interface OwnPropsOfLayout extends OwnPropsOfRenderer {\n direction?: 'row' | 'column';\n}\n\n/**\n * State-based props of a {@link Renderer}.\n */\nexport interface StatePropsOfRenderer {\n /**\n * Any configuration options for the element.\n */\n config?: any;\n\n /**\n * The UI schema to be rendered.\n */\n uischema: UISchemaElement;\n\n /**\n * The JSON schema that describes the data.\n */\n schema: JsonSchema;\n\n /**\n * The data to be rendered.\n */\n data?: any;\n\n /**\n * Whether the rendered element should be enabled.\n */\n enabled: boolean;\n /**\n * Whether the rendered element should be visible.\n */\n visible: boolean;\n\n /**\n * Instance path the data is written to, in case of a control.\n */\n path: string;\n\n /**\n * All available renderers.\n */\n renderers?: JsonFormsRendererRegistryEntry[];\n\n /**\n * All available cell renderers.\n */\n\n cells?: JsonFormsCellRendererRegistryEntry[];\n}\n\n/**\n * State-based properties for UI schema elements that have a scope.\n */\nexport interface StatePropsOfScopedRenderer extends StatePropsOfRenderer {\n // constraint type\n uischema: ControlElement;\n\n /**\n * Any validation errors that are caused by the data to be rendered.\n */\n errors: string;\n\n /**\n * The data to be rendered.\n */\n data: any;\n\n /**\n * The root schema as returned by the store.\n */\n rootSchema: JsonSchema;\n\n /**\n * A unique ID that should be used for rendering the scoped UI schema element.\n */\n id: string;\n}\n\n/**\n * Props of a {@link Renderer}.\n */\nexport interface RendererProps extends StatePropsOfRenderer {}\n\n/**\n * State-based props of a Control\n */\nexport interface StatePropsOfControl extends StatePropsOfScopedRenderer {\n cells?: { tester: RankedTester; cell: any }[];\n\n /**\n * The label for the rendered element.\n */\n label: string;\n\n /**\n * Description of input cell\n */\n description?: string;\n\n /**\n * Whether the rendered data is required.\n */\n required?: boolean;\n\n i18nKeyPrefix?: string;\n\n // TODO: renderers?\n}\n\n/**\n * Dispatch-based props of a Control.\n */\nexport interface DispatchPropsOfControl {\n /**\n * Update handler that emits a data change\n *\n * @param {string} path the path to the data to be updated\n * @param {any} value the new value that should be written to the given path\n */\n handleChange(path: string, value: any): void;\n}\n\n/**\n * Props of a Control.\n */\nexport interface ControlProps\n extends StatePropsOfControl,\n DispatchPropsOfControl {}\n\n/**\n * State props of a layout;\n */\nexport interface StatePropsOfLayout extends StatePropsOfRenderer {\n /**\n * Direction for the layout to flow\n */\n direction: 'row' | 'column';\n label?: string;\n}\n\nexport interface LayoutProps extends StatePropsOfLayout {}\n\n/**\n * The state of a control.\n */\nexport interface ControlState {\n /**\n * The current value.\n */\n value: any;\n\n /**\n * Whether the control is focused.\n */\n isFocused: boolean;\n}\n\n/**\n * Map state to control props.\n * @param state the store's state\n * @param ownProps any own props\n * @returns {StatePropsOfControl} state props for a control\n */\nexport const mapStateToControlProps = (\n state: JsonFormsState,\n ownProps: OwnPropsOfControl\n): StatePropsOfControl => {\n const { uischema } = ownProps;\n const rootData = getData(state);\n const path = composeWithUi(uischema, ownProps.path);\n const visible: boolean =\n ownProps.visible === undefined || hasShowRule(uischema)\n ? isVisible(uischema, rootData, ownProps.path, getAjv(state))\n : ownProps.visible;\n const controlElement = uischema as ControlElement;\n const id = ownProps.id;\n const rootSchema = getSchema(state);\n const config = getConfig(state);\n const required =\n controlElement.scope !== undefined &&\n isRequired(\n ownProps.schema,\n controlElement.scope,\n rootSchema,\n rootData,\n config\n );\n const resolvedSchema = Resolve.schema(\n ownProps.schema || rootSchema,\n controlElement.scope,\n rootSchema\n );\n const errors = getErrorAt(path, resolvedSchema)(state);\n\n const description =\n resolvedSchema !== undefined ? resolvedSchema.description : '';\n const data = Resolve.data(rootData, path);\n const labelDesc = createLabelDescriptionFrom(uischema, resolvedSchema);\n const label = labelDesc.show ? labelDesc.text : '';\n const enabled: boolean = isInherentlyEnabled(\n state,\n ownProps,\n uischema,\n resolvedSchema || rootSchema,\n rootData,\n config\n );\n\n const schema = resolvedSchema ?? rootSchema;\n const t = getTranslator()(state);\n const te = getErrorTranslator()(state);\n const i18nKeyPrefix = getI18nKeyPrefix(schema, uischema, path);\n const i18nLabel = t(getI18nKey(schema, uischema, path, 'label'), label, {\n schema,\n uischema,\n path,\n errors,\n });\n const i18nDescription = t(\n getI18nKey(schema, uischema, path, 'description'),\n description,\n { schema, uischema, path, errors }\n );\n const i18nErrorMessage = getCombinedErrorMessage(\n errors,\n te,\n t,\n schema,\n uischema,\n path\n );\n\n return {\n data,\n description: i18nDescription,\n errors: i18nErrorMessage,\n label: i18nLabel,\n visible,\n enabled,\n id,\n path,\n required,\n uischema,\n schema,\n config: getConfig(state),\n cells: ownProps.cells || state.jsonforms.cells,\n rootSchema,\n i18nKeyPrefix,\n };\n};\n\n/**\n *\n * Map dispatch to control props.\n *\n * @param dispatch the store's dispatch method\n * @returns {DispatchPropsOfControl} dispatch props for a control\n */\nexport const mapDispatchToControlProps = (\n dispatch: Dispatch\n): DispatchPropsOfControl => ({\n handleChange(path, value) {\n dispatch(update(path, () => value));\n },\n});\n\n/**\n * Default mapStateToCellProps for enum control. Options is used for populating dropdown list\n * @param state\n * @param ownProps\n * @returns {StatePropsOfControl & OwnPropsOfEnum}\n */\nexport const mapStateToEnumControlProps = (\n state: JsonFormsState,\n ownProps: OwnPropsOfControl & OwnPropsOfEnum\n): StatePropsOfControl & OwnPropsOfEnum => {\n const props: StatePropsOfControl = mapStateToControlProps(state, ownProps);\n const options: EnumOption[] =\n ownProps.options ||\n props.schema.enum?.map((e) =>\n enumToEnumOptionMapper(\n e,\n getTranslator()(state),\n getI18nKeyPrefix(props.schema, props.uischema, props.path)\n )\n ) ||\n (props.schema.const && [\n enumToEnumOptionMapper(\n props.schema.const,\n getTranslator()(state),\n getI18nKeyPrefix(props.schema, props.uischema, props.path)\n ),\n ]);\n return {\n ...props,\n options,\n };\n};\n\n/**\n * Default mapStateToCellProps for enum control based on oneOf. Options is used for populating dropdown list\n * @param state\n * @param ownProps\n * @returns {StatePropsOfControl & OwnPropsOfEnum}\n */\nexport const mapStateToOneOfEnumControlProps = (\n state: JsonFormsState,\n ownProps: OwnPropsOfControl & OwnPropsOfEnum\n): StatePropsOfControl & OwnPropsOfEnum => {\n const props: StatePropsOfControl = mapStateToControlProps(state, ownProps);\n const options: EnumOption[] =\n ownProps.options ||\n (props.schema.oneOf as JsonSchema[])?.map((oneOfSubSchema) =>\n oneOfToEnumOptionMapper(\n oneOfSubSchema,\n getTranslator()(state),\n getI18nKeyPrefix(props.schema, props.uischema, props.path)\n )\n );\n return {\n ...props,\n options,\n };\n};\n\n/**\n * Default mapStateToCellProps for multi enum control. Options is used for populating dropdown list\n * @param state\n * @param ownProps\n * @returns {StatePropsOfControl & OwnPropsOfEnum}\n */\nexport const mapStateToMultiEnumControlProps = (\n state: JsonFormsState,\n ownProps: OwnPropsOfControl & OwnPropsOfEnum\n): StatePropsOfControl & OwnPropsOfEnum => {\n const props: StatePropsOfControl = mapStateToControlProps(state, ownProps);\n let items = props.schema.items as JsonSchema;\n items =\n items && items.$ref\n ? resolveSchema(props.rootSchema, items.$ref, props.rootSchema)\n : items;\n const options: EnumOption[] =\n ownProps.options ||\n (items?.oneOf &&\n (items.oneOf as JsonSchema[]).map((oneOfSubSchema) =>\n oneOfToEnumOptionMapper(\n oneOfSubSchema,\n state.jsonforms.i18n?.translate,\n getI18nKeyPrefix(props.schema, props.uischema, props.path)\n )\n )) ||\n items?.enum?.map((e) =>\n enumToEnumOptionMapper(\n e,\n state.jsonforms.i18n?.translate,\n getI18nKeyPrefix(props.schema, props.uischema, props.path)\n )\n );\n return {\n ...props,\n options,\n };\n};\n\n/**\n * Map state to control props.\n * @param state the store's state\n * @param ownProps any own props\n * @returns {StatePropsOfControl} state props for a control\n */\nexport const mapStateToMasterListItemProps = (\n state: JsonFormsState,\n ownProps: OwnPropsOfMasterListItem\n): StatePropsOfMasterItem => {\n const { schema, path, index } = ownProps;\n const firstPrimitiveProp = schema.properties\n ? find(Object.keys(schema.properties), (propName) => {\n const prop = schema.properties[propName];\n return (\n prop.type === 'string' ||\n prop.type === 'number' ||\n prop.type === 'integer'\n );\n })\n : undefined;\n const childPath = composePaths(path, `${index}`);\n const childData = Resolve.data(getData(state), childPath);\n const childLabel = firstPrimitiveProp ? childData[firstPrimitiveProp] : '';\n\n return {\n ...ownProps,\n childLabel,\n };\n};\n\n/**\n * State-based props of a table control.\n */\nexport interface StatePropsOfControlWithDetail extends StatePropsOfControl {\n uischemas?: JsonFormsUISchemaRegistryEntry[];\n renderers?: JsonFormsRendererRegistryEntry[];\n cells?: JsonFormsCellRendererRegistryEntry[];\n}\n\nexport interface OwnPropsOfMasterListItem {\n index: number;\n selected: boolean;\n path: string;\n enabled: boolean;\n schema: JsonSchema;\n handleSelect(index: number): () => void;\n removeItem(path: string, value: number): () => void;\n translations: ArrayTranslations;\n}\n\nexport interface StatePropsOfMasterItem extends OwnPropsOfMasterListItem {\n childLabel: string;\n}\n\n/**\n * Map state to control with detail props\n *\n * @param state the store's state\n * @param ownProps any element's own props\n * @returns {StatePropsOfArrayControl} state props for a table control\n */\nexport const mapStateToControlWithDetailProps = (\n state: JsonFormsState,\n ownProps: OwnPropsOfControl\n): StatePropsOfControlWithDetail => {\n const { ...props } = mapStateToControlProps(state, ownProps);\n\n return {\n ...props,\n uischemas: state.jsonforms.uischemas,\n };\n};\n\nexport interface ControlWithDetailProps\n extends StatePropsOfControlWithDetail,\n DispatchPropsOfControl {}\n\n/**\n * State-based props of a table control.\n */\nexport interface StatePropsOfArrayControl\n extends StatePropsOfControlWithDetail {\n translations: ArrayTranslations;\n childErrors?: ErrorObject[];\n}\n\n/**\n * Map state to table props\n *\n * @param state the store's state\n * @param ownProps any element's own props\n * @returns {StatePropsOfArrayControl} state props for a table control\n */\nexport const mapStateToArrayControlProps = (\n state: JsonFormsState,\n ownProps: OwnPropsOfControl\n): StatePropsOfArrayControl => {\n const { path, schema, uischema, i18nKeyPrefix, label, ...props } =\n mapStateToControlWithDetailProps(state, ownProps);\n\n const resolvedSchema = Resolve.schema(schema, 'items', props.rootSchema);\n const childErrors = getSubErrorsAt(path, resolvedSchema)(state);\n const t = getTranslator()(state);\n\n return {\n ...props,\n label,\n path,\n uischema,\n schema: resolvedSchema,\n childErrors,\n renderers: ownProps.renderers || getRenderers(state),\n cells: ownProps.cells || getCells(state),\n translations: getArrayTranslations(\n t,\n arrayDefaultTranslations,\n i18nKeyPrefix,\n label\n ),\n };\n};\n\n/**\n * Dispatch props of a table control\n */\nexport interface DispatchPropsOfArrayControl {\n addItem(path: string, value: any): () => void;\n removeItems?(path: string, toDelete: number[]): () => void;\n moveUp?(path: string, toMove: number): () => void;\n moveDown?(path: string, toMove: number): () => void;\n}\n\n/**\n * Maps state to dispatch properties of an array control.\n *\n * @param dispatch the store's dispatch method\n * @returns {DispatchPropsOfArrayControl} dispatch props of an array control\n */\nexport const mapDispatchToArrayControlProps = (\n dispatch: Dispatch\n): DispatchPropsOfArrayControl => ({\n addItem: (path: string, value: any) => () => {\n dispatch(\n update(path, (array) => {\n if (array === undefined || array === null) {\n return [value];\n }\n\n array.push(value);\n return array;\n })\n );\n },\n removeItems: (path: string, toDelete: number[]) => () => {\n dispatch(\n update(path, (array) => {\n toDelete\n .sort((a, b) => a - b)\n .reverse()\n .forEach((s) => array.splice(s, 1));\n return array;\n })\n );\n },\n moveUp: (path, toMove: number) => () => {\n dispatch(\n update(path, (array) => {\n moveUp(array, toMove);\n return array;\n })\n );\n },\n moveDown: (path, toMove: number) => () => {\n dispatch(\n update(path, (array) => {\n moveDown(array, toMove);\n return array;\n })\n );\n },\n});\n\nexport interface DispatchPropsOfMultiEnumControl {\n addItem: (path: string, value: any) => void;\n removeItem?: (path: string, toDelete: any) => void;\n}\n\nexport const mapDispatchToMultiEnumProps = (\n dispatch: Dispatch\n): DispatchPropsOfMultiEnumControl => ({\n addItem: (path: string, value: any) => {\n dispatch(\n update(path, (data) => {\n if (data === undefined || data === null) {\n return [value];\n }\n data.push(value);\n return data;\n })\n );\n },\n removeItem: (path: string, toDelete: any) => {\n dispatch(\n update(path, (data) => {\n const indexInData = data.indexOf(toDelete);\n data.splice(indexInData, 1);\n return data;\n })\n );\n },\n});\n\n/**\n * Props of an array control.\n */\nexport interface ArrayControlProps\n extends StatePropsOfArrayControl,\n DispatchPropsOfArrayControl {}\n\nexport const layoutDefaultProps: {\n visible: boolean;\n enabled: boolean;\n path: string;\n direction: 'row' | 'column';\n} = {\n visible: true,\n enabled: true,\n path: '',\n direction: 'column',\n};\n\nconst getDirection = (uischema: UISchemaElement) => {\n if (uischema.type === 'HorizontalLayout') {\n return 'row';\n }\n if (uischema.type === 'VerticalLayout') {\n return 'column';\n }\n return layoutDefaultProps.direction;\n};\n\n/**\n * Map state to layout props.\n * @param state JSONForms state tree\n * @param ownProps any own props\n * @returns {StatePropsOfLayout}\n */\nexport const mapStateToLayoutProps = (\n state: JsonFormsState,\n ownProps: OwnPropsOfLayout\n): LayoutProps => {\n const rootData = getData(state);\n const { uischema } = ownProps;\n const visible: boolean =\n ownProps.visible === undefined || hasShowRule(uischema)\n ? isVisible(ownProps.uischema, rootData, ownProps.path, getAjv(state))\n : ownProps.visible;\n\n const data = Resolve.data(rootData, ownProps.path);\n const config = getConfig(state);\n const enabled: boolean = isInherentlyEnabled(\n state,\n ownProps,\n uischema,\n undefined, // layouts have no associated schema\n rootData,\n config\n );\n\n // some layouts have labels which might need to be translated\n const t = getTranslator()(state);\n const label = isLabelable(uischema)\n ? deriveLabelForUISchemaElement(uischema, t)\n : undefined;\n\n return {\n ...layoutDefaultProps,\n renderers: ownProps.renderers || getRenderers(state),\n cells: ownProps.cells || getCells(state),\n visible,\n enabled,\n path: ownProps.path,\n data,\n uischema: ownProps.uischema,\n schema: ownProps.schema,\n direction: ownProps.direction ?? getDirection(uischema),\n config,\n label,\n };\n};\n\nexport type RefResolver = (schema: JsonSchema) => Promise;\n\nexport interface OwnPropsOfJsonFormsRenderer extends OwnPropsOfRenderer {}\n\nexport interface StatePropsOfJsonFormsRenderer\n extends OwnPropsOfJsonFormsRenderer {\n rootSchema: JsonSchema;\n config: any;\n}\n\nexport interface JsonFormsProps extends StatePropsOfJsonFormsRenderer {}\n\nexport const mapStateToJsonFormsRendererProps = (\n state: JsonFormsState,\n ownProps: OwnPropsOfJsonFormsRenderer\n): StatePropsOfJsonFormsRenderer => {\n return {\n renderers: ownProps.renderers || get(state.jsonforms, 'renderers'),\n cells: ownProps.cells || get(state.jsonforms, 'cells'),\n schema: ownProps.schema || getSchema(state),\n rootSchema: getSchema(state),\n uischema: ownProps.uischema || getUiSchema(state),\n path: ownProps.path,\n enabled: ownProps.enabled,\n config: getConfig(state),\n };\n};\n\nexport const controlDefaultProps = {\n ...layoutDefaultProps,\n errors: [] as string[],\n};\n\nexport interface StatePropsOfCombinator extends StatePropsOfControl {\n rootSchema: JsonSchema;\n path: string;\n id: string;\n indexOfFittingSchema: number;\n uischemas: JsonFormsUISchemaRegistryEntry[];\n data: any;\n translations: CombinatorTranslations;\n}\n\nexport const mapStateToCombinatorRendererProps = (\n state: JsonFormsState,\n ownProps: OwnPropsOfControl,\n keyword: CombinatorKeyword\n): StatePropsOfCombinator => {\n const { data, schema, rootSchema, i18nKeyPrefix, label, ...props } =\n mapStateToControlProps(state, ownProps);\n\n const ajv = state.jsonforms.core.ajv;\n const t = getTranslator()(state);\n const translations = getCombinatorTranslations(\n t,\n combinatorDefaultTranslations,\n i18nKeyPrefix,\n label\n );\n const structuralKeywords = [\n 'required',\n 'additionalProperties',\n 'type',\n 'enum',\n 'const',\n ];\n const dataIsValid = (errors: ErrorObject[]): boolean => {\n return (\n !errors ||\n errors.length === 0 ||\n !errors.find((e) => structuralKeywords.indexOf(e.keyword) !== -1)\n );\n };\n let indexOfFittingSchema: number;\n // TODO instead of compiling the combinator subschemas we can compile the original schema\n // without the combinator alternatives and then revalidate and check the errors for the\n // element\n for (let i = 0; i < schema[keyword]?.length; i++) {\n try {\n let _schema = schema[keyword][i];\n if (_schema.$ref) {\n _schema = Resolve.schema(rootSchema, _schema.$ref, rootSchema);\n }\n const valFn = ajv.compile(_schema);\n valFn(data);\n if (dataIsValid(valFn.errors)) {\n indexOfFittingSchema = i;\n break;\n }\n } catch (error) {\n console.debug(\n \"Combinator subschema is not self contained, can't hand it over to AJV\"\n );\n }\n }\n\n return {\n data,\n schema,\n rootSchema,\n ...props,\n i18nKeyPrefix,\n label,\n indexOfFittingSchema,\n uischemas: getUISchemas(state),\n translations,\n };\n};\n\nexport interface CombinatorRendererProps\n extends StatePropsOfCombinator,\n DispatchPropsOfControl {}\n/**\n * Map state to all of renderer props.\n * @param state the store's state\n * @param ownProps any own props\n * @returns {StatePropsOfCombinator} state props for a combinator\n */\nexport const mapStateToAllOfProps = (\n state: JsonFormsState,\n ownProps: OwnPropsOfControl\n): StatePropsOfCombinator =>\n mapStateToCombinatorRendererProps(state, ownProps, 'allOf');\n\nexport const mapStateToAnyOfProps = (\n state: JsonFormsState,\n ownProps: OwnPropsOfControl\n): StatePropsOfCombinator => {\n return mapStateToCombinatorRendererProps(state, ownProps, 'anyOf');\n};\n\nexport const mapStateToOneOfProps = (\n state: JsonFormsState,\n ownProps: OwnPropsOfControl\n): StatePropsOfCombinator => {\n return mapStateToCombinatorRendererProps(state, ownProps, 'oneOf');\n};\n\nexport interface StatePropsOfArrayLayout extends StatePropsOfControlWithDetail {\n data: number;\n translations: ArrayTranslations;\n minItems?: number;\n}\n/**\n * Map state to table props\n *\n * @param state the store's state\n * @param ownProps any element's own props\n * @returns {StatePropsOfArrayControl} state props for a table control\n */\nexport const mapStateToArrayLayoutProps = (\n state: JsonFormsState,\n ownProps: OwnPropsOfControl\n): StatePropsOfArrayLayout => {\n const { path, schema, uischema, errors, i18nKeyPrefix, label, ...props } =\n mapStateToControlWithDetailProps(state, ownProps);\n\n const resolvedSchema = Resolve.schema(schema, 'items', props.rootSchema);\n const t = getTranslator()(state);\n // TODO Does not consider 'i18n' keys which are specified in the ui schemas of the sub errors\n const childErrors = getCombinedErrorMessage(\n getSubErrorsAt(path, resolvedSchema)(state),\n getErrorTranslator()(state),\n t,\n undefined,\n undefined,\n undefined\n );\n\n const allErrors =\n errors +\n (errors.length > 0 && childErrors.length > 0 ? '\\n' : '') +\n childErrors;\n return {\n ...props,\n label,\n path,\n uischema,\n schema: resolvedSchema,\n data: props.data ? props.data.length : 0,\n errors: allErrors,\n minItems: schema.minItems,\n translations: getArrayTranslations(\n t,\n arrayDefaultTranslations,\n i18nKeyPrefix,\n label\n ),\n };\n};\n\n/**\n * Props of an array control.\n */\nexport interface ArrayLayoutProps\n extends StatePropsOfArrayLayout,\n DispatchPropsOfArrayControl {}\n\nexport interface StatePropsOfLabel extends StatePropsOfRenderer {\n text?: string;\n}\nexport interface LabelProps extends StatePropsOfLabel {}\n\nexport const mapStateToLabelProps = (\n state: JsonFormsState,\n props: OwnPropsOfLabel\n) => {\n const { uischema } = props;\n\n const visible: boolean =\n props.visible === undefined || hasShowRule(uischema)\n ? isVisible(props.uischema, getData(state), props.path, getAjv(state))\n : props.visible;\n\n const text = uischema.text;\n const t = getTranslator()(state);\n const i18nKeyPrefix = getI18nKeyPrefixBySchema(undefined, uischema);\n const i18nKey = i18nKeyPrefix ? `${i18nKeyPrefix}.text` : text ?? '';\n const i18nText = t(i18nKey, text, { uischema });\n\n return {\n text: i18nText,\n visible,\n config: getConfig(state),\n renderers: props.renderers || getRenderers(state),\n cells: props.cells || getCells(state),\n };\n};\n","/*\n The MIT License\n\n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport isEmpty from 'lodash/isEmpty';\nimport {\n getErrorTranslator,\n getAjv,\n getConfig,\n getData,\n getErrorAt,\n getSchema,\n getTranslator,\n} from '../reducers';\nimport type { JsonFormsCellRendererRegistryEntry } from '../reducers';\nimport type { AnyAction, Dispatch } from './type';\nimport { Resolve } from './util';\nimport { isInherentlyEnabled, isVisible } from './runtime';\nimport {\n DispatchPropsOfControl,\n EnumOption,\n enumToEnumOptionMapper,\n mapDispatchToControlProps,\n oneOfToEnumOptionMapper,\n OwnPropsOfControl,\n OwnPropsOfEnum,\n StatePropsOfScopedRenderer,\n} from './renderer';\nimport { getCombinedErrorMessage, getI18nKeyPrefix } from '../i18n';\nimport type { JsonFormsState } from '../store';\nimport type { JsonSchema } from '../models';\n\nexport interface OwnPropsOfCell extends OwnPropsOfControl {\n data?: any;\n}\n\n/**\n * State props of a cell.\n */\nexport interface StatePropsOfCell extends StatePropsOfScopedRenderer {\n isValid: boolean;\n rootSchema: JsonSchema;\n}\n\nexport interface OwnPropsOfEnumCell extends OwnPropsOfCell, OwnPropsOfEnum {}\n\n/**\n * State props of a cell for enum cell\n */\nexport interface StatePropsOfEnumCell\n extends StatePropsOfCell,\n OwnPropsOfEnum {}\n\n/**\n * Props of an enum cell.\n */\nexport interface EnumCellProps\n extends StatePropsOfEnumCell,\n DispatchPropsOfControl {}\n\nexport type DispatchPropsOfCell = DispatchPropsOfControl;\n\n/**\n * Props of a cell.\n */\nexport interface CellProps extends StatePropsOfCell, DispatchPropsOfCell {}\n/**\n * Registers the given cell renderer when a JSON Forms store is created.\n * @param {RankedTester} tester\n * @param cell the cell to be registered\n * @returns {any}\n */\nexport interface DispatchCellStateProps extends StatePropsOfCell {\n cells?: JsonFormsCellRendererRegistryEntry[];\n}\n\n/**\n * Map state to cell props.\n *\n * @param state JSONForms state tree\n * @param ownProps any own props\n * @returns {StatePropsOfCell} state props of a cell\n */\nexport const mapStateToCellProps = (\n state: JsonFormsState,\n ownProps: OwnPropsOfCell\n): StatePropsOfCell => {\n const { id, schema, path, uischema, renderers, cells } = ownProps;\n const rootData = getData(state);\n const visible =\n ownProps.visible !== undefined\n ? ownProps.visible\n : isVisible(uischema, rootData, undefined, getAjv(state));\n\n const rootSchema = getSchema(state);\n const config = getConfig(state);\n\n /* When determining the enabled state of cells we take a shortcut: At the\n * moment it's only possible to configure enablement and disablement at the\n * control level. Therefore the renderer using the cell, for example a\n * table renderer, determines whether a cell is enabled and should hand\n * over the prop themselves. If that prop was given, we prefer it over\n * anything else to save evaluation effort (except for the global readonly\n * flag). For example it would be quite expensive to evaluate the same ui schema\n * rule again and again for each cell of a table. */\n let enabled;\n if (state.jsonforms.readonly === true) {\n enabled = false;\n } else if (typeof ownProps.enabled === 'boolean') {\n enabled = ownProps.enabled;\n } else {\n enabled = isInherentlyEnabled(\n state,\n ownProps,\n uischema,\n schema || rootSchema,\n rootData,\n config\n );\n }\n\n const t = getTranslator()(state);\n const te = getErrorTranslator()(state);\n const errors = getCombinedErrorMessage(\n getErrorAt(path, schema)(state),\n te,\n t,\n schema,\n uischema,\n path\n );\n const isValid = isEmpty(errors);\n\n return {\n data: Resolve.data(rootData, path),\n visible,\n enabled,\n id,\n path,\n errors,\n isValid,\n schema,\n uischema,\n config: getConfig(state),\n rootSchema,\n renderers,\n cells,\n };\n};\n\nexport const mapStateToDispatchCellProps = (\n state: JsonFormsState,\n ownProps: OwnPropsOfCell\n): DispatchCellStateProps => {\n const props: StatePropsOfCell = mapStateToCellProps(state, ownProps);\n const { renderers: _renderers, cells, ...otherOwnProps } = ownProps;\n return {\n ...props,\n ...otherOwnProps,\n cells: cells || state.jsonforms.cells || [],\n };\n};\n\nexport interface DispatchCellProps extends DispatchCellStateProps {}\n\n/**\n * Default mapStateToCellProps for enum cell. Options is used for populating dropdown list\n * @param state\n * @param ownProps\n * @returns {StatePropsOfEnumCell}\n */\nexport const defaultMapStateToEnumCellProps = (\n state: JsonFormsState,\n ownProps: OwnPropsOfEnumCell\n): StatePropsOfEnumCell => {\n const props: StatePropsOfCell = mapStateToCellProps(state, ownProps);\n const options: EnumOption[] =\n ownProps.options ||\n props.schema.enum?.map((e) =>\n enumToEnumOptionMapper(\n e,\n getTranslator()(state),\n getI18nKeyPrefix(props.schema, props.uischema, props.path)\n )\n ) ||\n (props.schema.const && [\n enumToEnumOptionMapper(\n props.schema.const,\n getTranslator()(state),\n getI18nKeyPrefix(props.schema, props.uischema, props.path)\n ),\n ]);\n return {\n ...props,\n options,\n };\n};\n\n/**\n * mapStateToOneOfEnumCellProps for one of enum cell. Options is used for populating dropdown list from oneOf\n * @param state\n * @param ownProps\n * @returns {StatePropsOfEnumCell}\n */\nexport const mapStateToOneOfEnumCellProps = (\n state: JsonFormsState,\n ownProps: OwnPropsOfEnumCell\n): StatePropsOfEnumCell => {\n const props: StatePropsOfCell = mapStateToCellProps(state, ownProps);\n const options: EnumOption[] =\n ownProps.options ||\n (props.schema.oneOf as JsonSchema[])?.map((oneOfSubSchema) =>\n oneOfToEnumOptionMapper(\n oneOfSubSchema,\n getTranslator()(state),\n getI18nKeyPrefix(props.schema, props.uischema, props.path)\n )\n );\n return {\n ...props,\n options,\n };\n};\n\n/**\n * Synonym for mapDispatchToControlProps.\n *\n * @type {(dispatch) => {handleChange(path, value): void}}\n */\nexport const mapDispatchToCellProps: (\n dispatch: Dispatch\n) => DispatchPropsOfControl = mapDispatchToControlProps;\n\n/**\n * Default dispatch to control props which can be customized to set handleChange action\n *\n */\nexport const defaultMapDispatchToControlProps =\n // TODO: ownProps types\n (dispatch: Dispatch, ownProps: any): DispatchPropsOfControl => {\n const { handleChange } = mapDispatchToCellProps(dispatch);\n\n return {\n handleChange: ownProps.handleChange || handleChange,\n };\n };\n","/*\n The MIT License\n \n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport type { ControlElement, JsonSchema, UISchemaElement } from '../models';\nimport { findUISchema, JsonFormsUISchemaRegistryEntry } from '../reducers';\nimport { Resolve } from './util';\n\nexport interface CombinatorSubSchemaRenderInfo {\n schema: JsonSchema;\n uischema: UISchemaElement;\n label: string;\n}\n\nexport type CombinatorKeyword = 'anyOf' | 'oneOf' | 'allOf';\n\nexport const createCombinatorRenderInfos = (\n combinatorSubSchemas: JsonSchema[],\n rootSchema: JsonSchema,\n keyword: CombinatorKeyword,\n control: ControlElement,\n path: string,\n uischemas: JsonFormsUISchemaRegistryEntry[]\n): CombinatorSubSchemaRenderInfo[] =>\n combinatorSubSchemas.map((subSchema, subSchemaIndex) => {\n const resolvedSubSchema =\n subSchema.$ref && Resolve.schema(rootSchema, subSchema.$ref, rootSchema);\n\n const schema = resolvedSubSchema ?? subSchema;\n\n return {\n schema,\n uischema: findUISchema(\n uischemas,\n schema,\n control.scope,\n path,\n undefined,\n control,\n rootSchema\n ),\n label:\n subSchema.title ??\n resolvedSubSchema?.title ??\n `${keyword}-${subSchemaIndex}`,\n };\n });\n","/*\n The MIT License\n \n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nconst usedIds: Set = new Set();\n\nconst makeId = (idBase: string, iteration: number) =>\n iteration <= 1 ? idBase : idBase + iteration.toString();\n\nconst isUniqueId = (idBase: string, iteration: number) => {\n const newID = makeId(idBase, iteration);\n return !usedIds.has(newID);\n};\n\nexport const createId = (proposedId: string) => {\n if (proposedId === undefined) {\n // failsafe to avoid endless loops in error cases\n proposedId = 'undefined';\n }\n let tries = 0;\n while (!isUniqueId(proposedId, tries)) {\n tries++;\n }\n const newID = makeId(proposedId, tries);\n usedIds.add(newID);\n return newID;\n};\n\nexport const removeId = (id: string) => usedIds.delete(id);\n\nexport const clearAllIds = () => usedIds.clear();\n","/*\n The MIT License\n\n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport find from 'lodash/find';\nimport { JsonSchema } from '../models';\n\nexport const getFirstPrimitiveProp = (schema: any) => {\n if (schema.properties) {\n return find(Object.keys(schema.properties), (propName) => {\n const prop = schema.properties[propName];\n return (\n prop.type === 'string' ||\n prop.type === 'number' ||\n prop.type === 'integer'\n );\n });\n }\n return undefined;\n};\n\n/**\n * Tests whether the schema has an enum based on oneOf.\n */\nexport const isOneOfEnumSchema = (schema: JsonSchema) =>\n !!schema &&\n Object.prototype.hasOwnProperty.call(schema, 'oneOf') &&\n schema.oneOf &&\n (schema.oneOf as JsonSchema[]).every((s) => s.const !== undefined);\n","/*\n The MIT License\n\n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport isEmpty from 'lodash/isEmpty';\nimport { isLayout, UISchemaElement } from '../models';\n\nexport type IterateCallback = (uischema: UISchemaElement) => void;\n\nconst setReadonlyPropertyValue =\n (value: boolean): IterateCallback =>\n (child: UISchemaElement): void => {\n if (!child.options) {\n child.options = {};\n }\n child.options.readonly = value;\n };\nexport const setReadonly = (uischema: UISchemaElement): void => {\n iterateSchema(uischema, setReadonlyPropertyValue(true));\n};\nexport const unsetReadonly = (uischema: UISchemaElement): void => {\n iterateSchema(uischema, setReadonlyPropertyValue(false));\n};\nexport const iterateSchema = (\n uischema: UISchemaElement,\n toApply: IterateCallback\n): void => {\n if (isEmpty(uischema)) {\n return;\n }\n if (isLayout(uischema)) {\n uischema.elements.forEach((child) => iterateSchema(child, toApply));\n return;\n }\n toApply(uischema);\n};\n","/*\n The MIT License\n \n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\nimport Ajv from 'ajv';\nimport addFormats from 'ajv-formats';\nimport type { Options } from 'ajv';\n\nexport const createAjv = (options?: Options) => {\n const ajv = new Ajv({\n allErrors: true,\n verbose: true,\n strict: false,\n addUsedSchema: false,\n ...options,\n });\n addFormats(ajv);\n return ajv;\n};\n","/*\n The MIT License\n \n Copyright (c) 2023-2023 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nexport const defaultDateFormat = 'YYYY-MM-DD';\nexport const defaultTimeFormat = 'HH:mm:ss';\nexport const defaultDateTimeFormat = 'YYYY-MM-DDTHH:mm:ss.sssZ';\n","/*\n The MIT License\n\n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport isEmpty from 'lodash/isEmpty';\nimport startCase from 'lodash/startCase';\nimport keys from 'lodash/keys';\nimport {\n ControlElement,\n isGroup,\n isLayout,\n JsonSchema,\n LabelElement,\n Layout,\n UISchemaElement,\n} from '../models';\nimport { deriveTypes, encode, resolveSchema } from '../util';\n\n/**\n * Creates a new ILayout.\n * @param layoutType The type of the laoyut\n * @returns the new ILayout\n */\nconst createLayout = (layoutType: string): Layout => ({\n type: layoutType,\n elements: [],\n});\n\n/**\n * Creates a IControlObject with the given label referencing the given ref\n */\nexport const createControlElement = (ref: string): ControlElement => ({\n type: 'Control',\n scope: ref,\n});\n\n/**\n * Wraps the given {@code uiSchema} in a Layout if there is none already.\n * @param uischema The ui schema to wrap in a layout.\n * @param layoutType The type of the layout to create.\n * @returns the wrapped uiSchema.\n */\nconst wrapInLayoutIfNecessary = (\n uischema: UISchemaElement,\n layoutType: string\n): Layout => {\n if (!isEmpty(uischema) && !isLayout(uischema)) {\n const verticalLayout: Layout = createLayout(layoutType);\n verticalLayout.elements.push(uischema);\n\n return verticalLayout;\n }\n\n return uischema as Layout;\n};\n\n/**\n * Adds the given {@code labelName} to the {@code layout} if it exists\n * @param layout\n * The layout which is to receive the label\n * @param labelName\n * The name of the schema\n */\nconst addLabel = (layout: Layout, labelName: string) => {\n if (!isEmpty(labelName)) {\n const fixedLabel = startCase(labelName);\n if (isGroup(layout)) {\n layout.label = fixedLabel;\n } else {\n // add label with name\n const label: LabelElement = {\n type: 'Label',\n text: fixedLabel,\n };\n layout.elements.push(label);\n }\n }\n};\n\n/**\n * Returns whether the given {@code jsonSchema} is a combinator ({@code oneOf}, {@code anyOf}, {@code allOf}) at the root level\n * @param jsonSchema\n * the schema to check\n */\nconst isCombinator = (jsonSchema: JsonSchema): boolean => {\n return (\n !isEmpty(jsonSchema) &&\n (!isEmpty(jsonSchema.oneOf) ||\n !isEmpty(jsonSchema.anyOf) ||\n !isEmpty(jsonSchema.allOf))\n );\n};\n\nconst generateUISchema = (\n jsonSchema: JsonSchema,\n schemaElements: UISchemaElement[],\n currentRef: string,\n schemaName: string,\n layoutType: string,\n rootSchema?: JsonSchema\n): UISchemaElement => {\n if (!isEmpty(jsonSchema) && jsonSchema.$ref !== undefined) {\n return generateUISchema(\n resolveSchema(rootSchema, jsonSchema.$ref, rootSchema),\n schemaElements,\n currentRef,\n schemaName,\n layoutType,\n rootSchema\n );\n }\n\n if (isCombinator(jsonSchema)) {\n const controlObject: ControlElement = createControlElement(currentRef);\n schemaElements.push(controlObject);\n\n return controlObject;\n }\n\n const types = deriveTypes(jsonSchema);\n if (types.length === 0) {\n return null;\n }\n\n if (types.length > 1) {\n const controlObject: ControlElement = createControlElement(currentRef);\n schemaElements.push(controlObject);\n return controlObject;\n }\n\n if (currentRef === '#' && types[0] === 'object') {\n const layout: Layout = createLayout(layoutType);\n schemaElements.push(layout);\n\n if (jsonSchema.properties && keys(jsonSchema.properties).length > 1) {\n addLabel(layout, schemaName);\n }\n\n if (!isEmpty(jsonSchema.properties)) {\n // traverse properties\n const nextRef: string = currentRef + '/properties';\n Object.keys(jsonSchema.properties).map((propName) => {\n let value = jsonSchema.properties[propName];\n const ref = `${nextRef}/${encode(propName)}`;\n if (value.$ref !== undefined) {\n value = resolveSchema(rootSchema, value.$ref, rootSchema);\n }\n generateUISchema(\n value,\n layout.elements,\n ref,\n propName,\n layoutType,\n rootSchema\n );\n });\n }\n\n return layout;\n }\n\n switch (types[0]) {\n case 'object': // object items will be handled by the object control itself\n /* falls through */\n case 'array': // array items will be handled by the array control itself\n /* falls through */\n case 'string':\n /* falls through */\n case 'number':\n /* falls through */\n case 'integer':\n /* falls through */\n case 'null':\n /* falls through */\n case 'boolean': {\n const controlObject: ControlElement = createControlElement(currentRef);\n schemaElements.push(controlObject);\n\n return controlObject;\n }\n default:\n throw new Error('Unknown type: ' + JSON.stringify(jsonSchema));\n }\n};\n\n/**\n * Generate a default UI schema.\n * @param {JsonSchema} jsonSchema the JSON schema to generated a UI schema for\n * @param {string} layoutType the desired layout type for the root layout\n * of the generated UI schema\n */\nexport const generateDefaultUISchema = (\n jsonSchema: JsonSchema,\n layoutType = 'VerticalLayout',\n prefix = '#',\n rootSchema = jsonSchema\n): UISchemaElement =>\n wrapInLayoutIfNecessary(\n generateUISchema(jsonSchema, [], prefix, '', layoutType, rootSchema),\n layoutType\n );\n","/*\n The MIT License\n \n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport { generateJsonSchema } from './schema';\nimport { createControlElement, generateDefaultUISchema } from './uischema';\nimport type { ControlElement, JsonSchema, UISchemaElement } from '../';\n\nexport const Generate: {\n // TODO fix @typescript-eslint/ban-types\n // eslint-disable-next-line @typescript-eslint/ban-types\n jsonSchema(instance: Object, options?: any): JsonSchema;\n uiSchema(\n jsonSchema: JsonSchema,\n layoutType?: string,\n prefix?: string,\n rootSchema?: JsonSchema\n ): UISchemaElement;\n controlElement(ref: string): ControlElement;\n} = {\n jsonSchema: generateJsonSchema,\n uiSchema: generateDefaultUISchema,\n controlElement: createControlElement,\n};\n","/*\n The MIT License\n \n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport type AJV from 'ajv';\nimport type { ErrorObject } from 'ajv';\nimport type { JsonSchema, UISchemaElement } from '../models';\nimport { generateDefaultUISchema, generateJsonSchema } from '../generators';\n\nimport type { RankedTester } from '../testers';\nimport type { UISchemaTester, ValidationMode } from '../reducers';\nimport type { ErrorTranslator, Translator } from '../i18n';\n\nexport const INIT = 'jsonforms/INIT' as const;\nexport const UPDATE_CORE = 'jsonforms/UPDATE_CORE' as const;\nexport const SET_AJV = 'jsonforms/SET_AJV' as const;\nexport const UPDATE_DATA = 'jsonforms/UPDATE' as const;\nexport const UPDATE_ERRORS = 'jsonforms/UPDATE_ERRORS' as const;\nexport const VALIDATE = 'jsonforms/VALIDATE' as const;\nexport const ADD_RENDERER = 'jsonforms/ADD_RENDERER' as const;\nexport const REMOVE_RENDERER = 'jsonforms/REMOVE_RENDERER' as const;\nexport const ADD_CELL = 'jsonforms/ADD_CELL' as const;\nexport const REMOVE_CELL = 'jsonforms/REMOVE_CELL' as const;\nexport const SET_CONFIG = 'jsonforms/SET_CONFIG' as const;\nexport const ADD_UI_SCHEMA = 'jsonforms/ADD_UI_SCHEMA' as const;\nexport const REMOVE_UI_SCHEMA = 'jsonforms/REMOVE_UI_SCHEMA' as const;\nexport const SET_SCHEMA = 'jsonforms/SET_SCHEMA' as const;\nexport const SET_UISCHEMA = 'jsonforms/SET_UISCHEMA' as const;\nexport const SET_VALIDATION_MODE = 'jsonforms/SET_VALIDATION_MODE' as const;\n\nexport const SET_LOCALE = 'jsonforms/SET_LOCALE' as const;\nexport const SET_TRANSLATOR = 'jsonforms/SET_TRANSLATOR' as const;\nexport const UPDATE_I18N = 'jsonforms/UPDATE_I18N' as const;\n\nexport const ADD_DEFAULT_DATA = 'jsonforms/ADD_DEFAULT_DATA' as const;\nexport const REMOVE_DEFAULT_DATA = 'jsonforms/REMOVE_DEFAULT_DATA' as const;\n\nexport type CoreActions =\n | InitAction\n | UpdateCoreAction\n | UpdateAction\n | UpdateErrorsAction\n | SetAjvAction\n | SetSchemaAction\n | SetUISchemaAction\n | SetValidationModeAction;\n\nexport interface UpdateAction {\n type: 'jsonforms/UPDATE';\n path: string;\n updater(existingData?: any): any;\n}\n\nexport interface UpdateErrorsAction {\n type: 'jsonforms/UPDATE_ERRORS';\n errors: ErrorObject[];\n}\n\nexport interface InitAction {\n type: 'jsonforms/INIT';\n data: any;\n schema: JsonSchema;\n uischema: UISchemaElement;\n options?: InitActionOptions | AJV;\n}\n\nexport interface UpdateCoreAction {\n type: 'jsonforms/UPDATE_CORE';\n data?: any;\n schema?: JsonSchema;\n uischema?: UISchemaElement;\n options?: InitActionOptions | AJV;\n}\n\nexport interface InitActionOptions {\n ajv?: AJV;\n validationMode?: ValidationMode;\n additionalErrors?: ErrorObject[];\n}\n\nexport interface SetValidationModeAction {\n type: 'jsonforms/SET_VALIDATION_MODE';\n validationMode: ValidationMode;\n}\n\nexport const init = (\n data: any,\n schema: JsonSchema = generateJsonSchema(data),\n uischema?: UISchemaElement,\n options?: InitActionOptions | AJV\n) => ({\n type: INIT,\n data,\n schema,\n uischema:\n typeof uischema === 'object' ? uischema : generateDefaultUISchema(schema),\n options,\n});\n\nexport const updateCore = (\n data: any,\n schema: JsonSchema,\n uischema?: UISchemaElement,\n options?: AJV | InitActionOptions\n): UpdateCoreAction => ({\n type: UPDATE_CORE,\n data,\n schema,\n uischema,\n options,\n});\n\nexport interface RegisterDefaultDataAction {\n type: 'jsonforms/ADD_DEFAULT_DATA';\n schemaPath: string;\n data: any;\n}\n\nexport const registerDefaultData = (schemaPath: string, data: any) => ({\n type: ADD_DEFAULT_DATA,\n schemaPath,\n data,\n});\n\nexport interface UnregisterDefaultDataAction {\n type: 'jsonforms/REMOVE_DEFAULT_DATA';\n schemaPath: string;\n}\n\nexport const unregisterDefaultData = (schemaPath: string) => ({\n type: REMOVE_DEFAULT_DATA,\n schemaPath,\n});\n\nexport interface SetAjvAction {\n type: 'jsonforms/SET_AJV';\n ajv: AJV;\n}\n\nexport const setAjv = (ajv: AJV) => ({\n type: SET_AJV,\n ajv,\n});\n\nexport const update = (\n path: string,\n updater: (existingData: any) => any\n): UpdateAction => ({\n type: UPDATE_DATA,\n path,\n updater,\n});\n\nexport const updateErrors = (errors: ErrorObject[]): UpdateErrorsAction => ({\n type: UPDATE_ERRORS,\n errors,\n});\n\nexport interface AddRendererAction {\n type: 'jsonforms/ADD_RENDERER';\n tester: RankedTester;\n renderer: any;\n}\n\nexport const registerRenderer = (tester: RankedTester, renderer: any) => ({\n type: ADD_RENDERER,\n tester,\n renderer,\n});\n\nexport interface AddCellRendererAction {\n type: 'jsonforms/ADD_CELL';\n tester: RankedTester;\n cell: any;\n}\n\nexport const registerCell = (tester: RankedTester, cell: any) => ({\n type: ADD_CELL,\n tester,\n cell,\n});\n\nexport interface RemoveCellRendererAction {\n type: 'jsonforms/REMOVE_CELL';\n tester: RankedTester;\n cell: any;\n}\n\nexport const unregisterCell = (tester: RankedTester, cell: any) => ({\n type: REMOVE_CELL,\n tester,\n cell,\n});\n\nexport interface RemoveRendererAction {\n type: 'jsonforms/REMOVE_RENDERER';\n tester: RankedTester;\n renderer: any;\n}\n\nexport const unregisterRenderer = (tester: RankedTester, renderer: any) => ({\n type: REMOVE_RENDERER,\n tester,\n renderer,\n});\n\nexport interface SetConfigAction {\n type: 'jsonforms/SET_CONFIG';\n config: any;\n}\n\nexport const setConfig = (config: any): SetConfigAction => ({\n type: SET_CONFIG,\n config,\n});\n\nexport const setValidationMode = (\n validationMode: ValidationMode\n): SetValidationModeAction => ({\n type: SET_VALIDATION_MODE,\n validationMode,\n});\n\nexport type UISchemaActions = AddUISchemaAction | RemoveUISchemaAction;\n\nexport interface AddUISchemaAction {\n type: 'jsonforms/ADD_UI_SCHEMA';\n tester: UISchemaTester;\n uischema: UISchemaElement;\n}\n\nexport const registerUISchema = (\n tester: UISchemaTester,\n uischema: UISchemaElement\n): AddUISchemaAction => {\n return {\n type: ADD_UI_SCHEMA,\n tester,\n uischema,\n };\n};\n\nexport interface RemoveUISchemaAction {\n type: 'jsonforms/REMOVE_UI_SCHEMA';\n tester: UISchemaTester;\n}\n\nexport const unregisterUISchema = (\n tester: UISchemaTester\n): RemoveUISchemaAction => {\n return {\n type: REMOVE_UI_SCHEMA,\n tester,\n };\n};\n\nexport type I18nActions =\n | SetLocaleAction\n | SetTranslatorAction\n | UpdateI18nAction;\n\nexport interface SetLocaleAction {\n type: 'jsonforms/SET_LOCALE';\n locale: string | undefined;\n}\n\nexport const setLocale = (locale: string | undefined): SetLocaleAction => ({\n type: SET_LOCALE,\n locale,\n});\n\nexport interface SetSchemaAction {\n type: 'jsonforms/SET_SCHEMA';\n schema: JsonSchema;\n}\n\nexport const setSchema = (schema: JsonSchema): SetSchemaAction => ({\n type: SET_SCHEMA,\n schema,\n});\n\nexport interface SetTranslatorAction {\n type: 'jsonforms/SET_TRANSLATOR';\n translator?: Translator;\n errorTranslator?: ErrorTranslator;\n}\n\nexport const setTranslator = (\n translator?: Translator,\n errorTranslator?: ErrorTranslator\n): SetTranslatorAction => ({\n type: SET_TRANSLATOR,\n translator,\n errorTranslator,\n});\n\nexport interface UpdateI18nAction {\n type: 'jsonforms/UPDATE_I18N';\n locale: string | undefined;\n translator: Translator | undefined;\n errorTranslator: ErrorTranslator | undefined;\n}\n\nexport const updateI18n = (\n locale: string | undefined,\n translator: Translator | undefined,\n errorTranslator: ErrorTranslator | undefined\n): UpdateI18nAction => ({\n type: UPDATE_I18N,\n locale,\n translator,\n errorTranslator,\n});\n\nexport interface SetUISchemaAction {\n type: 'jsonforms/SET_UISCHEMA';\n uischema: UISchemaElement;\n}\n\nexport const setUISchema = (uischema: UISchemaElement): SetUISchemaAction => ({\n type: SET_UISCHEMA,\n uischema,\n});\n","/*\n The MIT License\n \n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport { convertToValidClassName, createLabelDescriptionFrom } from './util';\nimport type { ControlElement, JsonSchema, LabelDescription } from './models';\n\nexport const Helpers: {\n createLabelDescriptionFrom(\n withLabel: ControlElement,\n schema: JsonSchema\n ): LabelDescription;\n convertToValidClassName(s: string): string;\n} = {\n createLabelDescriptionFrom,\n convertToValidClassName,\n};\n"],"names":["isObjectSchema","evaluateCondition","composePaths"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,MAAM,qBAAqB,GAAG,sBAAsB,CAAC;AACrD,MAAM,mBAAmB,GAAG,UAAU,CAAC;AAIvC,MAAM,QAAQ,GAAG,CACf,UAAiB,EACjB,aAAoC,KACnB;IACjB,MAAM,KAAK,GAAoC,EAAE,CAAC;AAElD,IAAA,OAAO,UAAU,CAAC,MAAM,CAAC,CAAC,IAAI,KAAI;AAChC,QAAA,MAAM,kBAAkB,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC;AAC/C,QAAA,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,KAAK,EAAE,kBAAkB,CAAC,EAAE;AACnE,YAAA,OAAO,KAAK,CAAC;AACd,SAAA;AAAM,aAAA;AACL,YAAA,KAAK,CAAC,kBAAkB,CAAC,GAAG,IAAI,CAAC;AACjC,YAAA,OAAO,IAAI,CAAC;AACb,SAAA;AACH,KAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,MAAM,GAAG,CAAA;AACP,IAAA,WAAA,CACU,UAA8D,EAAA;QAA9D,IAAU,CAAA,UAAA,GAAV,UA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AuB;;;;;"} \ No newline at end of file +{"version":3,"file":"jsonforms-core.esm.js","sources":["../src/generators/schema.ts","../src/models/draft4.ts","../src/models/uischema.ts","../src/util/array.ts","../src/reducers/cells.ts","../src/configDefault.ts","../src/reducers/config.ts","../src/reducers/core.ts","../src/reducers/default-data.ts","../src/i18n/i18nUtil.ts","../src/i18n/arrayTranslations.ts","../src/i18n/combinatorTranslations.ts","../src/reducers/i18n.ts","../src/reducers/renderers.ts","../src/testers/testers.ts","../src/reducers/uischemas.ts","../src/reducers/reducers.ts","../src/reducers/selectors.ts","../src/reducers/middleware.ts","../src/util/path.ts","../src/util/resolvers.ts","../src/util/runtime.ts","../src/util/util.ts","../src/util/label.ts","../src/util/renderer.ts","../src/util/cell.ts","../src/util/combinators.ts","../src/util/ids.ts","../src/util/schema.ts","../src/util/uischema.ts","../src/util/validator.ts","../src/util/defaultDateFormat.ts","../src/generators/uischema.ts","../src/generators/Generate.ts","../src/actions/actions.ts","../src/Helpers.ts"],"sourcesContent":["/*\n The MIT License\n \n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport type { JsonSchema4 } from '../models';\n\nconst ADDITIONAL_PROPERTIES = 'additionalProperties';\nconst REQUIRED_PROPERTIES = 'required';\n\ntype Properties = { [property: string]: JsonSchema4 };\n\nconst distinct = (\n properties: any[],\n discriminator: (item: any) => string\n): JsonSchema4[] => {\n const known: { [property: string]: boolean } = {};\n\n return properties.filter((item) => {\n const discriminatorValue = discriminator(item);\n if (Object.prototype.hasOwnProperty.call(known, discriminatorValue)) {\n return false;\n } else {\n known[discriminatorValue] = true;\n return true;\n }\n });\n};\n\nclass Gen {\n constructor(\n private findOption: (props: Properties) => (optionName: string) => any\n ) {}\n\n // TODO fix @typescript-eslint/ban-types\n // eslint-disable-next-line @typescript-eslint/ban-types\n schemaObject = (data: Object): JsonSchema4 => {\n const props: Properties = this.properties(data);\n const schema: JsonSchema4 = {\n type: 'object',\n properties: props,\n additionalProperties: this.findOption(props)(ADDITIONAL_PROPERTIES),\n };\n const required = this.findOption(props)(REQUIRED_PROPERTIES);\n if (required.length > 0) {\n schema.required = required;\n }\n\n return schema;\n };\n\n properties = (data: any): Properties => {\n const emptyProps: Properties = {};\n\n return Object.keys(data).reduce((acc: Properties, propName: string) => {\n acc[propName] = this.property(data[propName]);\n\n return acc;\n }, emptyProps);\n };\n\n property = (data: any): JsonSchema4 => {\n switch (typeof data) {\n case 'string':\n return { type: 'string' };\n case 'boolean':\n return { type: 'boolean' };\n case 'number':\n if (Number.isInteger(data)) {\n return { type: 'integer' };\n }\n\n return { type: 'number' };\n case 'object':\n if (data == null) {\n return { type: 'null' };\n }\n\n return this.schemaObjectOrArray(data);\n default:\n return {};\n }\n };\n\n schemaObjectOrArray = (data: any): JsonSchema4 => {\n if (data instanceof Array) {\n return this.schemaArray(data as any[]);\n } else {\n return this.schemaObject(data);\n }\n };\n\n schemaArray = (data: any[]): JsonSchema4 => {\n if (data.length > 0) {\n const allProperties: JsonSchema4[] = data.map(this.property);\n const uniqueProperties = distinct(allProperties, (prop) =>\n JSON.stringify(prop)\n );\n if (uniqueProperties.length === 1) {\n return {\n type: 'array',\n items: uniqueProperties[0],\n };\n } else {\n return {\n type: 'array',\n items: {\n oneOf: uniqueProperties,\n },\n };\n }\n } else {\n return {\n type: 'array',\n items: {},\n };\n }\n };\n}\n\n/**\n * Generate a JSON schema based on the given data and any additional options.\n * @param {Object} instance the data to create a JSON schema for\n * @param {any} options any additional options that may alter the generated JSON schema\n * @returns {JsonSchema} the generated schema\n */\nexport const generateJsonSchema = (\n // TODO fix @typescript-eslint/ban-types\n // eslint-disable-next-line @typescript-eslint/ban-types\n instance: Object,\n options: any = {}\n): JsonSchema4 => {\n const findOption =\n (props: Properties) =>\n (optionName: string): boolean | string[] => {\n switch (optionName) {\n case ADDITIONAL_PROPERTIES:\n if (\n Object.prototype.hasOwnProperty.call(options, ADDITIONAL_PROPERTIES)\n ) {\n return options[ADDITIONAL_PROPERTIES];\n }\n\n return true;\n case REQUIRED_PROPERTIES:\n if (\n Object.prototype.hasOwnProperty.call(options, REQUIRED_PROPERTIES)\n ) {\n return options[REQUIRED_PROPERTIES](props);\n }\n\n return Object.keys(props);\n default:\n return;\n }\n };\n\n const gen = new Gen(findOption);\n\n return gen.schemaObject(instance);\n};\n","/*\n The MIT License\n \n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nexport const Draft4 = {\n id: 'http://json-schema.org/draft-04/schema#',\n $schema: 'http://json-schema.org/draft-04/schema#',\n description: 'Core schema meta-schema',\n definitions: {\n schemaArray: {\n type: 'array',\n minItems: 1,\n items: { $ref: '#' },\n },\n positiveInteger: {\n type: 'integer',\n minimum: 0,\n },\n positiveIntegerDefault0: {\n allOf: [{ $ref: '#/definitions/positiveInteger' }, { default: 0 }],\n },\n simpleTypes: {\n enum: [\n 'array',\n 'boolean',\n 'integer',\n 'null',\n 'number',\n 'object',\n 'string',\n ],\n },\n stringArray: {\n type: 'array',\n items: { type: 'string' },\n minItems: 1,\n uniqueItems: true,\n },\n },\n type: 'object',\n properties: {\n id: {\n type: 'string',\n format: 'uri',\n },\n $schema: {\n type: 'string',\n format: 'uri',\n },\n title: {\n type: 'string',\n },\n description: {\n type: 'string',\n },\n default: {},\n multipleOf: {\n type: 'number',\n minimum: 0,\n exclusiveMinimum: true,\n },\n maximum: {\n type: 'number',\n },\n exclusiveMaximum: {\n type: 'boolean',\n default: false,\n },\n minimum: {\n type: 'number',\n },\n exclusiveMinimum: {\n type: 'boolean',\n default: false,\n },\n maxLength: { $ref: '#/definitions/positiveInteger' },\n minLength: { $ref: '#/definitions/positiveIntegerDefault0' },\n pattern: {\n type: 'string',\n format: 'regex',\n },\n additionalItems: {\n anyOf: [{ type: 'boolean' }, { $ref: '#' }],\n default: {},\n },\n items: {\n anyOf: [{ $ref: '#' }, { $ref: '#/definitions/schemaArray' }],\n default: {},\n },\n maxItems: { $ref: '#/definitions/positiveInteger' },\n minItems: { $ref: '#/definitions/positiveIntegerDefault0' },\n uniqueItems: {\n type: 'boolean',\n default: false,\n },\n maxProperties: { $ref: '#/definitions/positiveInteger' },\n minProperties: { $ref: '#/definitions/positiveIntegerDefault0' },\n required: { $ref: '#/definitions/stringArray' },\n additionalProperties: {\n anyOf: [{ type: 'boolean' }, { $ref: '#' }],\n default: {},\n },\n definitions: {\n type: 'object',\n additionalProperties: { $ref: '#' },\n default: {},\n },\n properties: {\n type: 'object',\n additionalProperties: { $ref: '#' },\n default: {},\n },\n patternProperties: {\n type: 'object',\n additionalProperties: { $ref: '#' },\n default: {},\n },\n dependencies: {\n type: 'object',\n additionalProperties: {\n anyOf: [{ $ref: '#' }, { $ref: '#/definitions/stringArray' }],\n },\n },\n enum: {\n type: 'array',\n minItems: 1,\n uniqueItems: true,\n },\n type: {\n anyOf: [\n { $ref: '#/definitions/simpleTypes' },\n {\n type: 'array',\n items: { $ref: '#/definitions/simpleTypes' },\n minItems: 1,\n uniqueItems: true,\n },\n ],\n },\n allOf: { $ref: '#/definitions/schemaArray' },\n anyOf: { $ref: '#/definitions/schemaArray' },\n oneOf: { $ref: '#/definitions/schemaArray' },\n not: { $ref: '#' },\n },\n dependencies: {\n exclusiveMaximum: ['maximum'],\n exclusiveMinimum: ['minimum'],\n },\n default: {},\n};\n","/*\n The MIT License\n \n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport type { JsonSchema } from './jsonSchema';\n\n/**\n * Interface for describing an UI schema element that is referencing\n * a subschema. The value of the scope may be a JSON Pointer.\n */\nexport interface Scopable {\n /**\n * The scope that determines to which part this element should be bound to.\n */\n scope?: string;\n}\n\n/**\n * Interface for describing an UI schema element that is referencing\n * a subschema. The value of the scope must be a JSON Pointer.\n */\nexport interface Scoped extends Scopable {\n /**\n * The scope that determines to which part this element should be bound to.\n */\n scope: string;\n}\n\n/**\n * Interface for describing an UI schema element that may be labeled.\n */\nexport interface Labelable {\n /**\n * Label for UI schema element.\n */\n label?: string | T;\n}\n\n/**\n * Interface for describing an UI schema element that is labeled.\n */\nexport interface Labeled extends Labelable {\n label: string | T;\n}\n\n/*\n * Interface for describing an UI schema element that can provide an internationalization base key.\n * If defined, this key is suffixed to derive applicable message keys for the UI schema element.\n * For example, such suffixes are `.label` or `.description` to derive the corresponding message keys for a control element.\n */\nexport interface Internationalizable {\n i18n?: string;\n}\n\n/**\n * A rule that may be attached to any UI schema element.\n */\nexport interface Rule {\n /**\n * The effect of the rule\n */\n effect: RuleEffect;\n\n /**\n * The condition of the rule that must evaluate to true in order\n * to trigger the effect.\n */\n condition: Condition;\n}\n\n/**\n * The different rule effects.\n */\nexport enum RuleEffect {\n /**\n * Effect that hides the associated element.\n */\n HIDE = 'HIDE',\n /**\n * Effect that shows the associated element.\n */\n SHOW = 'SHOW',\n /**\n * Effect that enables the associated element.\n */\n ENABLE = 'ENABLE',\n /**\n * Effect that disables the associated element.\n */\n DISABLE = 'DISABLE',\n}\n\n/**\n * Represents a condition to be evaluated.\n */\nexport interface Condition {\n /**\n * The type of condition.\n */\n readonly type?: string;\n}\n\n/**\n * A leaf condition.\n */\nexport interface LeafCondition extends Condition, Scoped {\n type: 'LEAF';\n\n /**\n * The expected value when evaluating the condition\n */\n expectedValue: any;\n}\n\nexport interface SchemaBasedCondition extends Condition, Scoped {\n schema: JsonSchema;\n\n /**\n * When the scope resolves to undefined and `failWhenUndefined` is set to `true`, the condition\n * will fail. Therefore the reverse effect will be applied.\n *\n * Background:\n * Most JSON Schemas will successfully validate against `undefined` data. Specifying that a\n * condition shall fail when data is `undefined` requires to lift the scope to being able to use\n * JSON Schema's `required`.\n *\n * Using `failWhenUndefined` allows to more conveniently express this condition.\n */\n failWhenUndefined?: boolean;\n}\n\n/**\n * A composable condition.\n */\nexport interface ComposableCondition extends Condition {\n conditions: Condition[];\n}\n\n/**\n * An or condition.\n */\nexport interface OrCondition extends ComposableCondition {\n type: 'OR';\n}\n\n/**\n * An and condition.\n */\nexport interface AndCondition extends ComposableCondition {\n type: 'AND';\n}\n\n/**\n * Common base interface for any UI schema element.\n */\nexport interface UISchemaElement {\n /**\n * The type of this UI schema element.\n */\n type: string;\n\n /**\n * An optional rule.\n */\n rule?: Rule;\n\n /**\n * Any additional options.\n */\n options?: { [key: string]: any };\n}\n\n/**\n * Represents a layout element which can order its children\n * in a specific way.\n */\nexport interface Layout extends UISchemaElement {\n /**\n * The child elements of this layout.\n */\n elements: UISchemaElement[];\n}\n\n/**\n * A layout which orders its child elements vertically (i.e. from top to bottom).\n */\nexport interface VerticalLayout extends Layout {\n type: 'VerticalLayout';\n}\n\n/**\n * A layout which orders its children horizontally (i.e. from left to right).\n */\nexport interface HorizontalLayout extends Layout {\n type: 'HorizontalLayout';\n}\n\n/**\n * A group resembles a vertical layout, but additionally might have a label.\n * This layout is useful when grouping different elements by a certain criteria.\n */\nexport interface GroupLayout extends Layout, Labelable, Internationalizable {\n type: 'Group';\n}\n\n/**\n * Represents an object that can be used to configure a label.\n */\nexport interface LabelDescription {\n /**\n * An optional text to be displayed.\n */\n text?: string;\n /**\n * Optional property that determines whether to show this label.\n */\n show?: boolean;\n}\n\n/**\n * A label element.\n */\nexport interface LabelElement extends UISchemaElement, Internationalizable {\n type: 'Label';\n /**\n * The text of label.\n */\n text: string;\n}\n\n/**\n * A control element. The scope property of the control determines\n * to which part of the schema the control should be bound.\n */\nexport interface ControlElement\n extends UISchemaElement,\n Scoped,\n Labelable,\n Internationalizable {\n type: 'Control';\n}\n\n/**\n * The category layout.\n */\nexport interface Category extends Layout, Labeled, Internationalizable {\n type: 'Category';\n}\n\n/**\n * The categorization element, which may have children elements.\n * A child element may either be itself a Categorization or a Category, hence\n * the categorization element can be used to represent recursive structures like trees.\n */\nexport interface Categorization\n extends UISchemaElement,\n Labeled,\n Internationalizable {\n type: 'Categorization';\n /**\n * The child elements of this categorization which are either of type\n * {@link Category} or {@link Categorization}.\n */\n elements: (Category | Categorization)[];\n}\n\nexport const isInternationalized = (\n element: unknown\n): element is Required =>\n typeof element === 'object' &&\n element !== null &&\n typeof (element as Internationalizable).i18n === 'string';\n\nexport const isGroup = (layout: Layout): layout is GroupLayout =>\n layout.type === 'Group';\n\nexport const isLayout = (uischema: UISchemaElement): uischema is Layout =>\n (uischema as Layout).elements !== undefined;\n\nexport const isScopable = (obj: unknown): obj is Scopable =>\n !!obj && typeof obj === 'object';\n\nexport const isScoped = (obj: unknown): obj is Scoped =>\n isScopable(obj) && typeof obj.scope === 'string';\n\nexport const isLabelable = (obj: unknown): obj is Labelable =>\n !!obj && typeof obj === 'object';\n\nexport const isLabeled = (obj: unknown): obj is Labeled =>\n isLabelable(obj) && ['string', 'boolean'].includes(typeof obj.label);\n","/*\n The MIT License\n\n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nconst move = (array: any[], index: number, delta: number) => {\n const newIndex: number = index + delta;\n if (newIndex < 0 || newIndex >= array.length) {\n return;\n } // Already at the top or bottom.\n const indexes: number[] = [index, newIndex].sort((a, b) => a - b); // Sort the indixes\n array.splice(indexes[0], 2, array[indexes[1]], array[indexes[0]]);\n};\n\nconst moveUp = (array: any[], toMove: number) => {\n move(array, toMove, -1);\n};\n\nconst moveDown = (array: any[], toMove: number) => {\n move(array, toMove, 1);\n};\n\nexport { moveUp, moveDown };\n","/*\n The MIT License\n \n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport type { RankedTester } from '../testers';\nimport {\n ADD_CELL,\n AddCellRendererAction,\n REMOVE_CELL,\n RemoveCellRendererAction,\n} from '../actions';\nimport type { Reducer } from '../util';\n\ntype ValidCellReducerActions = AddCellRendererAction | RemoveCellRendererAction;\n\nexport type JsonFormsCellRendererRegistryState =\n JsonFormsCellRendererRegistryEntry[];\n\nexport interface JsonFormsCellRendererRegistryEntry {\n tester: RankedTester;\n cell: any;\n}\n\nexport const cellReducer: Reducer<\n JsonFormsCellRendererRegistryState,\n ValidCellReducerActions\n> = (state = [], { type, tester, cell }) => {\n switch (type) {\n case ADD_CELL:\n return state.concat([{ tester, cell }]);\n case REMOVE_CELL:\n return state.filter((t) => t.tester !== tester);\n default:\n return state;\n }\n};\n","/*\n The MIT License\n\n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nexport const configDefault = {\n /*\n * [text] whether to restrict the number of characters to maxLength,\n * if specified in the JSON schema\n */\n restrict: false,\n\n /*\n * [text] whether to resize the input's width to maxLength,\n * if specified in the JSON schema\n */\n trim: false,\n\n /*\n * [text] if input descriptions should hide when not focused\n */\n showUnfocusedDescription: false,\n\n /*\n * [text] if asterisks in labels for required fields should be hidden\n */\n hideRequiredAsterisk: false,\n\n /**\n * [text] if dynamic checks for conditional application of properties\n * should be performed (e.g. check for conditional required)\n */\n allowDynamicCheck: false,\n};\n","/*\n The MIT License\n \n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport merge from 'lodash/merge';\nimport { SET_CONFIG, SetConfigAction } from '../actions';\nimport { configDefault } from '../configDefault';\nimport type { Reducer } from '../util';\n\nconst applyDefaultConfiguration = (config: any = {}) =>\n merge({}, configDefault, config);\n\nexport const configReducer: Reducer = (\n state = applyDefaultConfiguration(),\n action\n) => {\n switch (action.type) {\n case SET_CONFIG:\n return applyDefaultConfiguration(action.config);\n default:\n return state;\n }\n};\n","/*\n The MIT License\n\n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport cloneDeep from 'lodash/cloneDeep';\nimport setFp from 'lodash/fp/set';\nimport unsetFp from 'lodash/fp/unset';\nimport get from 'lodash/get';\nimport filter from 'lodash/filter';\nimport isEqual from 'lodash/isEqual';\nimport isFunction from 'lodash/isFunction';\nimport type Ajv from 'ajv';\nimport type { ErrorObject, ValidateFunction } from 'ajv';\nimport {\n CoreActions,\n INIT,\n InitAction,\n InitActionOptions,\n SET_AJV,\n SET_SCHEMA,\n SET_UISCHEMA,\n SET_VALIDATION_MODE,\n UPDATE_DATA,\n UPDATE_ERRORS,\n UPDATE_CORE,\n UpdateCoreAction,\n} from '../actions';\nimport { createAjv, decode, isOneOfEnumSchema, Reducer } from '../util';\nimport type { JsonSchema, UISchemaElement } from '../models';\n\nexport const validate = (\n validator: ValidateFunction | undefined,\n data: any\n): ErrorObject[] => {\n if (validator === undefined) {\n return [];\n }\n const valid = validator(data);\n if (valid) {\n return [];\n }\n return validator.errors;\n};\n\nexport type ValidationMode =\n | 'ValidateAndShow'\n | 'ValidateAndHide'\n | 'NoValidation';\n\nexport interface JsonFormsCore {\n data: any;\n schema: JsonSchema;\n uischema: UISchemaElement;\n errors?: ErrorObject[];\n additionalErrors?: ErrorObject[];\n validator?: ValidateFunction;\n ajv?: Ajv;\n validationMode?: ValidationMode;\n}\n\nconst initState: JsonFormsCore = {\n data: {},\n schema: {},\n uischema: undefined,\n errors: [],\n validator: undefined,\n ajv: undefined,\n validationMode: 'ValidateAndShow',\n additionalErrors: [],\n};\n\nconst getOrCreateAjv = (\n state: JsonFormsCore,\n action?: InitAction | UpdateCoreAction\n): Ajv => {\n if (action) {\n if (hasAjvOption(action.options)) {\n // options object with ajv\n return action.options.ajv;\n } else if (action.options !== undefined) {\n // it is not an option object => should be ajv itself => check for compile function\n if (isFunction(action.options.compile)) {\n return action.options;\n }\n }\n }\n return state.ajv ? state.ajv : createAjv();\n};\n\nconst hasAjvOption = (option: any): option is InitActionOptions => {\n if (option) {\n return option.ajv !== undefined;\n }\n return false;\n};\n\nconst getValidationMode = (\n state: JsonFormsCore,\n action?: InitAction | UpdateCoreAction\n): ValidationMode => {\n if (action && hasValidationModeOption(action.options)) {\n return action.options.validationMode;\n }\n return state.validationMode;\n};\n\nconst hasValidationModeOption = (option: any): option is InitActionOptions => {\n if (option) {\n return option.validationMode !== undefined;\n }\n return false;\n};\n\nconst hasAdditionalErrorsOption = (\n option: any\n): option is InitActionOptions => {\n if (option) {\n return option.additionalErrors !== undefined;\n }\n return false;\n};\n\nconst getAdditionalErrors = (\n state: JsonFormsCore,\n action?: InitAction | UpdateCoreAction\n): ErrorObject[] => {\n if (action && hasAdditionalErrorsOption(action.options)) {\n return action.options.additionalErrors;\n }\n return state.additionalErrors;\n};\n\nexport const coreReducer: Reducer = (\n state = initState,\n action\n) => {\n switch (action.type) {\n case INIT: {\n const thisAjv = getOrCreateAjv(state, action);\n\n const validationMode = getValidationMode(state, action);\n const v =\n validationMode === 'NoValidation'\n ? undefined\n : thisAjv.compile(action.schema);\n const e = validate(v, action.data);\n const additionalErrors = getAdditionalErrors(state, action);\n\n return {\n ...state,\n data: action.data,\n schema: action.schema,\n uischema: action.uischema,\n additionalErrors,\n errors: e,\n validator: v,\n ajv: thisAjv,\n validationMode,\n };\n }\n case UPDATE_CORE: {\n const thisAjv = getOrCreateAjv(state, action);\n const validationMode = getValidationMode(state, action);\n let validator = state.validator;\n let errors = state.errors;\n if (\n state.schema !== action.schema ||\n state.validationMode !== validationMode ||\n state.ajv !== thisAjv\n ) {\n // revalidate only if necessary\n validator =\n validationMode === 'NoValidation'\n ? undefined\n : thisAjv.compile(action.schema);\n errors = validate(validator, action.data);\n } else if (state.data !== action.data) {\n errors = validate(validator, action.data);\n }\n const additionalErrors = getAdditionalErrors(state, action);\n\n const stateChanged =\n state.data !== action.data ||\n state.schema !== action.schema ||\n state.uischema !== action.uischema ||\n state.ajv !== thisAjv ||\n state.errors !== errors ||\n state.validator !== validator ||\n state.validationMode !== validationMode ||\n state.additionalErrors !== additionalErrors;\n return stateChanged\n ? {\n ...state,\n data: action.data,\n schema: action.schema,\n uischema: action.uischema,\n ajv: thisAjv,\n errors: isEqual(errors, state.errors) ? state.errors : errors,\n validator: validator,\n validationMode: validationMode,\n additionalErrors,\n }\n : state;\n }\n case SET_AJV: {\n const currentAjv = action.ajv;\n const validator =\n state.validationMode === 'NoValidation'\n ? undefined\n : currentAjv.compile(state.schema);\n const errors = validate(validator, state.data);\n return {\n ...state,\n validator,\n errors,\n };\n }\n case SET_SCHEMA: {\n const needsNewValidator =\n action.schema && state.ajv && state.validationMode !== 'NoValidation';\n const v = needsNewValidator\n ? state.ajv.compile(action.schema)\n : state.validator;\n const errors = validate(v, state.data);\n return {\n ...state,\n validator: v,\n schema: action.schema,\n errors,\n };\n }\n case SET_UISCHEMA: {\n return {\n ...state,\n uischema: action.uischema,\n };\n }\n case UPDATE_DATA: {\n if (action.path === undefined || action.path === null) {\n return state;\n } else if (action.path === '') {\n // empty path is ok\n const result = action.updater(cloneDeep(state.data));\n const errors = validate(state.validator, result);\n return {\n ...state,\n data: result,\n errors,\n };\n } else {\n const oldData: any = get(state.data, action.path);\n const newData = action.updater(cloneDeep(oldData));\n let newState: any;\n if (newData !== undefined) {\n newState = setFp(\n action.path,\n newData,\n state.data === undefined ? {} : state.data\n );\n } else {\n newState = unsetFp(\n action.path,\n state.data === undefined ? {} : state.data\n );\n }\n const errors = validate(state.validator, newState);\n return {\n ...state,\n data: newState,\n errors,\n };\n }\n }\n case UPDATE_ERRORS: {\n return {\n ...state,\n errors: action.errors,\n };\n }\n case SET_VALIDATION_MODE: {\n if (state.validationMode === action.validationMode) {\n return state;\n }\n if (action.validationMode === 'NoValidation') {\n const errors = validate(undefined, state.data);\n return {\n ...state,\n errors,\n validationMode: action.validationMode,\n };\n }\n if (state.validationMode === 'NoValidation') {\n const validator = state.ajv.compile(state.schema);\n const errors = validate(validator, state.data);\n return {\n ...state,\n validator,\n errors,\n validationMode: action.validationMode,\n };\n }\n return {\n ...state,\n validationMode: action.validationMode,\n };\n }\n default:\n return state;\n }\n};\n\nexport const extractData = (state: JsonFormsCore) => get(state, 'data');\nexport const extractSchema = (state: JsonFormsCore) => get(state, 'schema');\nexport const extractUiSchema = (state: JsonFormsCore) => get(state, 'uischema');\nexport const extractAjv = (state: JsonFormsCore) => get(state, 'ajv');\n\nconst getInvalidProperty = (error: ErrorObject): string | undefined => {\n switch (error.keyword) {\n case 'required':\n case 'dependencies':\n return error.params.missingProperty;\n case 'additionalProperties':\n return error.params.additionalProperty;\n default:\n return undefined;\n }\n};\n\nexport const getControlPath = (error: ErrorObject) => {\n // Up until AJV v7 the path property was called 'dataPath'\n // With AJV v8 the property was renamed to 'instancePath'\n let controlPath = (error as any).dataPath || error.instancePath || '';\n\n // change '/' chars to '.'\n controlPath = controlPath.replace(/\\//g, '.');\n\n const invalidProperty = getInvalidProperty(error);\n if (invalidProperty !== undefined && !controlPath.endsWith(invalidProperty)) {\n controlPath = `${controlPath}.${invalidProperty}`;\n }\n\n // remove '.' chars at the beginning of paths\n controlPath = controlPath.replace(/^./, '');\n\n // decode JSON Pointer escape sequences\n controlPath = decode(controlPath);\n return controlPath;\n};\n\nexport const errorsAt =\n (\n instancePath: string,\n schema: JsonSchema,\n matchPath: (path: string) => boolean\n ) =>\n (errors: ErrorObject[]): ErrorObject[] => {\n // Get data paths of oneOf and anyOf errors to later determine whether an error occurred inside a subschema of oneOf or anyOf.\n const combinatorPaths = filter(\n errors,\n (error) => error.keyword === 'oneOf' || error.keyword === 'anyOf'\n ).map((error) => getControlPath(error));\n\n return filter(errors, (error) => {\n // Filter errors that match any keyword that we don't want to show in the UI\n // but keep the errors for oneOf enums\n if (\n filteredErrorKeywords.indexOf(error.keyword) !== -1 &&\n !isOneOfEnumSchema(error.parentSchema)\n ) {\n return false;\n }\n const controlPath = getControlPath(error);\n let result = matchPath(controlPath);\n // In anyOf and oneOf blocks with \"primitive\" (i.e. string, number etc.) or array subschemas,\n // we want to make sure that errors are only shown for the correct subschema.\n // Therefore, we compare the error's parent schema with the property's schema.\n // In the primitive case the error's data path is the same for all subschemas:\n // It directly points to the property defining the anyOf/oneOf.\n // The same holds true for errors on the array level (e.g. min item amount).\n // In contrast, this comparison must not be done for errors whose parent schema defines an object or a oneOf enum,\n // because the parent schema can never match the property schema (e.g. for 'required' checks).\n const parentSchema: JsonSchema | undefined = error.parentSchema;\n if (\n result &&\n !isObjectSchema(parentSchema) &&\n !isOneOfEnumSchema(parentSchema) &&\n combinatorPaths.findIndex((p) => instancePath.startsWith(p)) !== -1\n ) {\n result = result && isEqual(parentSchema, schema);\n }\n return result;\n });\n };\n\n/**\n * @returns true if the schema describes an object.\n */\nconst isObjectSchema = (schema?: JsonSchema): boolean => {\n return schema?.type === 'object' || !!schema?.properties;\n};\n\n/**\n * The error-type of an AJV error is defined by its `keyword` property.\n * Certain errors are filtered because they don't fit to any rendered control.\n * All of them have in common that we don't want to show them in the UI\n * because controls will show the actual reason why they don't match their correponding sub schema.\n * - additionalProperties: Indicates that a property is present that is not defined in the schema.\n * Jsonforms only allows to edit defined properties. These errors occur if an oneOf doesn't match.\n * - allOf: Indicates that not all of the allOf definitions match as a whole.\n * - anyOf: Indicates that an anyOf definition itself is not valid because none of its subschemas matches.\n * - oneOf: Indicates that an oneOf definition itself is not valid because not exactly one of its subschemas matches.\n */\nconst filteredErrorKeywords = [\n 'additionalProperties',\n 'allOf',\n 'anyOf',\n 'oneOf',\n];\n\nconst getErrorsAt =\n (\n instancePath: string,\n schema: JsonSchema,\n matchPath: (path: string) => boolean\n ) =>\n (state: JsonFormsCore): ErrorObject[] => {\n const errors = state.errors ?? [];\n const additionalErrors = state.additionalErrors ?? [];\n return errorsAt(\n instancePath,\n schema,\n matchPath\n )(\n state.validationMode === 'ValidateAndHide'\n ? additionalErrors\n : [...errors, ...additionalErrors]\n );\n };\n\nexport const errorAt = (instancePath: string, schema: JsonSchema) =>\n getErrorsAt(instancePath, schema, (path) => path === instancePath);\nexport const subErrorsAt = (instancePath: string, schema: JsonSchema) =>\n getErrorsAt(instancePath, schema, (path) =>\n path.startsWith(instancePath + '.')\n );\n","/*\n The MIT License\n\n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport {\n ADD_DEFAULT_DATA,\n RegisterDefaultDataAction,\n REMOVE_DEFAULT_DATA,\n UnregisterDefaultDataAction,\n} from '../actions';\nimport type { Reducer } from '../util';\n\nexport interface JsonFormsDefaultDataRegistryEntry {\n schemaPath: string;\n data: any;\n}\n\ntype ValidDefaultDataActions =\n | RegisterDefaultDataAction\n | UnregisterDefaultDataAction;\n\nexport const defaultDataReducer: Reducer<\n JsonFormsDefaultDataRegistryEntry[],\n ValidDefaultDataActions\n> = (state = [], action) => {\n switch (action.type) {\n case ADD_DEFAULT_DATA:\n return state.concat([\n { schemaPath: action.schemaPath, data: action.data },\n ]);\n case REMOVE_DEFAULT_DATA:\n return state.filter((t) => t.schemaPath !== action.schemaPath);\n default:\n return state;\n }\n};\n\nexport const extractDefaultData = (\n state: JsonFormsDefaultDataRegistryEntry[]\n): JsonFormsDefaultDataRegistryEntry[] => state;\n","import type { ErrorObject } from 'ajv';\nimport { isInternationalized, Labelable, UISchemaElement } from '../models';\nimport { getControlPath } from '../reducers';\nimport { formatErrorMessage } from '../util';\nimport type { i18nJsonSchema, ErrorTranslator, Translator } from './i18nTypes';\nimport {\n ArrayDefaultTranslation,\n ArrayTranslations,\n} from './arrayTranslations';\nimport {\n CombinatorDefaultTranslation,\n CombinatorTranslations,\n} from './combinatorTranslations';\n\nexport const getI18nKeyPrefixBySchema = (\n schema: i18nJsonSchema | undefined,\n uischema: unknown | undefined\n): string | undefined => {\n if (isInternationalized(uischema)) {\n return uischema.i18n;\n }\n return schema?.i18n ?? undefined;\n};\n\n/**\n * Transforms a given path to a prefix which can be used for i18n keys.\n * Returns 'root' for empty paths and removes array indices\n */\nexport const transformPathToI18nPrefix = (path: string): string => {\n return (\n path\n ?.split('.')\n .filter((segment) => !/^\\d+$/.test(segment))\n .join('.') || 'root'\n );\n};\n\nexport const getI18nKeyPrefix = (\n schema: i18nJsonSchema | undefined,\n uischema: unknown | undefined,\n path: string | undefined\n): string => {\n return (\n getI18nKeyPrefixBySchema(schema, uischema) ??\n transformPathToI18nPrefix(path)\n );\n};\n\nexport const getI18nKey = (\n schema: i18nJsonSchema | undefined,\n uischema: unknown | undefined,\n path: string | undefined,\n key: string\n): string => {\n return `${getI18nKeyPrefix(schema, uischema, path)}.${key}`;\n};\n\nexport const addI18nKeyToPrefix = (\n i18nKeyPrefix: string,\n key: string\n): string => {\n return `${i18nKeyPrefix}.${key}`;\n};\n\nexport const defaultTranslator: Translator = (\n _id: string,\n defaultMessage: string | undefined\n) => defaultMessage;\n\nexport const defaultErrorTranslator: ErrorTranslator = (error, t, uischema) => {\n // check whether there is a special keyword message\n const i18nKey = getI18nKey(\n error.parentSchema,\n uischema,\n getControlPath(error),\n `error.${error.keyword}`\n );\n const specializedKeywordMessage = t(i18nKey, undefined, { error });\n if (specializedKeywordMessage !== undefined) {\n return specializedKeywordMessage;\n }\n\n // check whether there is a generic keyword message\n const genericKeywordMessage = t(`error.${error.keyword}`, undefined, {\n error,\n });\n if (genericKeywordMessage !== undefined) {\n return genericKeywordMessage;\n }\n\n // check whether there is a customization for the default message\n const messageCustomization = t(error.message, undefined, { error });\n if (messageCustomization !== undefined) {\n return messageCustomization;\n }\n\n // rewrite required property messages (if they were not customized) as we place them next to the respective input\n if (\n error.keyword === 'required' &&\n error.message?.startsWith('must have required property')\n ) {\n return t('is a required property', 'is a required property', { error });\n }\n\n return error.message;\n};\n\n/**\n * Returns the determined error message for the given errors.\n * All errors must correspond to the given schema, uischema or path.\n */\nexport const getCombinedErrorMessage = (\n errors: ErrorObject[],\n et: ErrorTranslator,\n t: Translator,\n schema?: i18nJsonSchema,\n uischema?: UISchemaElement,\n path?: string\n) => {\n if (errors.length > 0 && t) {\n // check whether there is a special message which overwrites all others\n const customErrorKey = getI18nKey(schema, uischema, path, 'error.custom');\n const specializedErrorMessage = t(customErrorKey, undefined, {\n schema,\n uischema,\n path,\n errors,\n });\n if (specializedErrorMessage !== undefined) {\n return specializedErrorMessage;\n }\n }\n return formatErrorMessage(errors.map((error) => et(error, t, uischema)));\n};\n\n/**\n * This can be used to internationalize the label of the given Labelable (e.g. UI Schema elements).\n * This should not be used for controls as there we have additional context in the form of the JSON Schema available.\n */\nexport const deriveLabelForUISchemaElement = (\n uischema: Labelable,\n t: Translator\n): string | undefined => {\n if (uischema.label === false) {\n return undefined;\n }\n if (\n (uischema.label === undefined ||\n uischema.label === null ||\n uischema.label === true) &&\n !isInternationalized(uischema)\n ) {\n return undefined;\n }\n const stringifiedLabel =\n typeof uischema.label === 'string'\n ? uischema.label\n : JSON.stringify(uischema.label);\n const i18nKeyPrefix = getI18nKeyPrefixBySchema(undefined, uischema);\n const i18nKey =\n typeof i18nKeyPrefix === 'string'\n ? `${i18nKeyPrefix}.label`\n : stringifiedLabel;\n return t(i18nKey, stringifiedLabel, { uischema: uischema });\n};\n\nexport const getArrayTranslations = (\n t: Translator,\n defaultTranslations: ArrayDefaultTranslation[],\n i18nKeyPrefix: string,\n label: string\n): ArrayTranslations => {\n const translations: ArrayTranslations = {};\n defaultTranslations.forEach((controlElement) => {\n const key = addI18nKeyToPrefix(i18nKeyPrefix, controlElement.key);\n translations[controlElement.key] = t(key, controlElement.default(label));\n });\n return translations;\n};\n\nexport const getCombinatorTranslations = (\n t: Translator,\n defaultTranslations: CombinatorDefaultTranslation[],\n i18nKeyPrefix: string,\n label: string\n): CombinatorTranslations => {\n const translations: CombinatorTranslations = {};\n defaultTranslations.forEach((controlElement) => {\n const key = addI18nKeyToPrefix(i18nKeyPrefix, controlElement.key);\n translations[controlElement.key] = t(key, controlElement.default(label));\n });\n return translations;\n};\n","export interface ArrayDefaultTranslation {\n key: ArrayTranslationEnum;\n default: (variable?: string) => string;\n}\n\nexport enum ArrayTranslationEnum {\n addTooltip = 'addTooltip',\n addAriaLabel = 'addAriaLabel',\n removeTooltip = 'removeTooltip',\n upAriaLabel = 'upAriaLabel',\n downAriaLabel = 'downAriaLabel',\n noSelection = 'noSelection',\n removeAriaLabel = 'removeAriaLabel',\n noDataMessage = 'noDataMessage',\n deleteDialogTitle = 'deleteDialogTitle',\n deleteDialogMessage = 'deleteDialogMessage',\n deleteDialogAccept = 'deleteDialogAccept',\n deleteDialogDecline = 'deleteDialogDecline',\n up = 'up',\n down = 'down',\n}\n\nexport type ArrayTranslations = {\n [key in ArrayTranslationEnum]?: string;\n};\n\nexport const arrayDefaultTranslations: ArrayDefaultTranslation[] = [\n {\n key: ArrayTranslationEnum.addTooltip,\n default: (input) => (input ? `Add to ${input}` : 'Add'),\n },\n {\n key: ArrayTranslationEnum.addAriaLabel,\n default: (input) => (input ? `Add to ${input} button` : 'Add button'),\n },\n { key: ArrayTranslationEnum.removeTooltip, default: () => 'Delete' },\n { key: ArrayTranslationEnum.removeAriaLabel, default: () => 'Delete button' },\n { key: ArrayTranslationEnum.upAriaLabel, default: () => `Move item up` },\n { key: ArrayTranslationEnum.up, default: () => 'Up' },\n { key: ArrayTranslationEnum.down, default: () => 'Down' },\n { key: ArrayTranslationEnum.downAriaLabel, default: () => `Move item down` },\n { key: ArrayTranslationEnum.noDataMessage, default: () => 'No data' },\n { key: ArrayTranslationEnum.noSelection, default: () => 'No selection' },\n {\n key: ArrayTranslationEnum.deleteDialogTitle,\n default: () => 'Confirm Deletion',\n },\n {\n key: ArrayTranslationEnum.deleteDialogMessage,\n default: () => 'Are you sure you want to delete the selected entry?',\n },\n { key: ArrayTranslationEnum.deleteDialogAccept, default: () => 'Yes' },\n { key: ArrayTranslationEnum.deleteDialogDecline, default: () => 'No' },\n];\n","export interface CombinatorDefaultTranslation {\n key: CombinatorTranslationEnum;\n default: (variable?: string) => string;\n}\n\nexport enum CombinatorTranslationEnum {\n clearDialogTitle = 'clearDialogTitle',\n clearDialogMessage = 'clearDialogMessage',\n clearDialogAccept = 'clearDialogAccept',\n clearDialogDecline = 'clearDialogDecline',\n}\n\nexport type CombinatorTranslations = {\n [key in CombinatorTranslationEnum]?: string;\n};\n\nexport const combinatorDefaultTranslations: CombinatorDefaultTranslation[] = [\n {\n key: CombinatorTranslationEnum.clearDialogTitle,\n default: () => 'Clear form?',\n },\n {\n key: CombinatorTranslationEnum.clearDialogMessage,\n default: () => 'Your data will be cleared. Do you want to proceed?',\n },\n { key: CombinatorTranslationEnum.clearDialogAccept, default: () => 'Yes' },\n { key: CombinatorTranslationEnum.clearDialogDecline, default: () => 'No' },\n];\n","/*\n The MIT License\n\n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport {\n defaultErrorTranslator,\n defaultTranslator,\n JsonFormsI18nState,\n} from '../i18n';\nimport {\n I18nActions,\n SET_LOCALE,\n SET_TRANSLATOR,\n UPDATE_I18N,\n} from '../actions';\nimport type { Reducer } from '../util';\n\nexport const defaultJsonFormsI18nState: Required = {\n locale: 'en',\n translate: defaultTranslator,\n translateError: defaultErrorTranslator,\n};\n\nexport const i18nReducer: Reducer = (\n state = defaultJsonFormsI18nState,\n action\n) => {\n switch (action.type) {\n case UPDATE_I18N: {\n const locale = action.locale ?? defaultJsonFormsI18nState.locale;\n const translate =\n action.translator ?? defaultJsonFormsI18nState.translate;\n const translateError =\n action.errorTranslator ?? defaultJsonFormsI18nState.translateError;\n\n if (\n locale !== state.locale ||\n translate !== state.translate ||\n translateError !== state.translateError\n ) {\n return {\n ...state,\n locale,\n translate,\n translateError,\n };\n }\n return state;\n }\n case SET_TRANSLATOR:\n return {\n ...state,\n translate: action.translator ?? defaultTranslator,\n translateError: action.errorTranslator ?? defaultErrorTranslator,\n };\n case SET_LOCALE:\n return {\n ...state,\n locale: action.locale ?? navigator.languages[0],\n };\n default:\n return state;\n }\n};\n\nexport const fetchLocale = (state?: JsonFormsI18nState) => {\n if (state === undefined) {\n return undefined;\n }\n return state.locale;\n};\n\nexport const fetchTranslator = (state?: JsonFormsI18nState) => {\n if (state === undefined) {\n return defaultTranslator;\n }\n return state.translate;\n};\n\nexport const fetchErrorTranslator = (state?: JsonFormsI18nState) => {\n if (state === undefined) {\n return defaultErrorTranslator;\n }\n return state.translateError;\n};\n","/*\n The MIT License\n \n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport type { RankedTester } from '../testers';\nimport {\n ADD_RENDERER,\n AddRendererAction,\n REMOVE_RENDERER,\n RemoveRendererAction,\n} from '../actions';\nimport type { Reducer } from '../util';\n\nexport interface JsonFormsRendererRegistryEntry {\n tester: RankedTester;\n renderer: any;\n}\n\ntype ValidRendererReducerActions = AddRendererAction | RemoveRendererAction;\n\nexport const rendererReducer: Reducer<\n JsonFormsRendererRegistryEntry[],\n ValidRendererReducerActions\n> = (state = [], action) => {\n switch (action.type) {\n case ADD_RENDERER:\n return state.concat([\n { tester: action.tester, renderer: action.renderer },\n ]);\n case REMOVE_RENDERER:\n return state.filter((t) => t.tester !== action.tester);\n default:\n return state;\n }\n};\n","/*\n The MIT License\n\n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport isEmpty from 'lodash/isEmpty';\nimport get from 'lodash/get';\nimport endsWith from 'lodash/endsWith';\nimport last from 'lodash/last';\nimport isArray from 'lodash/isArray';\nimport reduce from 'lodash/reduce';\nimport toPairs from 'lodash/toPairs';\nimport includes from 'lodash/includes';\nimport type {\n Categorization,\n ControlElement,\n JsonSchema,\n UISchemaElement,\n} from '../models';\nimport {\n deriveTypes,\n hasType,\n isOneOfEnumSchema,\n resolveSchema,\n} from '../util';\n\n/**\n * Constant that indicates that a tester is not capable of handling\n * a combination of schema/data.\n * @type {number}\n */\nexport const NOT_APPLICABLE = -1;\n/**\n * A tester is a function that receives an UI schema and a JSON schema and returns a boolean.\n * The rootSchema is handed over as context. Can be used to resolve references.\n */\nexport type Tester = (\n uischema: UISchemaElement,\n schema: JsonSchema,\n context: TesterContext\n) => boolean;\n\n/**\n * A ranked tester associates a tester with a number.\n */\nexport type RankedTester = (\n uischema: UISchemaElement,\n schema: JsonSchema,\n context: TesterContext\n) => number;\n\n/**\n * Additional context given to a tester in addition to UISchema and JsonSchema.\n */\nexport interface TesterContext {\n /** The root JsonSchema of the form. Can be used to resolve references. */\n rootSchema: JsonSchema;\n /** The form wide configuration object given to JsonForms. */\n config: any;\n}\n\nexport const isControl = (uischema: any): uischema is ControlElement =>\n !isEmpty(uischema) && uischema.scope !== undefined;\n\n/**\n * Only applicable for Controls.\n *\n * This function checks whether the given UI schema is of type Control\n * and if so, resolves the sub-schema referenced by the control and applies\n * the given predicate\n *\n * @param {(JsonSchema) => boolean} predicate the predicate that should be\n * applied to the resolved sub-schema\n */\nexport const schemaMatches =\n (\n predicate: (schema: JsonSchema, rootSchema: JsonSchema) => boolean\n ): Tester =>\n (\n uischema: UISchemaElement,\n schema: JsonSchema,\n context: TesterContext\n ): boolean => {\n if (isEmpty(uischema) || !isControl(uischema)) {\n return false;\n }\n if (isEmpty(schema)) {\n return false;\n }\n const schemaPath = uischema.scope;\n if (isEmpty(schemaPath)) {\n return false;\n }\n let currentDataSchema = schema;\n if (hasType(schema, 'object')) {\n currentDataSchema = resolveSchema(\n schema,\n schemaPath,\n context?.rootSchema\n );\n }\n if (currentDataSchema === undefined) {\n return false;\n }\n\n return predicate(currentDataSchema, context?.rootSchema);\n };\n\nexport const schemaSubPathMatches =\n (\n subPath: string,\n predicate: (schema: JsonSchema, rootSchema: JsonSchema) => boolean\n ): Tester =>\n (\n uischema: UISchemaElement,\n schema: JsonSchema,\n context: TesterContext\n ): boolean => {\n if (isEmpty(uischema) || !isControl(uischema)) {\n return false;\n }\n const schemaPath = uischema.scope;\n let currentDataSchema: JsonSchema = schema;\n if (hasType(schema, 'object')) {\n currentDataSchema = resolveSchema(\n schema,\n schemaPath,\n context?.rootSchema\n );\n }\n currentDataSchema = get(currentDataSchema, subPath);\n\n if (currentDataSchema === undefined) {\n return false;\n }\n\n return predicate(currentDataSchema, context?.rootSchema);\n };\n\n/**\n * Only applicable for Controls.\n *\n * This function checks whether the given UI schema is of type Control\n * and if so, resolves the sub-schema referenced by the control and checks\n * whether the type of the sub-schema matches the expected one.\n *\n * @param {string} expectedType the expected type of the resolved sub-schema\n */\nexport const schemaTypeIs = (expectedType: string): Tester =>\n schemaMatches((schema) => !isEmpty(schema) && hasType(schema, expectedType));\n\n/**\n * Only applicable for Controls.\n *\n * This function checks whether the given UI schema is of type Control\n * and if so, resolves the sub-schema referenced by the control and checks\n * whether the format of the sub-schema matches the expected one.\n *\n * @param {string} expectedFormat the expected format of the resolved sub-schema\n */\nexport const formatIs = (expectedFormat: string): Tester =>\n schemaMatches(\n (schema) =>\n !isEmpty(schema) &&\n schema.format === expectedFormat &&\n hasType(schema, 'string')\n );\n\n/**\n * Checks whether the given UI schema has the expected type.\n *\n * @param {string} expected the expected UI schema type\n */\nexport const uiTypeIs =\n (expected: string): Tester =>\n (uischema: UISchemaElement): boolean =>\n !isEmpty(uischema) && uischema.type === expected;\n\n/**\n * Checks whether the given UI schema has an option with the given\n * name and whether it has the expected value. If no options property\n * is set, returns false.\n *\n * @param {string} optionName the name of the option to check\n * @param {any} optionValue the expected value of the option\n */\nexport const optionIs =\n (optionName: string, optionValue: any): Tester =>\n (uischema: UISchemaElement): boolean => {\n if (isEmpty(uischema)) {\n return false;\n }\n\n const options = uischema.options;\n return !isEmpty(options) && options[optionName] === optionValue;\n };\n\n/**\n * Only applicable for Controls.\n *\n * Checks whether the scope of a control ends with the expected string.\n *\n * @param {string} expected the expected ending of the reference\n */\nexport const scopeEndsWith =\n (expected: string): Tester =>\n (uischema: UISchemaElement): boolean => {\n if (isEmpty(expected) || !isControl(uischema)) {\n return false;\n }\n\n return endsWith(uischema.scope, expected);\n };\n\n/**\n * Only applicable for Controls.\n *\n * Checks whether the last segment of the scope matches the expected string.\n *\n * @param {string} expected the expected ending of the reference\n */\nexport const scopeEndIs =\n (expected: string): Tester =>\n (uischema: UISchemaElement): boolean => {\n if (isEmpty(expected) || !isControl(uischema)) {\n return false;\n }\n const schemaPath = uischema.scope;\n\n return !isEmpty(schemaPath) && last(schemaPath.split('/')) === expected;\n };\n\n/**\n * A tester that allow composing other testers by && them.\n *\n * @param {Array} testers the testers to be composed\n */\nexport const and =\n (...testers: Tester[]): Tester =>\n (uischema: UISchemaElement, schema: JsonSchema, context: TesterContext) =>\n testers.reduce(\n (acc, tester) => acc && tester(uischema, schema, context),\n true\n );\n\n/**\n * A tester that allow composing other testers by || them.\n *\n * @param {Array} testers the testers to be composed\n */\nexport const or =\n (...testers: Tester[]): Tester =>\n (uischema: UISchemaElement, schema: JsonSchema, context: TesterContext) =>\n testers.reduce(\n (acc, tester) => acc || tester(uischema, schema, context),\n false\n );\n/**\n * Create a ranked tester that will associate a number with a given tester, if the\n * latter returns true.\n *\n * @param {number} rank the rank to be returned in case the tester returns true\n * @param {Tester} tester a tester\n */\nexport const rankWith =\n (rank: number, tester: Tester) =>\n (\n uischema: UISchemaElement,\n schema: JsonSchema,\n context: TesterContext\n ): number => {\n if (tester(uischema, schema, context)) {\n return rank;\n }\n\n return NOT_APPLICABLE;\n };\n\nexport const withIncreasedRank =\n (by: number, rankedTester: RankedTester) =>\n (\n uischema: UISchemaElement,\n schema: JsonSchema,\n context: TesterContext\n ): number => {\n const rank = rankedTester(uischema, schema, context);\n if (rank === NOT_APPLICABLE) {\n return NOT_APPLICABLE;\n }\n\n return rank + by;\n };\n\n/**\n * Default tester for boolean.\n * @type {RankedTester}\n */\nexport const isBooleanControl = and(\n uiTypeIs('Control'),\n schemaTypeIs('boolean')\n);\n\n// TODO: rather check for properties property\nexport const isObjectControl = and(uiTypeIs('Control'), schemaTypeIs('object'));\n\nexport const isAllOfControl = and(\n uiTypeIs('Control'),\n schemaMatches((schema) =>\n Object.prototype.hasOwnProperty.call(schema, 'allOf')\n )\n);\n\nexport const isAnyOfControl = and(\n uiTypeIs('Control'),\n schemaMatches((schema) =>\n Object.prototype.hasOwnProperty.call(schema, 'anyOf')\n )\n);\n\nexport const isOneOfControl = and(\n uiTypeIs('Control'),\n schemaMatches((schema) =>\n Object.prototype.hasOwnProperty.call(schema, 'oneOf')\n )\n);\n\n/**\n * Tests whether the given UI schema is of type Control and if the schema\n * has an enum.\n * @type {Tester}\n */\nexport const isEnumControl = and(\n uiTypeIs('Control'),\n or(\n schemaMatches((schema) =>\n Object.prototype.hasOwnProperty.call(schema, 'enum')\n ),\n schemaMatches((schema) =>\n Object.prototype.hasOwnProperty.call(schema, 'const')\n )\n )\n);\n\n/**\n * Tests whether the given UI schema is of type Control and if the schema\n * has an enum based on oneOf.\n * @type {Tester}\n */\nexport const isOneOfEnumControl = and(\n uiTypeIs('Control'),\n schemaMatches((schema) => isOneOfEnumSchema(schema))\n);\n\n/**\n * Tests whether the given UI schema is of type Control and if the schema\n * is of type integer\n * @type {Tester}\n */\nexport const isIntegerControl = and(\n uiTypeIs('Control'),\n schemaTypeIs('integer')\n);\n\n/**\n * Tests whether the given UI schema is of type Control and if the schema\n * is of type number\n * @type {Tester}\n */\nexport const isNumberControl = and(uiTypeIs('Control'), schemaTypeIs('number'));\n\n/**\n * Tests whether the given UI schema is of type Control and if the schema\n * is of type string\n * @type {Tester}\n */\nexport const isStringControl = and(uiTypeIs('Control'), schemaTypeIs('string'));\n\n/**\n * Tests whether the given UI schema is of type Control and if is has\n * a 'multi' option.\n * @type {Tester}\n */\nexport const isMultiLineControl = and(\n uiTypeIs('Control'),\n optionIs('multi', true)\n);\n\n/**\n * Tests whether the given UI schema is of type Control and whether the schema\n * or uischema options has a 'date' format.\n * @type {Tester}\n */\nexport const isDateControl = and(\n uiTypeIs('Control'),\n or(formatIs('date'), optionIs('format', 'date'))\n);\n\n/**\n * Tests whether the given UI schema is of type Control and whether the schema\n * or the uischema options has a 'time' format.\n * @type {Tester}\n */\nexport const isTimeControl = and(\n uiTypeIs('Control'),\n or(formatIs('time'), optionIs('format', 'time'))\n);\n\n/**\n * Tests whether the given UI schema is of type Control and whether the schema\n * or the uischema options has a 'date-time' format.\n * @type {Tester}\n */\nexport const isDateTimeControl = and(\n uiTypeIs('Control'),\n or(formatIs('date-time'), optionIs('format', 'date-time'))\n);\n\n/**\n * Tests whether the given schema is an array of objects.\n * @type {Tester}\n */\nexport const isObjectArray = and(\n schemaMatches(\n (schema, rootSchema) =>\n hasType(schema, 'array') &&\n !Array.isArray(resolveSchema(schema, 'items', rootSchema)) // we don't care about tuples\n ),\n schemaSubPathMatches('items', (schema, rootSchema) => {\n const resolvedSchema = schema.$ref\n ? resolveSchema(rootSchema, schema.$ref, rootSchema)\n : schema;\n return hasType(resolvedSchema, 'object');\n })\n);\n\n/**\n * Tests whether the given UI schema is of type Control and if the schema\n * is an array of objects.\n * @type {Tester}\n */\nexport const isObjectArrayControl = and(uiTypeIs('Control'), isObjectArray);\n\nconst traverse = (\n any: JsonSchema | JsonSchema[],\n pred: (obj: JsonSchema) => boolean,\n rootSchema: JsonSchema\n): boolean => {\n if (isArray(any)) {\n return reduce(\n any,\n (acc, el) => acc || traverse(el, pred, rootSchema),\n false\n );\n }\n\n if (pred(any)) {\n return true;\n }\n\n if (any.$ref) {\n const toTraverse = resolveSchema(rootSchema, any.$ref, rootSchema);\n if (toTraverse && !toTraverse.$ref) {\n return traverse(toTraverse, pred, rootSchema);\n }\n }\n\n if (any.items) {\n return traverse(any.items, pred, rootSchema);\n }\n if (any.properties) {\n return reduce(\n toPairs(any.properties),\n (acc, [_key, val]) => acc || traverse(val, pred, rootSchema),\n false\n );\n }\n\n return false;\n};\n\nexport const isObjectArrayWithNesting = (\n uischema: UISchemaElement,\n schema: JsonSchema,\n context: TesterContext\n): boolean => {\n if (!uiTypeIs('Control')(uischema, schema, context)) {\n return false;\n }\n const schemaPath = (uischema as ControlElement).scope;\n const resolvedSchema = resolveSchema(\n schema,\n schemaPath,\n context?.rootSchema ?? schema\n );\n let objectDepth = 0;\n if (resolvedSchema !== undefined && resolvedSchema.items !== undefined) {\n // check if nested arrays\n if (\n traverse(\n resolvedSchema.items,\n (val) => {\n if (val === schema) {\n return false;\n }\n if (val.$ref !== undefined) {\n return false;\n }\n if (val.anyOf || val.allOf) {\n return true;\n }\n if (val.oneOf && !isOneOfEnumSchema(val)) {\n return true;\n }\n if (hasType(val, 'object')) {\n objectDepth++;\n if (objectDepth === 2) {\n return true;\n }\n }\n if (hasType(val, 'array')) {\n return true;\n }\n return false;\n },\n context?.rootSchema\n )\n ) {\n return true;\n }\n // check if uischema options detail is set\n if (uischema.options && uischema.options.detail) {\n if (typeof uischema.options.detail === 'string') {\n return uischema.options.detail.toUpperCase() !== 'DEFAULT';\n } else if (\n typeof uischema.options.detail === 'object' &&\n uischema.options.detail.type\n ) {\n return true;\n }\n }\n }\n return false;\n};\n\n/**\n * Synonym for isObjectArrayControl\n */\nexport const isArrayObjectControl = isObjectArrayControl;\n\n/**\n * Tests whether the given UI schema is of type Control and if the schema\n * is an array of a primitive type.\n * @type {Tester}\n */\nexport const isPrimitiveArrayControl = and(\n uiTypeIs('Control'),\n schemaMatches(\n (schema, rootSchema) =>\n deriveTypes(schema).length !== 0 &&\n !Array.isArray(resolveSchema(schema, 'items', rootSchema)) // we don't care about tuples\n ),\n schemaSubPathMatches('items', (schema, rootSchema) => {\n const resolvedSchema = schema.$ref\n ? resolveSchema(rootSchema, schema.$ref, rootSchema)\n : schema;\n const types = deriveTypes(resolvedSchema);\n return (\n types.length === 1 &&\n includes(['integer', 'number', 'boolean', 'string'], types[0])\n );\n })\n);\n\n/**\n * Tests whether a given UI schema is of type Control,\n * if the schema is of type number or integer and\n * whether the schema defines a numerical range with a default value.\n * @type {Tester}\n */\nexport const isRangeControl = and(\n uiTypeIs('Control'),\n or(schemaTypeIs('number'), schemaTypeIs('integer')),\n schemaMatches(\n (schema) =>\n Object.prototype.hasOwnProperty.call(schema, 'maximum') &&\n Object.prototype.hasOwnProperty.call(schema, 'minimum') &&\n Object.prototype.hasOwnProperty.call(schema, 'default')\n ),\n optionIs('slider', true)\n);\n\n/**\n * Tests whether the given UI schema is of type Control, if the schema\n * is of type integer and has option format\n * @type {Tester}\n */\nexport const isNumberFormatControl = and(\n uiTypeIs('Control'),\n schemaTypeIs('integer'),\n optionIs('format', true)\n);\n\nexport const isCategorization = (\n category: UISchemaElement\n): category is Categorization => category.type === 'Categorization';\n\nexport const isCategory = (uischema: UISchemaElement): boolean =>\n uischema.type === 'Category';\n\nexport const hasCategory = (categorization: Categorization): boolean => {\n if (isEmpty(categorization.elements)) {\n return false;\n }\n // all children of the categorization have to be categories\n return categorization.elements\n .map((elem) =>\n isCategorization(elem) ? hasCategory(elem) : isCategory(elem)\n )\n .reduce((prev, curr) => prev && curr, true);\n};\n\nexport const categorizationHasCategory = (uischema: UISchemaElement) =>\n hasCategory(uischema as Categorization);\n\nexport const not =\n (tester: Tester): Tester =>\n (uischema: UISchemaElement, schema: JsonSchema, context: TesterContext) =>\n !tester(uischema, schema, context);\n","/*\n The MIT License\n \n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport maxBy from 'lodash/maxBy';\nimport remove from 'lodash/remove';\nimport { ADD_UI_SCHEMA, REMOVE_UI_SCHEMA, UISchemaActions } from '../actions';\nimport { NOT_APPLICABLE } from '../testers';\nimport type { JsonSchema, UISchemaElement } from '../models';\nimport type { Reducer } from '../util';\n\nexport type UISchemaTester = (\n schema: JsonSchema,\n schemaPath: string,\n path: string\n) => number;\n\nexport interface JsonFormsUISchemaRegistryEntry {\n tester: UISchemaTester;\n uischema: UISchemaElement;\n}\n\nexport const uischemaRegistryReducer: Reducer<\n JsonFormsUISchemaRegistryEntry[],\n UISchemaActions\n> = (state = [], action) => {\n switch (action.type) {\n case ADD_UI_SCHEMA:\n return state\n .slice()\n .concat({ tester: action.tester, uischema: action.uischema });\n case REMOVE_UI_SCHEMA: {\n const copy = state.slice();\n remove(copy, (entry) => entry.tester === action.tester);\n return copy;\n }\n default:\n return state;\n }\n};\n\nexport const findMatchingUISchema =\n (state: JsonFormsUISchemaRegistryEntry[]) =>\n (\n jsonSchema: JsonSchema,\n schemaPath: string,\n path: string\n ): UISchemaElement => {\n const match = maxBy(state, (entry) =>\n entry.tester(jsonSchema, schemaPath, path)\n );\n if (\n match !== undefined &&\n match.tester(jsonSchema, schemaPath, path) !== NOT_APPLICABLE\n ) {\n return match.uischema;\n }\n return undefined;\n };\n","/*\n The MIT License\n \n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport type { ControlElement, UISchemaElement } from '../models';\nimport { coreReducer, errorAt, subErrorsAt } from './core';\nimport { defaultDataReducer } from './default-data';\nimport { rendererReducer } from './renderers';\nimport type { JsonFormsState } from '../store';\nimport type { JsonFormsUISchemaRegistryEntry } from './uischemas';\nimport { findMatchingUISchema, uischemaRegistryReducer } from './uischemas';\nimport { fetchErrorTranslator, fetchLocale, i18nReducer } from './i18n';\n\nimport { Generate } from '../generators';\nimport type { JsonSchema } from '../models/jsonSchema';\n\nimport { cellReducer } from './cells';\nimport { configReducer } from './config';\nimport get from 'lodash/get';\nimport { fetchTranslator } from '.';\nimport type { ErrorTranslator, Translator } from '../i18n';\n\nexport const jsonFormsReducerConfig = {\n core: coreReducer,\n renderers: rendererReducer,\n cells: cellReducer,\n config: configReducer,\n uischemas: uischemaRegistryReducer,\n defaultData: defaultDataReducer,\n i18n: i18nReducer,\n};\n\n/**\n * Finds a registered UI schema to use, if any.\n * @param schema the JSON schema describing the data to be rendered\n * @param schemaPath the according schema path\n * @param path the instance path\n * @param fallback the type of the layout to use or a UI-schema-generator function\n * @param control may be checked for embedded inline uischema options\n */\nexport const findUISchema = (\n uischemas: JsonFormsUISchemaRegistryEntry[],\n schema: JsonSchema,\n schemaPath: string,\n path: string,\n fallback: string | (() => UISchemaElement) = 'VerticalLayout',\n control?: ControlElement,\n rootSchema?: JsonSchema\n): UISchemaElement => {\n // handle options\n if (control && control.options && control.options.detail) {\n if (typeof control.options.detail === 'string') {\n if (control.options.detail.toUpperCase() === 'GENERATE') {\n //use fallback generation function\n if (typeof fallback === 'function') {\n return fallback();\n }\n // force generation of uischema\n return Generate.uiSchema(schema, fallback, undefined, rootSchema);\n }\n } else if (typeof control.options.detail === 'object') {\n // check if detail is a valid uischema\n if (\n control.options.detail.type &&\n typeof control.options.detail.type === 'string'\n ) {\n return control.options.detail as UISchemaElement;\n }\n }\n }\n // default\n const uiSchema = findMatchingUISchema(uischemas)(schema, schemaPath, path);\n if (uiSchema === undefined) {\n //use fallback generation function\n if (typeof fallback === 'function') {\n return fallback();\n }\n return Generate.uiSchema(schema, fallback, '#', rootSchema);\n }\n return uiSchema;\n};\n\nexport const getErrorAt =\n (instancePath: string, schema: JsonSchema) => (state: JsonFormsState) => {\n return errorAt(instancePath, schema)(state.jsonforms.core);\n };\n\nexport const getSubErrorsAt =\n (instancePath: string, schema: JsonSchema) => (state: JsonFormsState) =>\n subErrorsAt(instancePath, schema)(state.jsonforms.core);\n\nexport const getConfig = (state: JsonFormsState) => state.jsonforms.config;\n\nexport const getLocale = (state: JsonFormsState) =>\n fetchLocale(get(state, 'jsonforms.i18n'));\n\nexport const getTranslator =\n () =>\n (state: JsonFormsState): Translator =>\n fetchTranslator(get(state, 'jsonforms.i18n'));\n\nexport const getErrorTranslator =\n () =>\n (state: JsonFormsState): ErrorTranslator =>\n fetchErrorTranslator(get(state, 'jsonforms.i18n'));\n","/*\n The MIT License\n \n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport get from 'lodash/get';\nimport type Ajv from 'ajv';\nimport type { JsonFormsState } from '../store';\nimport type { JsonSchema, UISchemaElement } from '../models';\nimport {\n extractAjv,\n extractData,\n extractSchema,\n extractUiSchema,\n} from './core';\nimport {\n extractDefaultData,\n JsonFormsDefaultDataRegistryEntry,\n} from './default-data';\nimport type { JsonFormsRendererRegistryEntry } from './renderers';\nimport type { JsonFormsCellRendererRegistryEntry } from './cells';\nimport type { JsonFormsUISchemaRegistryEntry } from './uischemas';\n\nexport const getData = (state: JsonFormsState) =>\n extractData(get(state, 'jsonforms.core'));\nexport const getSchema = (state: JsonFormsState): JsonSchema =>\n extractSchema(get(state, 'jsonforms.core'));\nexport const getUiSchema = (state: JsonFormsState): UISchemaElement =>\n extractUiSchema(get(state, 'jsonforms.core'));\nexport const getAjv = (state: JsonFormsState): Ajv =>\n extractAjv(get(state, 'jsonforms.core'));\nexport const getDefaultData = (\n state: JsonFormsState\n): JsonFormsDefaultDataRegistryEntry[] =>\n extractDefaultData(get(state, 'jsonforms.defaultData'));\nexport const getRenderers = (\n state: JsonFormsState\n): JsonFormsRendererRegistryEntry[] => get(state, 'jsonforms.renderers');\nexport const getCells = (\n state: JsonFormsState\n): JsonFormsCellRendererRegistryEntry[] => get(state, 'jsonforms.cells');\nexport const getUISchemas = (\n state: JsonFormsState\n): JsonFormsUISchemaRegistryEntry[] => get(state, 'jsonforms.uischemas');\n","/*\n The MIT License\n\n Copyright (c) 2023 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\nimport { CoreActions } from '../actions';\nimport { JsonFormsCore } from './core';\n\nexport interface Middleware {\n (\n state: JsonFormsCore,\n action: CoreActions,\n defaultReducer: (state: JsonFormsCore, action: CoreActions) => JsonFormsCore\n ): JsonFormsCore;\n}\nexport const defaultMiddleware: Middleware = (state, action, defaultReducer) =>\n defaultReducer(state, action);\n","/*\n The MIT License\n \n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport isEmpty from 'lodash/isEmpty';\nimport range from 'lodash/range';\nimport { isScoped, Scopable } from '../models';\n\nexport const compose = (path1: string, path2: string) => {\n let p1 = path1;\n if (!isEmpty(path1) && !isEmpty(path2) && !path2.startsWith('[')) {\n p1 = path1 + '.';\n }\n\n if (isEmpty(p1)) {\n return path2;\n } else if (isEmpty(path2)) {\n return p1;\n } else {\n return `${p1}${path2}`;\n }\n};\n\nexport { compose as composePaths };\n\n/**\n * Convert a schema path (i.e. JSON pointer) to an array by splitting\n * at the '/' character and removing all schema-specific keywords.\n *\n * The returned value can be used to de-reference a root object by folding over it\n * and de-referencing the single segments to obtain a new object.\n *\n *\n * @param {string} schemaPath the schema path to be converted\n * @returns {string[]} an array containing only non-schema-specific segments\n */\nexport const toDataPathSegments = (schemaPath: string): string[] => {\n const s = schemaPath\n .replace(/(anyOf|allOf|oneOf)\\/[\\d]+\\//g, '')\n .replace(/(then|else)\\//g, '');\n const segments = s.split('/');\n\n const decodedSegments = segments.map(decode);\n\n const startFromRoot = decodedSegments[0] === '#' || decodedSegments[0] === '';\n const startIndex = startFromRoot ? 2 : 1;\n return range(startIndex, decodedSegments.length, 2).map(\n (idx) => decodedSegments[idx]\n );\n};\n\n/**\n * Convert a schema path (i.e. JSON pointer) to a data path.\n *\n * Data paths can be used in field change event handlers like handleChange.\n *\n * @example\n * toDataPath('#/properties/foo/properties/bar') === 'foo.bar')\n *\n * @param {string} schemaPath the schema path to be converted\n * @returns {string} the data path\n */\nexport const toDataPath = (schemaPath: string): string => {\n return toDataPathSegments(schemaPath).join('.');\n};\n\nexport const composeWithUi = (scopableUi: Scopable, path: string): string => {\n if (!isScoped(scopableUi)) {\n return path ?? '';\n }\n\n const segments = toDataPathSegments(scopableUi.scope);\n\n if (isEmpty(segments)) {\n return path ?? '';\n }\n\n return compose(path, segments.join('.'));\n};\n\n/**\n * Encodes the given segment to be used as part of a JSON Pointer\n *\n * JSON Pointer has special meaning for \"/\" and \"~\", therefore these must be encoded\n */\nexport const encode = (segment: string) =>\n segment?.replace(/~/g, '~0').replace(/\\//g, '~1');\n/**\n * Decodes a given JSON Pointer segment to its \"normal\" representation\n */\nexport const decode = (pointerSegment: string) =>\n pointerSegment?.replace(/~1/g, '/').replace(/~0/, '~');\n","/*\n The MIT License\n\n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport isEmpty from 'lodash/isEmpty';\nimport get from 'lodash/get';\nimport type { JsonSchema, JsonSchema7 } from '../models';\nimport { decode } from './path';\n\n/**\n * Map for storing refs and the respective schemas they are pointing to.\n */\nexport interface ReferenceSchemaMap {\n [ref: string]: JsonSchema;\n}\n\nconst isObjectSchema = (schema: JsonSchema): boolean => {\n return schema.properties !== undefined;\n};\nconst isArraySchema = (schema: JsonSchema): boolean => {\n return schema.type === 'array' && schema.items !== undefined;\n};\n\nexport const resolveData = (instance: any, dataPath: string): any => {\n if (isEmpty(dataPath)) {\n return instance;\n }\n const dataPathSegments = dataPath.split('.');\n\n return dataPathSegments.reduce((curInstance, decodedSegment) => {\n if (\n !curInstance ||\n !Object.prototype.hasOwnProperty.call(curInstance, decodedSegment)\n ) {\n return undefined;\n }\n\n return curInstance[decodedSegment];\n }, instance);\n};\n\n/**\n * Finds all references inside the given schema.\n *\n * @param schema The {@link JsonSchema} to find the references in\n * @param result The initial result map, default: empty map (this parameter is used for recursion\n * inside the function)\n * @param resolveTuples Whether arrays of tuples should be considered; default: false\n */\nexport const findAllRefs = (\n schema: JsonSchema,\n result: ReferenceSchemaMap = {},\n resolveTuples = false\n): ReferenceSchemaMap => {\n if (isObjectSchema(schema)) {\n Object.keys(schema.properties).forEach((key) =>\n findAllRefs(schema.properties[key], result)\n );\n }\n if (isArraySchema(schema)) {\n if (Array.isArray(schema.items)) {\n if (resolveTuples) {\n const items: JsonSchema[] = schema.items;\n items.forEach((child) => findAllRefs(child, result));\n }\n } else {\n findAllRefs(schema.items, result);\n }\n }\n if (Array.isArray(schema.anyOf)) {\n const anyOf: JsonSchema[] = schema.anyOf;\n anyOf.forEach((child) => findAllRefs(child, result));\n }\n if (schema.$ref !== undefined) {\n result[schema.$ref] = schema;\n }\n\n return result;\n};\n\nconst invalidSegment = (pathSegment: string) =>\n pathSegment === '#' || pathSegment === undefined || pathSegment === '';\n\n/**\n * Resolve the given schema path in order to obtain a subschema.\n * @param {JsonSchema} schema the root schema from which to start\n * @param {string} schemaPath the schema path to be resolved\n * @param {JsonSchema} rootSchema the actual root schema\n * @returns {JsonSchema} the resolved sub-schema\n */\nexport const resolveSchema = (\n schema: JsonSchema,\n schemaPath: string,\n rootSchema: JsonSchema\n): JsonSchema => {\n const segments = schemaPath?.split('/').map(decode);\n return resolveSchemaWithSegments(schema, segments, rootSchema);\n};\n\nconst resolveSchemaWithSegments = (\n schema: JsonSchema,\n pathSegments: string[],\n rootSchema: JsonSchema\n): JsonSchema => {\n if (isEmpty(schema)) {\n return undefined;\n }\n\n if (schema.$ref) {\n schema = resolveSchema(rootSchema, schema.$ref, rootSchema);\n }\n\n if (!pathSegments || pathSegments.length === 0) {\n return schema;\n }\n\n const [segment, ...remainingSegments] = pathSegments;\n\n if (invalidSegment(segment)) {\n return resolveSchemaWithSegments(schema, remainingSegments, rootSchema);\n }\n\n const singleSegmentResolveSchema = get(schema, segment);\n\n const resolvedSchema = resolveSchemaWithSegments(\n singleSegmentResolveSchema,\n remainingSegments,\n rootSchema\n );\n if (resolvedSchema) {\n return resolvedSchema;\n }\n\n if (segment === 'properties' || segment === 'items') {\n // Let's try to resolve the path, assuming oneOf/allOf/anyOf/then/else was omitted.\n // We only do this when traversing an object or array as we want to avoid\n // following a property which is named oneOf, allOf, anyOf, then or else.\n let alternativeResolveResult = undefined;\n\n const subSchemas = [].concat(\n schema.oneOf ?? [],\n schema.allOf ?? [],\n schema.anyOf ?? [],\n (schema as JsonSchema7).then ?? [],\n (schema as JsonSchema7).else ?? []\n );\n\n for (const subSchema of subSchemas) {\n alternativeResolveResult = resolveSchemaWithSegments(\n subSchema,\n [segment, ...remainingSegments],\n rootSchema\n );\n if (alternativeResolveResult) {\n break;\n }\n }\n return alternativeResolveResult;\n }\n\n return undefined;\n};\n","/*\n The MIT License\n\n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport has from 'lodash/has';\nimport {\n AndCondition,\n Condition,\n JsonSchema,\n LeafCondition,\n OrCondition,\n RuleEffect,\n SchemaBasedCondition,\n Scopable,\n UISchemaElement,\n} from '../models';\nimport { resolveData } from './resolvers';\nimport { composeWithUi } from './path';\nimport type Ajv from 'ajv';\nimport { getAjv } from '../reducers';\nimport type { JsonFormsState } from '../store';\n\nconst isOrCondition = (condition: Condition): condition is OrCondition =>\n condition.type === 'OR';\n\nconst isAndCondition = (condition: Condition): condition is AndCondition =>\n condition.type === 'AND';\n\nconst isLeafCondition = (condition: Condition): condition is LeafCondition =>\n condition.type === 'LEAF';\n\nconst isSchemaCondition = (\n condition: Condition\n): condition is SchemaBasedCondition => has(condition, 'schema');\n\nconst getConditionScope = (condition: Scopable, path: string): string => {\n return composeWithUi(condition, path);\n};\n\nconst evaluateCondition = (\n data: any,\n condition: Condition,\n path: string,\n ajv: Ajv\n): boolean => {\n if (isAndCondition(condition)) {\n return condition.conditions.reduce(\n (acc, cur) => acc && evaluateCondition(data, cur, path, ajv),\n true\n );\n } else if (isOrCondition(condition)) {\n return condition.conditions.reduce(\n (acc, cur) => acc || evaluateCondition(data, cur, path, ajv),\n false\n );\n } else if (isLeafCondition(condition)) {\n const value = resolveData(data, getConditionScope(condition, path));\n return value === condition.expectedValue;\n } else if (isSchemaCondition(condition)) {\n const value = resolveData(data, getConditionScope(condition, path));\n if (condition.failWhenUndefined && value === undefined) {\n return false;\n }\n return ajv.validate(condition.schema, value) as boolean;\n } else {\n // unknown condition\n return true;\n }\n};\n\nconst isRuleFulfilled = (\n uischema: UISchemaElement,\n data: any,\n path: string,\n ajv: Ajv\n): boolean => {\n const condition = uischema.rule.condition;\n return evaluateCondition(data, condition, path, ajv);\n};\n\nexport const evalVisibility = (\n uischema: UISchemaElement,\n data: any,\n path: string = undefined,\n ajv: Ajv\n): boolean => {\n const fulfilled = isRuleFulfilled(uischema, data, path, ajv);\n\n switch (uischema.rule.effect) {\n case RuleEffect.HIDE:\n return !fulfilled;\n case RuleEffect.SHOW:\n return fulfilled;\n // visible by default\n default:\n return true;\n }\n};\n\nexport const evalEnablement = (\n uischema: UISchemaElement,\n data: any,\n path: string = undefined,\n ajv: Ajv\n): boolean => {\n const fulfilled = isRuleFulfilled(uischema, data, path, ajv);\n\n switch (uischema.rule.effect) {\n case RuleEffect.DISABLE:\n return !fulfilled;\n case RuleEffect.ENABLE:\n return fulfilled;\n // enabled by default\n default:\n return true;\n }\n};\n\nexport const hasShowRule = (uischema: UISchemaElement): boolean => {\n if (\n uischema.rule &&\n (uischema.rule.effect === RuleEffect.SHOW ||\n uischema.rule.effect === RuleEffect.HIDE)\n ) {\n return true;\n }\n return false;\n};\n\nexport const hasEnableRule = (uischema: UISchemaElement): boolean => {\n if (\n uischema.rule &&\n (uischema.rule.effect === RuleEffect.ENABLE ||\n uischema.rule.effect === RuleEffect.DISABLE)\n ) {\n return true;\n }\n return false;\n};\n\nexport const isVisible = (\n uischema: UISchemaElement,\n data: any,\n path: string = undefined,\n ajv: Ajv\n): boolean => {\n if (uischema.rule) {\n return evalVisibility(uischema, data, path, ajv);\n }\n\n return true;\n};\n\nexport const isEnabled = (\n uischema: UISchemaElement,\n data: any,\n path: string = undefined,\n ajv: Ajv\n): boolean => {\n if (uischema.rule) {\n return evalEnablement(uischema, data, path, ajv);\n }\n\n return true;\n};\n\n/**\n * Indicates whether the given `uischema` element shall be enabled or disabled.\n * Checks the global readonly flag, uischema rule, uischema options (including the config),\n * the schema and the enablement indicator of the parent.\n */\nexport const isInherentlyEnabled = (\n state: JsonFormsState,\n ownProps: any,\n uischema: UISchemaElement,\n schema: (JsonSchema & { readOnly?: boolean }) | undefined,\n rootData: any,\n config: any\n) => {\n if (state?.jsonforms?.readonly) {\n return false;\n }\n if (uischema && hasEnableRule(uischema)) {\n return isEnabled(uischema, rootData, ownProps?.path, getAjv(state));\n }\n if (typeof uischema?.options?.readonly === 'boolean') {\n return !uischema.options.readonly;\n }\n if (typeof uischema?.options?.readOnly === 'boolean') {\n return !uischema.options.readOnly;\n }\n if (typeof config?.readonly === 'boolean') {\n return !config.readonly;\n }\n if (typeof config?.readOnly === 'boolean') {\n return !config.readOnly;\n }\n if (schema?.readOnly === true) {\n return false;\n }\n if (typeof ownProps?.enabled === 'boolean') {\n return ownProps.enabled;\n }\n return true;\n};\n","/*\n The MIT License\n \n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport isEmpty from 'lodash/isEmpty';\nimport isArray from 'lodash/isArray';\nimport includes from 'lodash/includes';\nimport find from 'lodash/find';\nimport type { JsonSchema, Scoped, UISchemaElement } from '..';\nimport { resolveData, resolveSchema } from './resolvers';\nimport { composePaths, toDataPathSegments } from './path';\nimport { isEnabled, isVisible } from './runtime';\nimport type Ajv from 'ajv';\n\n/**\n * Returns the string representation of the given date. The format of the output string can be specified:\n * - 'date' for a date-only string (YYYY-MM-DD),\n * - 'time' for a time-only string (HH:mm:ss), or\n * - 'date-time' for a full date-time string in ISO format (YYYY-MM-DDTHH:mm:ss.sssZ).\n * If no format is specified, the full date-time ISO string is returned by default.\n *\n * @returns {string} A string representation of the date in the specified format.\n *\n * @example\n * // returns '2023-11-09'\n * convertDateToString(new Date('2023-11-09T14:22:54.131Z'), 'date');\n *\n * @example\n * // returns '14:22:54'\n * convertDateToString(new Date('2023-11-09T14:22:54.131Z'), 'time');\n *\n * @example\n * // returns '2023-11-09T14:22:54.131Z'\n * convertDateToString(new Date('2023-11-09T14:22:54.131Z'), 'date-time');\n *\n * @example\n * // returns '2023-11-09T14:22:54.131Z'\n * convertDateToString(new Date('2023-11-09T14:22:54.131Z'));\n */\nexport const convertDateToString = (\n date: Date,\n format?: 'date' | 'time' | 'date-time'\n): string => {\n //e.g. '2023-11-09T14:22:54.131Z'\n const dateString = date.toISOString();\n if (format === 'date-time') {\n return dateString;\n } else if (format === 'date') {\n // e.g. '2023-11-09'\n return dateString.split('T')[0];\n } else if (format === 'time') {\n //e.g. '14:22:54'\n return dateString.split('T')[1].split('.')[0];\n }\n return dateString;\n};\n\n/**\n * Escape the given string such that it can be used as a class name,\n * i.e. hashes and slashes will be replaced.\n *\n * @param {string} s the string that should be converted to a valid class name\n * @returns {string} the escaped string\n */\nexport const convertToValidClassName = (s: string): string =>\n s.replace('#', 'root').replace(new RegExp('/', 'g'), '_');\n\nexport const formatErrorMessage = (errors: string[]) => {\n if (errors === undefined || errors === null) {\n return '';\n }\n\n return errors.join('\\n');\n};\n\nexport const hasType = (jsonSchema: JsonSchema, expected: string): boolean => {\n return includes(deriveTypes(jsonSchema), expected);\n};\n\n/**\n * Derives the type of the jsonSchema element\n */\nexport const deriveTypes = (jsonSchema: JsonSchema): string[] => {\n if (isEmpty(jsonSchema)) {\n return [];\n }\n if (!isEmpty(jsonSchema.type) && typeof jsonSchema.type === 'string') {\n return [jsonSchema.type];\n }\n if (isArray(jsonSchema.type)) {\n return jsonSchema.type;\n }\n if (\n !isEmpty(jsonSchema.properties) ||\n !isEmpty(jsonSchema.additionalProperties)\n ) {\n return ['object'];\n }\n if (!isEmpty(jsonSchema.items)) {\n return ['array'];\n }\n if (!isEmpty(jsonSchema.enum)) {\n const types: Set = new Set();\n jsonSchema.enum.forEach((enumElement) => {\n if (typeof enumElement === 'string') {\n types.add('string');\n } else {\n deriveTypes(enumElement).forEach((type) => types.add(type));\n }\n });\n return Array.from(types);\n }\n if (!isEmpty(jsonSchema.allOf)) {\n const allOfType = find(\n jsonSchema.allOf,\n (schema: JsonSchema) => deriveTypes(schema).length !== 0\n );\n\n if (allOfType) {\n return deriveTypes(allOfType);\n }\n }\n // ignore all remaining cases\n return [];\n};\n\n/**\n * Convenience wrapper around resolveData and resolveSchema.\n */\nexport const Resolve: {\n schema(\n schema: JsonSchema,\n schemaPath: string,\n rootSchema: JsonSchema\n ): JsonSchema;\n data(data: any, path: string): any;\n} = {\n schema: resolveSchema,\n data: resolveData,\n};\n\n// Paths --\nconst fromScoped = (scopable: Scoped): string =>\n toDataPathSegments(scopable.scope).join('.');\n\nexport const Paths = {\n compose: composePaths,\n fromScoped,\n};\n\n// Runtime --\nexport const Runtime = {\n isEnabled(uischema: UISchemaElement, data: any, ajv: Ajv): boolean {\n return isEnabled(uischema, data, undefined, ajv);\n },\n isVisible(uischema: UISchemaElement, data: any, ajv: Ajv): boolean {\n return isVisible(uischema, data, undefined, ajv);\n },\n};\n","/*\n The MIT License\n \n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport startCase from 'lodash/startCase';\n\nimport type { ControlElement, JsonSchema, LabelDescription } from '../models';\nimport { decode } from './path';\n\nconst deriveLabel = (\n controlElement: ControlElement,\n schemaElement?: JsonSchema\n): string => {\n if (schemaElement && typeof schemaElement.title === 'string') {\n return schemaElement.title;\n }\n if (typeof controlElement.scope === 'string') {\n const ref = controlElement.scope;\n const label = decode(ref.substr(ref.lastIndexOf('/') + 1));\n return startCase(label);\n }\n\n return '';\n};\n\nexport const createCleanLabel = (label: string): string => {\n return startCase(label.replace('_', ' '));\n};\n\n/**\n * Return a label object based on the given control and schema element.\n * @param {ControlElement} withLabel the UI schema to obtain a label object for\n * @param {JsonSchema} schema optional: the corresponding schema element\n * @returns {LabelDescription}\n */\nexport const createLabelDescriptionFrom = (\n withLabel: ControlElement,\n schema?: JsonSchema\n): LabelDescription => {\n const labelProperty = withLabel.label;\n if (typeof labelProperty === 'boolean') {\n return labelDescription(deriveLabel(withLabel, schema), labelProperty);\n }\n if (typeof labelProperty === 'string') {\n return labelDescription(labelProperty, true);\n }\n if (typeof labelProperty === 'object') {\n const label =\n typeof labelProperty.text === 'string'\n ? labelProperty.text\n : deriveLabel(withLabel, schema);\n const show =\n typeof labelProperty.show === 'boolean' ? labelProperty.show : true;\n return labelDescription(label, show);\n }\n return labelDescription(deriveLabel(withLabel, schema), true);\n};\n\nconst labelDescription = (text: string, show: boolean): LabelDescription => ({\n text: text,\n show: show,\n});\n","/*\n The MIT License\n\n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport get from 'lodash/get';\nimport {\n ControlElement,\n isLabelable,\n JsonSchema,\n JsonSchema4,\n JsonSchema7,\n LabelElement,\n UISchemaElement,\n} from '../models';\nimport find from 'lodash/find';\nimport {\n getUISchemas,\n getAjv,\n getCells,\n getConfig,\n getData,\n getErrorAt,\n getErrorTranslator,\n getRenderers,\n getSchema,\n getSubErrorsAt,\n getTranslator,\n getUiSchema,\n} from '../reducers';\nimport type {\n JsonFormsCellRendererRegistryEntry,\n JsonFormsRendererRegistryEntry,\n JsonFormsUISchemaRegistryEntry,\n} from '../reducers';\nimport type { RankedTester } from '../testers';\nimport { hasShowRule, isInherentlyEnabled, isVisible } from './runtime';\nimport { createLabelDescriptionFrom } from './label';\nimport type { CombinatorKeyword } from './combinators';\nimport { moveDown, moveUp } from './array';\nimport type { AnyAction, Dispatch } from './type';\nimport { Resolve, convertDateToString, hasType } from './util';\nimport { composePaths, composeWithUi } from './path';\nimport { CoreActions, update } from '../actions';\nimport type { ErrorObject } from 'ajv';\nimport type { JsonFormsState } from '../store';\nimport {\n deriveLabelForUISchemaElement,\n getCombinedErrorMessage,\n getI18nKey,\n getI18nKeyPrefix,\n getI18nKeyPrefixBySchema,\n getArrayTranslations,\n Translator,\n CombinatorTranslations,\n getCombinatorTranslations,\n combinatorDefaultTranslations,\n} from '../i18n';\nimport {\n arrayDefaultTranslations,\n ArrayTranslations,\n} from '../i18n/arrayTranslations';\nimport { resolveSchema } from './resolvers';\nimport cloneDeep from 'lodash/cloneDeep';\nimport isEqual from 'lodash/isEqual';\nimport has from 'lodash/has';\nimport any from 'lodash/fp/any';\nimport all from 'lodash/fp/all';\n\nconst dataPathToJsonPointer = (dataPath: string): string => {\n const parts = dataPath.split('.');\n let jsonPointer = '#';\n\n parts.forEach((part) => {\n if (part.match(/^\\d+$/)) {\n jsonPointer += '/items';\n } else {\n jsonPointer += `/properties/${part}`;\n }\n });\n\n return jsonPointer;\n};\n\nconst checkDataCondition = (\n propertyCondition: unknown,\n property: string,\n data: Record\n) => {\n if (has(propertyCondition, 'const')) {\n return (\n has(data, property) &&\n isEqual(data[property], get(propertyCondition, 'const'))\n );\n } else if (has(propertyCondition, 'enum')) {\n return (\n has(data, property) &&\n (get(propertyCondition, 'enum') as unknown[]).find((value) =>\n isEqual(value, data[property])\n ) !== undefined\n );\n } else if (has(propertyCondition, 'pattern')) {\n const pattern = new RegExp(get(propertyCondition, 'pattern'));\n\n return (\n has(data, property) &&\n typeof data[property] === 'string' &&\n pattern.test(data[property] as string)\n );\n }\n\n return false;\n};\n\nconst checkPropertyCondition = (\n propertiesCondition: Record,\n property: string,\n data: Record\n): boolean => {\n if (has(propertiesCondition[property], 'not')) {\n return !checkDataCondition(\n get(propertiesCondition[property], 'not'),\n property,\n data\n );\n }\n\n if (has(propertiesCondition[property], 'properties') && has(data, property)) {\n const nextPropertyConditions = get(\n propertiesCondition[property],\n 'properties'\n );\n\n return all(\n (prop) =>\n checkPropertyCondition(\n nextPropertyConditions,\n prop,\n data[property] as Record\n ),\n Object.keys(nextPropertyConditions)\n );\n }\n\n return checkDataCondition(propertiesCondition[property], property, data);\n};\n\nconst evaluateCondition = (\n schema: JsonSchema,\n data: Record\n): boolean => {\n if (has(schema, 'allOf')) {\n return all(\n (subschema: JsonSchema) => evaluateCondition(subschema, data),\n get(schema, 'allOf')\n );\n }\n\n if (has(schema, 'anyOf')) {\n return any(\n (subschema: JsonSchema) => evaluateCondition(subschema, data),\n get(schema, 'anyOf')\n );\n }\n\n if (has(schema, 'oneOf')) {\n const subschemas = get(schema, 'oneOf');\n\n let satisfied = false;\n\n for (let i = 0; i < subschemas.length; i++) {\n const current = evaluateCondition(subschemas[i], data);\n if (current && satisfied) {\n return false;\n }\n\n if (current && !satisfied) {\n satisfied = true;\n }\n }\n\n return satisfied;\n }\n\n let requiredProperties: string[] = [];\n if (has(schema, 'required')) {\n requiredProperties = get(schema, 'required');\n }\n\n const requiredCondition = all(\n (property) => has(data, property),\n requiredProperties\n );\n\n if (has(schema, 'properties')) {\n const propertiesCondition = get(schema, 'properties') as Record<\n string,\n unknown\n >;\n\n const valueCondition = all(\n (property) => checkPropertyCondition(propertiesCondition, property, data),\n Object.keys(propertiesCondition)\n );\n\n return requiredCondition && valueCondition;\n }\n\n return requiredCondition;\n};\n\n/**\n * Go through parent's properties until the segment is found at the exact level it is defined and check if it is required\n */\nconst extractRequired = (\n schema: JsonSchema,\n segment: string,\n prevSegments: string[]\n) => {\n let i = 0;\n let currentSchema = schema;\n while (\n i < prevSegments.length &&\n (has(currentSchema, prevSegments[i]) ||\n (has(currentSchema, 'properties') &&\n has(get(currentSchema, 'properties'), prevSegments[i])))\n ) {\n if (has(currentSchema, 'properties')) {\n currentSchema = get(currentSchema, 'properties');\n }\n currentSchema = get(currentSchema, prevSegments[i]);\n ++i;\n }\n\n if (i < prevSegments.length) {\n return false;\n }\n\n return (\n has(currentSchema, 'required') &&\n (get(currentSchema, 'required') as string[]).includes(segment)\n );\n};\n\n/**\n * Check if property's required attribute is set based on if-then-else condition\n *\n */\nconst checkRequiredInIf = (\n schema: JsonSchema,\n segment: string,\n prevSegments: string[],\n data: Record\n): boolean => {\n const propertiesConditionSchema = get(schema, 'if');\n\n const condition = evaluateCondition(propertiesConditionSchema, data);\n\n const ifInThen = has(get(schema, 'then'), 'if');\n const ifInElse = has(get(schema, 'else'), 'if');\n const allOfInThen = has(get(schema, 'then'), 'allOf');\n const allOfInElse = has(get(schema, 'else'), 'allOf');\n\n return (\n (has(schema, 'then') &&\n condition &&\n extractRequired(get(schema, 'then'), segment, prevSegments)) ||\n (has(schema, 'else') &&\n !condition &&\n extractRequired(get(schema, 'else'), segment, prevSegments)) ||\n (ifInThen &&\n condition &&\n checkRequiredInIf(get(schema, 'then'), segment, prevSegments, data)) ||\n (ifInElse &&\n !condition &&\n checkRequiredInIf(get(schema, 'else'), segment, prevSegments, data)) ||\n (allOfInThen &&\n condition &&\n conditionallyRequired(\n get(schema, 'then'),\n segment,\n prevSegments,\n data\n )) ||\n (allOfInElse &&\n !condition &&\n conditionallyRequired(get(schema, 'else'), segment, prevSegments, data))\n );\n};\n\n/**\n * Check if property becomes required based on some if-then-else condition\n * that is part of allOf combinator\n */\nconst conditionallyRequired = (\n schema: JsonSchema,\n segment: string,\n prevSegments: string[],\n data: any\n) => {\n const nestedAllOfSchema = get(schema, 'allOf');\n\n return any((subschema: JsonSchema4 | JsonSchema7): boolean => {\n return (\n (has(subschema, 'if') &&\n checkRequiredInIf(subschema, segment, prevSegments, data)) ||\n conditionallyRequired(subschema, segment, prevSegments, data)\n );\n }, nestedAllOfSchema);\n};\n\nconst getNextHigherSchemaPath = (schemaPath: string): string => {\n const pathSegments = schemaPath.split('/');\n const lastSegment = pathSegments[pathSegments.length - 1];\n\n // We'd normally jump two segments back, but if we're in an `items` key, we want to check its parent\n // Example path: '#/properties/anotherObject/properties/myArray/items/properties/propertyName'\n const nextHigherSegmentIndexDifference = lastSegment === 'items' ? 1 : 2;\n const nextHigherSchemaSegments = pathSegments.slice(\n 0,\n pathSegments.length - nextHigherSegmentIndexDifference\n );\n\n return nextHigherSchemaSegments.join('/');\n};\n\nconst getNextHigherDataPath = (dataPath: string): string => {\n const dataPathSegments = dataPath.split('.');\n return dataPathSegments.slice(0, dataPathSegments.length - 1).join('.');\n};\n\n/**\n * Check if property is being required in the parent schema\n */\nconst isRequiredInParent = (\n schema: JsonSchema,\n schemaPath: string,\n segment: string,\n prevSegments: string[],\n data: Record,\n dataPath: string\n): boolean => {\n const pathSegments = schemaPath.split('/');\n const lastSegment = pathSegments[pathSegments.length - 1];\n const nextHigherSchemaPath = getNextHigherSchemaPath(schemaPath);\n\n if (!nextHigherSchemaPath) {\n return false;\n }\n\n const nextHigherSchema = Resolve.schema(schema, nextHigherSchemaPath, schema);\n\n const nextHigherDataPath = getNextHigherDataPath(dataPath);\n const currentData = Resolve.data(data, nextHigherDataPath);\n\n return (\n conditionallyRequired(\n nextHigherSchema,\n segment,\n [lastSegment, ...prevSegments],\n currentData\n ) ||\n (has(nextHigherSchema, 'if') &&\n checkRequiredInIf(\n nextHigherSchema,\n segment,\n [lastSegment, ...prevSegments],\n currentData\n )) ||\n // TODO: Were we previously skipping each other parent\n // when calling `isRequiredInParent` recursively (because of\n // the `slice` call with (pathSegments.length - 4) - hence going\n // back two times on each call)\n isRequiredInParent(\n schema,\n nextHigherSchemaPath,\n segment,\n [lastSegment, ...prevSegments],\n // TODO: Why was this currentData?\n data,\n nextHigherDataPath\n )\n );\n};\n\nconst isRequiredInSchema = (schema: JsonSchema, segment: string): boolean => {\n return (\n schema !== undefined &&\n schema.required !== undefined &&\n schema.required.indexOf(segment) !== -1\n );\n};\n\nconst isRequired = (\n schema: JsonSchema,\n schemaPath: string,\n rootSchema: JsonSchema\n): boolean => {\n const pathSegments = schemaPath.split('/');\n const lastSegment = pathSegments[pathSegments.length - 1];\n // TODO: This does not work correctly with \"items\" in the schemaPath\n // Skip \"properties\", \"items\" etc. to resolve the parent\n const nextHigherSchemaSegments = pathSegments.slice(\n 0,\n pathSegments.length - 2\n );\n const nextHigherSchemaPath = nextHigherSchemaSegments.join('/');\n const nextHigherSchema = Resolve.schema(\n schema,\n nextHigherSchemaPath,\n rootSchema\n );\n return isRequiredInSchema(nextHigherSchema, lastSegment);\n};\n\n// TODO: This may now be combinable with `isRequiredInParent` in a\n// single function\nconst isConditionallyRequired = (\n rootSchema: JsonSchema,\n schemaPath: string,\n data: any,\n dataPath: string\n): boolean => {\n const pathSegments = schemaPath.split('/');\n const lastSegment = pathSegments[pathSegments.length - 1];\n\n const nextHigherSchemaPath = getNextHigherSchemaPath(schemaPath);\n const nextHigherSchema = Resolve.schema(\n rootSchema,\n nextHigherSchemaPath,\n rootSchema\n );\n\n // We need the `dataPath` to be able to resolve data in arrays,\n // for example `myObject.myArray.0.myProperty` has no\n // equivalent for the index in the schema syntax\n const nextHigherDataPath = getNextHigherDataPath(dataPath);\n const currentData = Resolve.data(data, nextHigherDataPath);\n\n const requiredInIf =\n has(nextHigherSchema, 'if') &&\n checkRequiredInIf(nextHigherSchema, lastSegment, [], currentData);\n\n const requiredConditionally = conditionallyRequired(\n nextHigherSchema,\n lastSegment,\n [],\n currentData\n );\n\n const requiredConditionallyInParent = isRequiredInParent(\n rootSchema,\n // TODO: Why was this previously schemaPath\n nextHigherSchemaPath,\n lastSegment,\n [],\n data,\n nextHigherDataPath\n );\n\n return requiredInIf || requiredConditionally || requiredConditionallyInParent;\n};\n\n/**\n * Adds an asterisk to the given label string based\n * on the required parameter.\n *\n * @param {string | undefined} label the label string\n * @param {boolean} required whether the label belongs to a control which is required\n * @param {boolean} hideRequiredAsterisk applied UI Schema option\n * @returns {string} the label string\n */\nexport const computeLabel = (\n label: string | undefined,\n required: boolean,\n hideRequiredAsterisk: boolean\n): string => {\n return `${label ?? ''}${required && !hideRequiredAsterisk ? '*' : ''}`;\n};\n\n/**\n * Indicates whether to mark a field as required.\n *\n * @param {boolean} required whether the label belongs to a control which is required\n * @param {boolean} hideRequiredAsterisk applied UI Schema option\n * @returns {boolean} should the field be marked as required\n */\nexport const showAsRequired = (\n required: boolean,\n hideRequiredAsterisk: boolean\n): boolean => {\n return required && !hideRequiredAsterisk;\n};\n\n/**\n * Create a default value based on the given schema.\n * @param schema the schema for which to create a default value.\n * @returns {any}\n */\nexport const createDefaultValue = (\n schema: JsonSchema,\n rootSchema: JsonSchema\n) => {\n const resolvedSchema = Resolve.schema(schema, schema.$ref, rootSchema);\n if (resolvedSchema.default !== undefined) {\n return extractDefaults(resolvedSchema, rootSchema);\n }\n if (hasType(resolvedSchema, 'string')) {\n if (\n resolvedSchema.format === 'date-time' ||\n resolvedSchema.format === 'date' ||\n resolvedSchema.format === 'time'\n ) {\n return convertDateToString(new Date(), resolvedSchema.format);\n }\n return '';\n } else if (\n hasType(resolvedSchema, 'integer') ||\n hasType(resolvedSchema, 'number')\n ) {\n return 0;\n } else if (hasType(resolvedSchema, 'boolean')) {\n return false;\n } else if (hasType(resolvedSchema, 'array')) {\n return [];\n } else if (hasType(resolvedSchema, 'object')) {\n return extractDefaults(resolvedSchema, rootSchema);\n } else if (hasType(resolvedSchema, 'null')) {\n return null;\n } else {\n return {};\n }\n};\n\n/**\n * Returns the default value defined in the given schema.\n * @param schema the schema for which to create a default value.\n * @returns {any}\n */\nexport const extractDefaults = (schema: JsonSchema, rootSchema: JsonSchema) => {\n if (hasType(schema, 'object') && schema.default === undefined) {\n const result: { [key: string]: any } = {};\n for (const key in schema.properties) {\n const property = schema.properties[key];\n const resolvedProperty = property.$ref\n ? Resolve.schema(rootSchema, property.$ref, rootSchema)\n : property;\n if (resolvedProperty.default !== undefined) {\n result[key] = cloneDeep(resolvedProperty.default);\n }\n }\n return result;\n }\n return cloneDeep(schema.default);\n};\n\n/**\n * Whether an element's description should be hidden.\n *\n * @param visible whether an element is visible\n * @param description the element's description\n * @param isFocused whether the element is focused\n *\n * @returns {boolean} true, if the description is to be hidden, false otherwise\n */\nexport const isDescriptionHidden = (\n visible: boolean,\n description: string | undefined,\n isFocused: boolean,\n showUnfocusedDescription: boolean\n): boolean => {\n return (\n description === undefined ||\n (description !== undefined && !visible) ||\n (!showUnfocusedDescription && !isFocused)\n );\n};\n\nexport interface WithClassname {\n className?: string;\n}\n\nexport interface EnumOption {\n label: string;\n value: any;\n}\n\nexport const enumToEnumOptionMapper = (\n e: any,\n t?: Translator,\n i18nKey?: string\n): EnumOption => {\n let label = typeof e === 'string' ? e : JSON.stringify(e);\n if (t) {\n if (i18nKey) {\n label = t(`${i18nKey}.${label}`, label);\n } else {\n label = t(label, label);\n }\n }\n return { label, value: e };\n};\n\nexport const oneOfToEnumOptionMapper = (\n e: any,\n t?: Translator,\n fallbackI18nKey?: string\n): EnumOption => {\n let label =\n e.title ??\n (typeof e.const === 'string' ? e.const : JSON.stringify(e.const));\n if (t) {\n // prefer schema keys as they can be more specialized\n if (e.i18n) {\n label = t(e.i18n, label);\n } else if (fallbackI18nKey) {\n label = t(`${fallbackI18nKey}.${label}`, label);\n } else {\n label = t(label, label);\n }\n }\n return {\n label,\n value: e.const,\n };\n};\n\nexport interface OwnPropsOfRenderer {\n /**\n * The UI schema to be rendered.\n */\n uischema?: UISchemaElement;\n /**\n * The JSON schema that describes the data.\n */\n schema?: JsonSchema;\n /**\n * Whether the rendered element should be enabled.\n */\n enabled?: boolean;\n /**\n * Whether the rendered element should be visible.\n */\n visible?: boolean;\n\n /**\n * Optional instance path. Necessary when the actual data\n * path can not be inferred via the UI schema element as\n * it is the case with nested controls.\n */\n path?: string;\n\n renderers?: JsonFormsRendererRegistryEntry[];\n\n cells?: JsonFormsCellRendererRegistryEntry[];\n\n uischemas?: JsonFormsUISchemaRegistryEntry[];\n}\n\nexport interface OwnPropsOfControl extends OwnPropsOfRenderer {\n id?: string;\n // constraint type\n uischema?: ControlElement;\n}\n\nexport interface OwnPropsOfLabel extends OwnPropsOfRenderer {\n uischema?: LabelElement;\n}\n\nexport interface OwnPropsOfEnum {\n options?: EnumOption[];\n}\n\nexport interface OwnPropsOfLayout extends OwnPropsOfRenderer {\n direction?: 'row' | 'column';\n}\n\n/**\n * State-based props of a {@link Renderer}.\n */\nexport interface StatePropsOfRenderer {\n /**\n * Any configuration options for the element.\n */\n config?: any;\n\n /**\n * The UI schema to be rendered.\n */\n uischema: UISchemaElement;\n\n /**\n * The JSON schema that describes the data.\n */\n schema: JsonSchema;\n\n /**\n * The data to be rendered.\n */\n data?: any;\n\n /**\n * Whether the rendered element should be enabled.\n */\n enabled: boolean;\n /**\n * Whether the rendered element should be visible.\n */\n visible: boolean;\n\n /**\n * Instance path the data is written to, in case of a control.\n */\n path: string;\n\n /**\n * All available renderers.\n */\n renderers?: JsonFormsRendererRegistryEntry[];\n\n /**\n * All available cell renderers.\n */\n\n cells?: JsonFormsCellRendererRegistryEntry[];\n}\n\n/**\n * State-based properties for UI schema elements that have a scope.\n */\nexport interface StatePropsOfScopedRenderer extends StatePropsOfRenderer {\n // constraint type\n uischema: ControlElement;\n\n /**\n * Any validation errors that are caused by the data to be rendered.\n */\n errors: string;\n\n /**\n * The data to be rendered.\n */\n data: any;\n\n /**\n * The root schema as returned by the store.\n */\n rootSchema: JsonSchema;\n\n /**\n * A unique ID that should be used for rendering the scoped UI schema element.\n */\n id: string;\n}\n\n/**\n * Props of a {@link Renderer}.\n */\nexport interface RendererProps extends StatePropsOfRenderer {}\n\n/**\n * State-based props of a Control\n */\nexport interface StatePropsOfControl extends StatePropsOfScopedRenderer {\n cells?: { tester: RankedTester; cell: any }[];\n\n /**\n * The label for the rendered element.\n */\n label: string;\n\n /**\n * Description of input cell\n */\n description?: string;\n\n /**\n * Whether the rendered data is required.\n */\n required?: boolean;\n\n i18nKeyPrefix?: string;\n\n // TODO: renderers?\n}\n\n/**\n * Dispatch-based props of a Control.\n */\nexport interface DispatchPropsOfControl {\n /**\n * Update handler that emits a data change\n *\n * @param {string} path the path to the data to be updated\n * @param {any} value the new value that should be written to the given path\n */\n handleChange(path: string, value: any): void;\n}\n\n/**\n * Props of a Control.\n */\nexport interface ControlProps\n extends StatePropsOfControl,\n DispatchPropsOfControl {}\n\n/**\n * State props of a layout;\n */\nexport interface StatePropsOfLayout extends StatePropsOfRenderer {\n /**\n * Direction for the layout to flow\n */\n direction: 'row' | 'column';\n label?: string;\n}\n\nexport interface LayoutProps extends StatePropsOfLayout {}\n\n/**\n * The state of a control.\n */\nexport interface ControlState {\n /**\n * The current value.\n */\n value: any;\n\n /**\n * Whether the control is focused.\n */\n isFocused: boolean;\n}\n\n/**\n * Map state to control props.\n * @param state the store's state\n * @param ownProps any own props\n * @returns {StatePropsOfControl} state props for a control\n */\nexport const mapStateToControlProps = (\n state: JsonFormsState,\n ownProps: OwnPropsOfControl\n): StatePropsOfControl => {\n const { uischema } = ownProps;\n const rootData = getData(state);\n const path = composeWithUi(uischema, ownProps.path);\n const visible: boolean =\n ownProps.visible === undefined || hasShowRule(uischema)\n ? isVisible(uischema, rootData, ownProps.path, getAjv(state))\n : ownProps.visible;\n const controlElement = uischema as ControlElement;\n const id = ownProps.id;\n const rootSchema = getSchema(state);\n const config = getConfig(state);\n const required =\n controlElement.scope !== undefined &&\n !!(\n isRequired(ownProps.schema, controlElement.scope, rootSchema) ||\n // IMPORTANT: The config.allowDynamicCheck condition was removed here,\n // because this makes it more convenient to use in the author's specific\n // usecase. Do not commit this to the json-forms origin repo.\n isConditionallyRequired(\n rootSchema,\n dataPathToJsonPointer(path),\n rootData,\n path\n )\n );\n const resolvedSchema = Resolve.schema(\n ownProps.schema || rootSchema,\n controlElement.scope,\n rootSchema\n );\n const errors = getErrorAt(path, resolvedSchema)(state);\n\n const description =\n resolvedSchema !== undefined ? resolvedSchema.description : '';\n const data = Resolve.data(rootData, path);\n const labelDesc = createLabelDescriptionFrom(uischema, resolvedSchema);\n const label = labelDesc.show ? labelDesc.text : '';\n const enabled: boolean = isInherentlyEnabled(\n state,\n ownProps,\n uischema,\n resolvedSchema || rootSchema,\n rootData,\n config\n );\n\n const schema = resolvedSchema ?? rootSchema;\n const t = getTranslator()(state);\n const te = getErrorTranslator()(state);\n const i18nKeyPrefix = getI18nKeyPrefix(schema, uischema, path);\n const i18nLabel = t(getI18nKey(schema, uischema, path, 'label'), label, {\n schema,\n uischema,\n path,\n errors,\n });\n const i18nDescription = t(\n getI18nKey(schema, uischema, path, 'description'),\n description,\n { schema, uischema, path, errors }\n );\n const i18nErrorMessage = getCombinedErrorMessage(\n errors,\n te,\n t,\n schema,\n uischema,\n path\n );\n\n return {\n data,\n description: i18nDescription,\n errors: i18nErrorMessage,\n label: i18nLabel,\n visible,\n enabled,\n id,\n path,\n required,\n uischema,\n schema,\n config: getConfig(state),\n cells: ownProps.cells || state.jsonforms.cells,\n rootSchema,\n i18nKeyPrefix,\n };\n};\n\n/**\n *\n * Map dispatch to control props.\n *\n * @param dispatch the store's dispatch method\n * @returns {DispatchPropsOfControl} dispatch props for a control\n */\nexport const mapDispatchToControlProps = (\n dispatch: Dispatch\n): DispatchPropsOfControl => ({\n handleChange(path, value) {\n dispatch(update(path, () => value));\n },\n});\n\n/**\n * Default mapStateToCellProps for enum control. Options is used for populating dropdown list\n * @param state\n * @param ownProps\n * @returns {StatePropsOfControl & OwnPropsOfEnum}\n */\nexport const mapStateToEnumControlProps = (\n state: JsonFormsState,\n ownProps: OwnPropsOfControl & OwnPropsOfEnum\n): StatePropsOfControl & OwnPropsOfEnum => {\n const props: StatePropsOfControl = mapStateToControlProps(state, ownProps);\n const options: EnumOption[] =\n ownProps.options ||\n props.schema.enum?.map((e) =>\n enumToEnumOptionMapper(\n e,\n getTranslator()(state),\n getI18nKeyPrefix(props.schema, props.uischema, props.path)\n )\n ) ||\n (props.schema.const && [\n enumToEnumOptionMapper(\n props.schema.const,\n getTranslator()(state),\n getI18nKeyPrefix(props.schema, props.uischema, props.path)\n ),\n ]);\n return {\n ...props,\n options,\n };\n};\n\n/**\n * Default mapStateToCellProps for enum control based on oneOf. Options is used for populating dropdown list\n * @param state\n * @param ownProps\n * @returns {StatePropsOfControl & OwnPropsOfEnum}\n */\nexport const mapStateToOneOfEnumControlProps = (\n state: JsonFormsState,\n ownProps: OwnPropsOfControl & OwnPropsOfEnum\n): StatePropsOfControl & OwnPropsOfEnum => {\n const props: StatePropsOfControl = mapStateToControlProps(state, ownProps);\n const options: EnumOption[] =\n ownProps.options ||\n (props.schema.oneOf as JsonSchema[])?.map((oneOfSubSchema) =>\n oneOfToEnumOptionMapper(\n oneOfSubSchema,\n getTranslator()(state),\n getI18nKeyPrefix(props.schema, props.uischema, props.path)\n )\n );\n return {\n ...props,\n options,\n };\n};\n\n/**\n * Default mapStateToCellProps for multi enum control. Options is used for populating dropdown list\n * @param state\n * @param ownProps\n * @returns {StatePropsOfControl & OwnPropsOfEnum}\n */\nexport const mapStateToMultiEnumControlProps = (\n state: JsonFormsState,\n ownProps: OwnPropsOfControl & OwnPropsOfEnum\n): StatePropsOfControl & OwnPropsOfEnum => {\n const props: StatePropsOfControl = mapStateToControlProps(state, ownProps);\n let items = props.schema.items as JsonSchema;\n items =\n items && items.$ref\n ? resolveSchema(props.rootSchema, items.$ref, props.rootSchema)\n : items;\n const options: EnumOption[] =\n ownProps.options ||\n (items?.oneOf &&\n (items.oneOf as JsonSchema[]).map((oneOfSubSchema) =>\n oneOfToEnumOptionMapper(\n oneOfSubSchema,\n state.jsonforms.i18n?.translate,\n getI18nKeyPrefix(props.schema, props.uischema, props.path)\n )\n )) ||\n items?.enum?.map((e) =>\n enumToEnumOptionMapper(\n e,\n state.jsonforms.i18n?.translate,\n getI18nKeyPrefix(props.schema, props.uischema, props.path)\n )\n );\n return {\n ...props,\n options,\n };\n};\n\n/**\n * Map state to control props.\n * @param state the store's state\n * @param ownProps any own props\n * @returns {StatePropsOfControl} state props for a control\n */\nexport const mapStateToMasterListItemProps = (\n state: JsonFormsState,\n ownProps: OwnPropsOfMasterListItem\n): StatePropsOfMasterItem => {\n const { schema, path, index } = ownProps;\n const firstPrimitiveProp = schema.properties\n ? find(Object.keys(schema.properties), (propName) => {\n const prop = schema.properties[propName];\n return (\n prop.type === 'string' ||\n prop.type === 'number' ||\n prop.type === 'integer'\n );\n })\n : undefined;\n const childPath = composePaths(path, `${index}`);\n const childData = Resolve.data(getData(state), childPath);\n const childLabel = firstPrimitiveProp ? childData[firstPrimitiveProp] : '';\n\n return {\n ...ownProps,\n childLabel,\n };\n};\n\n/**\n * State-based props of a table control.\n */\nexport interface StatePropsOfControlWithDetail extends StatePropsOfControl {\n uischemas?: JsonFormsUISchemaRegistryEntry[];\n renderers?: JsonFormsRendererRegistryEntry[];\n cells?: JsonFormsCellRendererRegistryEntry[];\n}\n\nexport interface OwnPropsOfMasterListItem {\n index: number;\n selected: boolean;\n path: string;\n enabled: boolean;\n schema: JsonSchema;\n handleSelect(index: number): () => void;\n removeItem(path: string, value: number): () => void;\n translations: ArrayTranslations;\n}\n\nexport interface StatePropsOfMasterItem extends OwnPropsOfMasterListItem {\n childLabel: string;\n}\n\n/**\n * Map state to control with detail props\n *\n * @param state the store's state\n * @param ownProps any element's own props\n * @returns {StatePropsOfArrayControl} state props for a table control\n */\nexport const mapStateToControlWithDetailProps = (\n state: JsonFormsState,\n ownProps: OwnPropsOfControl\n): StatePropsOfControlWithDetail => {\n const { ...props } = mapStateToControlProps(state, ownProps);\n\n return {\n ...props,\n uischemas: state.jsonforms.uischemas,\n };\n};\n\nexport interface ControlWithDetailProps\n extends StatePropsOfControlWithDetail,\n DispatchPropsOfControl {}\n\n/**\n * State-based props of a table control.\n */\nexport interface StatePropsOfArrayControl\n extends StatePropsOfControlWithDetail {\n translations: ArrayTranslations;\n childErrors?: ErrorObject[];\n}\n\n/**\n * Map state to table props\n *\n * @param state the store's state\n * @param ownProps any element's own props\n * @returns {StatePropsOfArrayControl} state props for a table control\n */\nexport const mapStateToArrayControlProps = (\n state: JsonFormsState,\n ownProps: OwnPropsOfControl\n): StatePropsOfArrayControl => {\n const { path, schema, uischema, i18nKeyPrefix, label, ...props } =\n mapStateToControlWithDetailProps(state, ownProps);\n\n const resolvedSchema = Resolve.schema(schema, 'items', props.rootSchema);\n const childErrors = getSubErrorsAt(path, resolvedSchema)(state);\n const t = getTranslator()(state);\n\n return {\n ...props,\n label,\n path,\n uischema,\n schema: resolvedSchema,\n childErrors,\n renderers: ownProps.renderers || getRenderers(state),\n cells: ownProps.cells || getCells(state),\n translations: getArrayTranslations(\n t,\n arrayDefaultTranslations,\n i18nKeyPrefix,\n label\n ),\n };\n};\n\n/**\n * Dispatch props of a table control\n */\nexport interface DispatchPropsOfArrayControl {\n addItem(path: string, value: any): () => void;\n removeItems?(path: string, toDelete: number[]): () => void;\n moveUp?(path: string, toMove: number): () => void;\n moveDown?(path: string, toMove: number): () => void;\n}\n\n/**\n * Maps state to dispatch properties of an array control.\n *\n * @param dispatch the store's dispatch method\n * @returns {DispatchPropsOfArrayControl} dispatch props of an array control\n */\nexport const mapDispatchToArrayControlProps = (\n dispatch: Dispatch\n): DispatchPropsOfArrayControl => ({\n addItem: (path: string, value: any) => () => {\n dispatch(\n update(path, (array) => {\n if (array === undefined || array === null) {\n return [value];\n }\n\n array.push(value);\n return array;\n })\n );\n },\n removeItems: (path: string, toDelete: number[]) => () => {\n dispatch(\n update(path, (array) => {\n toDelete\n .sort((a, b) => a - b)\n .reverse()\n .forEach((s) => array.splice(s, 1));\n return array;\n })\n );\n },\n moveUp: (path, toMove: number) => () => {\n dispatch(\n update(path, (array) => {\n moveUp(array, toMove);\n return array;\n })\n );\n },\n moveDown: (path, toMove: number) => () => {\n dispatch(\n update(path, (array) => {\n moveDown(array, toMove);\n return array;\n })\n );\n },\n});\n\nexport interface DispatchPropsOfMultiEnumControl {\n addItem: (path: string, value: any) => void;\n removeItem?: (path: string, toDelete: any) => void;\n}\n\nexport const mapDispatchToMultiEnumProps = (\n dispatch: Dispatch\n): DispatchPropsOfMultiEnumControl => ({\n addItem: (path: string, value: any) => {\n dispatch(\n update(path, (data) => {\n if (data === undefined || data === null) {\n return [value];\n }\n data.push(value);\n return data;\n })\n );\n },\n removeItem: (path: string, toDelete: any) => {\n dispatch(\n update(path, (data) => {\n const indexInData = data.indexOf(toDelete);\n data.splice(indexInData, 1);\n return data;\n })\n );\n },\n});\n\n/**\n * Props of an array control.\n */\nexport interface ArrayControlProps\n extends StatePropsOfArrayControl,\n DispatchPropsOfArrayControl {}\n\nexport const layoutDefaultProps: {\n visible: boolean;\n enabled: boolean;\n path: string;\n direction: 'row' | 'column';\n} = {\n visible: true,\n enabled: true,\n path: '',\n direction: 'column',\n};\n\nconst getDirection = (uischema: UISchemaElement) => {\n if (uischema.type === 'HorizontalLayout') {\n return 'row';\n }\n if (uischema.type === 'VerticalLayout') {\n return 'column';\n }\n return layoutDefaultProps.direction;\n};\n\n/**\n * Map state to layout props.\n * @param state JSONForms state tree\n * @param ownProps any own props\n * @returns {StatePropsOfLayout}\n */\nexport const mapStateToLayoutProps = (\n state: JsonFormsState,\n ownProps: OwnPropsOfLayout\n): LayoutProps => {\n const rootData = getData(state);\n const { uischema } = ownProps;\n const visible: boolean =\n ownProps.visible === undefined || hasShowRule(uischema)\n ? isVisible(ownProps.uischema, rootData, ownProps.path, getAjv(state))\n : ownProps.visible;\n\n const data = Resolve.data(rootData, ownProps.path);\n const config = getConfig(state);\n const enabled: boolean = isInherentlyEnabled(\n state,\n ownProps,\n uischema,\n undefined, // layouts have no associated schema\n rootData,\n config\n );\n\n // some layouts have labels which might need to be translated\n const t = getTranslator()(state);\n const label = isLabelable(uischema)\n ? deriveLabelForUISchemaElement(uischema, t)\n : undefined;\n\n return {\n ...layoutDefaultProps,\n renderers: ownProps.renderers || getRenderers(state),\n cells: ownProps.cells || getCells(state),\n visible,\n enabled,\n path: ownProps.path,\n data,\n uischema: ownProps.uischema,\n schema: ownProps.schema,\n direction: ownProps.direction ?? getDirection(uischema),\n config,\n label,\n };\n};\n\nexport type RefResolver = (schema: JsonSchema) => Promise;\n\nexport interface OwnPropsOfJsonFormsRenderer extends OwnPropsOfRenderer {}\n\nexport interface StatePropsOfJsonFormsRenderer\n extends OwnPropsOfJsonFormsRenderer {\n rootSchema: JsonSchema;\n config: any;\n}\n\nexport interface JsonFormsProps extends StatePropsOfJsonFormsRenderer {}\n\nexport const mapStateToJsonFormsRendererProps = (\n state: JsonFormsState,\n ownProps: OwnPropsOfJsonFormsRenderer\n): StatePropsOfJsonFormsRenderer => {\n return {\n renderers: ownProps.renderers || get(state.jsonforms, 'renderers'),\n cells: ownProps.cells || get(state.jsonforms, 'cells'),\n schema: ownProps.schema || getSchema(state),\n rootSchema: getSchema(state),\n uischema: ownProps.uischema || getUiSchema(state),\n path: ownProps.path,\n enabled: ownProps.enabled,\n config: getConfig(state),\n };\n};\n\nexport const controlDefaultProps = {\n ...layoutDefaultProps,\n errors: [] as string[],\n};\n\nexport interface StatePropsOfCombinator extends StatePropsOfControl {\n rootSchema: JsonSchema;\n path: string;\n id: string;\n indexOfFittingSchema: number;\n uischemas: JsonFormsUISchemaRegistryEntry[];\n data: any;\n translations: CombinatorTranslations;\n}\n\nexport const mapStateToCombinatorRendererProps = (\n state: JsonFormsState,\n ownProps: OwnPropsOfControl,\n keyword: CombinatorKeyword\n): StatePropsOfCombinator => {\n const { data, schema, rootSchema, i18nKeyPrefix, label, ...props } =\n mapStateToControlProps(state, ownProps);\n\n const ajv = state.jsonforms.core.ajv;\n const t = getTranslator()(state);\n const translations = getCombinatorTranslations(\n t,\n combinatorDefaultTranslations,\n i18nKeyPrefix,\n label\n );\n const structuralKeywords = [\n 'required',\n 'additionalProperties',\n 'type',\n 'enum',\n 'const',\n ];\n const dataIsValid = (errors: ErrorObject[]): boolean => {\n return (\n !errors ||\n errors.length === 0 ||\n !errors.find((e) => structuralKeywords.indexOf(e.keyword) !== -1)\n );\n };\n let indexOfFittingSchema: number;\n // TODO instead of compiling the combinator subschemas we can compile the original schema\n // without the combinator alternatives and then revalidate and check the errors for the\n // element\n for (let i = 0; i < schema[keyword]?.length; i++) {\n try {\n let _schema = schema[keyword][i];\n if (_schema.$ref) {\n _schema = Resolve.schema(rootSchema, _schema.$ref, rootSchema);\n }\n const valFn = ajv.compile(_schema);\n valFn(data);\n if (dataIsValid(valFn.errors)) {\n indexOfFittingSchema = i;\n break;\n }\n } catch (error) {\n console.debug(\n \"Combinator subschema is not self contained, can't hand it over to AJV\"\n );\n }\n }\n\n return {\n data,\n schema,\n rootSchema,\n ...props,\n i18nKeyPrefix,\n label,\n indexOfFittingSchema,\n uischemas: getUISchemas(state),\n translations,\n };\n};\n\nexport interface CombinatorRendererProps\n extends StatePropsOfCombinator,\n DispatchPropsOfControl {}\n/**\n * Map state to all of renderer props.\n * @param state the store's state\n * @param ownProps any own props\n * @returns {StatePropsOfCombinator} state props for a combinator\n */\nexport const mapStateToAllOfProps = (\n state: JsonFormsState,\n ownProps: OwnPropsOfControl\n): StatePropsOfCombinator =>\n mapStateToCombinatorRendererProps(state, ownProps, 'allOf');\n\nexport const mapStateToAnyOfProps = (\n state: JsonFormsState,\n ownProps: OwnPropsOfControl\n): StatePropsOfCombinator => {\n return mapStateToCombinatorRendererProps(state, ownProps, 'anyOf');\n};\n\nexport const mapStateToOneOfProps = (\n state: JsonFormsState,\n ownProps: OwnPropsOfControl\n): StatePropsOfCombinator => {\n return mapStateToCombinatorRendererProps(state, ownProps, 'oneOf');\n};\n\nexport interface StatePropsOfArrayLayout extends StatePropsOfControlWithDetail {\n data: number;\n translations: ArrayTranslations;\n minItems?: number;\n}\n/**\n * Map state to table props\n *\n * @param state the store's state\n * @param ownProps any element's own props\n * @returns {StatePropsOfArrayControl} state props for a table control\n */\nexport const mapStateToArrayLayoutProps = (\n state: JsonFormsState,\n ownProps: OwnPropsOfControl\n): StatePropsOfArrayLayout => {\n const { path, schema, uischema, errors, i18nKeyPrefix, label, ...props } =\n mapStateToControlWithDetailProps(state, ownProps);\n\n const resolvedSchema = Resolve.schema(schema, 'items', props.rootSchema);\n const t = getTranslator()(state);\n // TODO Does not consider 'i18n' keys which are specified in the ui schemas of the sub errors\n const childErrors = getCombinedErrorMessage(\n getSubErrorsAt(path, resolvedSchema)(state),\n getErrorTranslator()(state),\n t,\n undefined,\n undefined,\n undefined\n );\n\n const allErrors =\n errors +\n (errors.length > 0 && childErrors.length > 0 ? '\\n' : '') +\n childErrors;\n return {\n ...props,\n label,\n path,\n uischema,\n schema: resolvedSchema,\n data: props.data ? props.data.length : 0,\n errors: allErrors,\n minItems: schema.minItems,\n translations: getArrayTranslations(\n t,\n arrayDefaultTranslations,\n i18nKeyPrefix,\n label\n ),\n };\n};\n\n/**\n * Props of an array control.\n */\nexport interface ArrayLayoutProps\n extends StatePropsOfArrayLayout,\n DispatchPropsOfArrayControl {}\n\nexport interface StatePropsOfLabel extends StatePropsOfRenderer {\n text?: string;\n}\nexport interface LabelProps extends StatePropsOfLabel {}\n\nexport const mapStateToLabelProps = (\n state: JsonFormsState,\n props: OwnPropsOfLabel\n) => {\n const { uischema } = props;\n\n const visible: boolean =\n props.visible === undefined || hasShowRule(uischema)\n ? isVisible(props.uischema, getData(state), props.path, getAjv(state))\n : props.visible;\n\n const text = uischema.text;\n const t = getTranslator()(state);\n const i18nKeyPrefix = getI18nKeyPrefixBySchema(undefined, uischema);\n const i18nKey = i18nKeyPrefix ? `${i18nKeyPrefix}.text` : text ?? '';\n const i18nText = t(i18nKey, text, { uischema });\n\n return {\n text: i18nText,\n visible,\n config: getConfig(state),\n renderers: props.renderers || getRenderers(state),\n cells: props.cells || getCells(state),\n };\n};\n","/*\n The MIT License\n\n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport isEmpty from 'lodash/isEmpty';\nimport {\n getErrorTranslator,\n getAjv,\n getConfig,\n getData,\n getErrorAt,\n getSchema,\n getTranslator,\n} from '../reducers';\nimport type { JsonFormsCellRendererRegistryEntry } from '../reducers';\nimport type { AnyAction, Dispatch } from './type';\nimport { Resolve } from './util';\nimport { isInherentlyEnabled, isVisible } from './runtime';\nimport {\n DispatchPropsOfControl,\n EnumOption,\n enumToEnumOptionMapper,\n mapDispatchToControlProps,\n oneOfToEnumOptionMapper,\n OwnPropsOfControl,\n OwnPropsOfEnum,\n StatePropsOfScopedRenderer,\n} from './renderer';\nimport { getCombinedErrorMessage, getI18nKeyPrefix } from '../i18n';\nimport type { JsonFormsState } from '../store';\nimport type { JsonSchema } from '../models';\n\nexport interface OwnPropsOfCell extends OwnPropsOfControl {\n data?: any;\n}\n\n/**\n * State props of a cell.\n */\nexport interface StatePropsOfCell extends StatePropsOfScopedRenderer {\n isValid: boolean;\n rootSchema: JsonSchema;\n}\n\nexport interface OwnPropsOfEnumCell extends OwnPropsOfCell, OwnPropsOfEnum {}\n\n/**\n * State props of a cell for enum cell\n */\nexport interface StatePropsOfEnumCell\n extends StatePropsOfCell,\n OwnPropsOfEnum {}\n\n/**\n * Props of an enum cell.\n */\nexport interface EnumCellProps\n extends StatePropsOfEnumCell,\n DispatchPropsOfControl {}\n\nexport type DispatchPropsOfCell = DispatchPropsOfControl;\n\n/**\n * Props of a cell.\n */\nexport interface CellProps extends StatePropsOfCell, DispatchPropsOfCell {}\n/**\n * Registers the given cell renderer when a JSON Forms store is created.\n * @param {RankedTester} tester\n * @param cell the cell to be registered\n * @returns {any}\n */\nexport interface DispatchCellStateProps extends StatePropsOfCell {\n cells?: JsonFormsCellRendererRegistryEntry[];\n}\n\n/**\n * Map state to cell props.\n *\n * @param state JSONForms state tree\n * @param ownProps any own props\n * @returns {StatePropsOfCell} state props of a cell\n */\nexport const mapStateToCellProps = (\n state: JsonFormsState,\n ownProps: OwnPropsOfCell\n): StatePropsOfCell => {\n const { id, schema, path, uischema, renderers, cells } = ownProps;\n const rootData = getData(state);\n const visible =\n ownProps.visible !== undefined\n ? ownProps.visible\n : isVisible(uischema, rootData, undefined, getAjv(state));\n\n const rootSchema = getSchema(state);\n const config = getConfig(state);\n\n /* When determining the enabled state of cells we take a shortcut: At the\n * moment it's only possible to configure enablement and disablement at the\n * control level. Therefore the renderer using the cell, for example a\n * table renderer, determines whether a cell is enabled and should hand\n * over the prop themselves. If that prop was given, we prefer it over\n * anything else to save evaluation effort (except for the global readonly\n * flag). For example it would be quite expensive to evaluate the same ui schema\n * rule again and again for each cell of a table. */\n let enabled;\n if (state.jsonforms.readonly === true) {\n enabled = false;\n } else if (typeof ownProps.enabled === 'boolean') {\n enabled = ownProps.enabled;\n } else {\n enabled = isInherentlyEnabled(\n state,\n ownProps,\n uischema,\n schema || rootSchema,\n rootData,\n config\n );\n }\n\n const t = getTranslator()(state);\n const te = getErrorTranslator()(state);\n const errors = getCombinedErrorMessage(\n getErrorAt(path, schema)(state),\n te,\n t,\n schema,\n uischema,\n path\n );\n const isValid = isEmpty(errors);\n\n return {\n data: Resolve.data(rootData, path),\n visible,\n enabled,\n id,\n path,\n errors,\n isValid,\n schema,\n uischema,\n config: getConfig(state),\n rootSchema,\n renderers,\n cells,\n };\n};\n\nexport const mapStateToDispatchCellProps = (\n state: JsonFormsState,\n ownProps: OwnPropsOfCell\n): DispatchCellStateProps => {\n const props: StatePropsOfCell = mapStateToCellProps(state, ownProps);\n const { renderers: _renderers, cells, ...otherOwnProps } = ownProps;\n return {\n ...props,\n ...otherOwnProps,\n cells: cells || state.jsonforms.cells || [],\n };\n};\n\nexport interface DispatchCellProps extends DispatchCellStateProps {}\n\n/**\n * Default mapStateToCellProps for enum cell. Options is used for populating dropdown list\n * @param state\n * @param ownProps\n * @returns {StatePropsOfEnumCell}\n */\nexport const defaultMapStateToEnumCellProps = (\n state: JsonFormsState,\n ownProps: OwnPropsOfEnumCell\n): StatePropsOfEnumCell => {\n const props: StatePropsOfCell = mapStateToCellProps(state, ownProps);\n const options: EnumOption[] =\n ownProps.options ||\n props.schema.enum?.map((e) =>\n enumToEnumOptionMapper(\n e,\n getTranslator()(state),\n getI18nKeyPrefix(props.schema, props.uischema, props.path)\n )\n ) ||\n (props.schema.const && [\n enumToEnumOptionMapper(\n props.schema.const,\n getTranslator()(state),\n getI18nKeyPrefix(props.schema, props.uischema, props.path)\n ),\n ]);\n return {\n ...props,\n options,\n };\n};\n\n/**\n * mapStateToOneOfEnumCellProps for one of enum cell. Options is used for populating dropdown list from oneOf\n * @param state\n * @param ownProps\n * @returns {StatePropsOfEnumCell}\n */\nexport const mapStateToOneOfEnumCellProps = (\n state: JsonFormsState,\n ownProps: OwnPropsOfEnumCell\n): StatePropsOfEnumCell => {\n const props: StatePropsOfCell = mapStateToCellProps(state, ownProps);\n const options: EnumOption[] =\n ownProps.options ||\n (props.schema.oneOf as JsonSchema[])?.map((oneOfSubSchema) =>\n oneOfToEnumOptionMapper(\n oneOfSubSchema,\n getTranslator()(state),\n getI18nKeyPrefix(props.schema, props.uischema, props.path)\n )\n );\n return {\n ...props,\n options,\n };\n};\n\n/**\n * Synonym for mapDispatchToControlProps.\n *\n * @type {(dispatch) => {handleChange(path, value): void}}\n */\nexport const mapDispatchToCellProps: (\n dispatch: Dispatch\n) => DispatchPropsOfControl = mapDispatchToControlProps;\n\n/**\n * Default dispatch to control props which can be customized to set handleChange action\n *\n */\nexport const defaultMapDispatchToControlProps =\n // TODO: ownProps types\n (dispatch: Dispatch, ownProps: any): DispatchPropsOfControl => {\n const { handleChange } = mapDispatchToCellProps(dispatch);\n\n return {\n handleChange: ownProps.handleChange || handleChange,\n };\n };\n","/*\n The MIT License\n \n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport type { ControlElement, JsonSchema, UISchemaElement } from '../models';\nimport { findUISchema, JsonFormsUISchemaRegistryEntry } from '../reducers';\nimport { Resolve } from './util';\n\nexport interface CombinatorSubSchemaRenderInfo {\n schema: JsonSchema;\n uischema: UISchemaElement;\n label: string;\n}\n\nexport type CombinatorKeyword = 'anyOf' | 'oneOf' | 'allOf';\n\nexport const createCombinatorRenderInfos = (\n combinatorSubSchemas: JsonSchema[],\n rootSchema: JsonSchema,\n keyword: CombinatorKeyword,\n control: ControlElement,\n path: string,\n uischemas: JsonFormsUISchemaRegistryEntry[]\n): CombinatorSubSchemaRenderInfo[] =>\n combinatorSubSchemas.map((subSchema, subSchemaIndex) => {\n const resolvedSubSchema =\n subSchema.$ref && Resolve.schema(rootSchema, subSchema.$ref, rootSchema);\n\n const schema = resolvedSubSchema ?? subSchema;\n\n return {\n schema,\n uischema: findUISchema(\n uischemas,\n schema,\n control.scope,\n path,\n undefined,\n control,\n rootSchema\n ),\n label:\n subSchema.title ??\n resolvedSubSchema?.title ??\n `${keyword}-${subSchemaIndex}`,\n };\n });\n","/*\n The MIT License\n \n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nconst usedIds: Set = new Set();\n\nconst makeId = (idBase: string, iteration: number) =>\n iteration <= 1 ? idBase : idBase + iteration.toString();\n\nconst isUniqueId = (idBase: string, iteration: number) => {\n const newID = makeId(idBase, iteration);\n return !usedIds.has(newID);\n};\n\nexport const createId = (proposedId: string) => {\n if (proposedId === undefined) {\n // failsafe to avoid endless loops in error cases\n proposedId = 'undefined';\n }\n let tries = 0;\n while (!isUniqueId(proposedId, tries)) {\n tries++;\n }\n const newID = makeId(proposedId, tries);\n usedIds.add(newID);\n return newID;\n};\n\nexport const removeId = (id: string) => usedIds.delete(id);\n\nexport const clearAllIds = () => usedIds.clear();\n","/*\n The MIT License\n\n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport find from 'lodash/find';\nimport { JsonSchema } from '../models';\n\nexport const getFirstPrimitiveProp = (schema: any) => {\n if (schema.properties) {\n return find(Object.keys(schema.properties), (propName) => {\n const prop = schema.properties[propName];\n return (\n prop.type === 'string' ||\n prop.type === 'number' ||\n prop.type === 'integer'\n );\n });\n }\n return undefined;\n};\n\n/**\n * Tests whether the schema has an enum based on oneOf.\n */\nexport const isOneOfEnumSchema = (schema: JsonSchema) =>\n !!schema &&\n Object.prototype.hasOwnProperty.call(schema, 'oneOf') &&\n schema.oneOf &&\n (schema.oneOf as JsonSchema[]).every((s) => s.const !== undefined);\n","/*\n The MIT License\n\n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport isEmpty from 'lodash/isEmpty';\nimport { isLayout, UISchemaElement } from '../models';\n\nexport type IterateCallback = (uischema: UISchemaElement) => void;\n\nconst setReadonlyPropertyValue =\n (value: boolean): IterateCallback =>\n (child: UISchemaElement): void => {\n if (!child.options) {\n child.options = {};\n }\n child.options.readonly = value;\n };\nexport const setReadonly = (uischema: UISchemaElement): void => {\n iterateSchema(uischema, setReadonlyPropertyValue(true));\n};\nexport const unsetReadonly = (uischema: UISchemaElement): void => {\n iterateSchema(uischema, setReadonlyPropertyValue(false));\n};\nexport const iterateSchema = (\n uischema: UISchemaElement,\n toApply: IterateCallback\n): void => {\n if (isEmpty(uischema)) {\n return;\n }\n if (isLayout(uischema)) {\n uischema.elements.forEach((child) => iterateSchema(child, toApply));\n return;\n }\n toApply(uischema);\n};\n","/*\n The MIT License\n \n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\nimport Ajv from 'ajv';\nimport addFormats from 'ajv-formats';\nimport type { Options } from 'ajv';\n\nexport const createAjv = (options?: Options) => {\n const ajv = new Ajv({\n allErrors: true,\n verbose: true,\n strict: false,\n addUsedSchema: false,\n ...options,\n });\n addFormats(ajv);\n return ajv;\n};\n","/*\n The MIT License\n \n Copyright (c) 2023-2023 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nexport const defaultDateFormat = 'YYYY-MM-DD';\nexport const defaultTimeFormat = 'HH:mm:ss';\nexport const defaultDateTimeFormat = 'YYYY-MM-DDTHH:mm:ss.sssZ';\n","/*\n The MIT License\n\n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport isEmpty from 'lodash/isEmpty';\nimport startCase from 'lodash/startCase';\nimport keys from 'lodash/keys';\nimport {\n ControlElement,\n isGroup,\n isLayout,\n JsonSchema,\n LabelElement,\n Layout,\n UISchemaElement,\n} from '../models';\nimport { deriveTypes, encode, resolveSchema } from '../util';\n\n/**\n * Creates a new ILayout.\n * @param layoutType The type of the laoyut\n * @returns the new ILayout\n */\nconst createLayout = (layoutType: string): Layout => ({\n type: layoutType,\n elements: [],\n});\n\n/**\n * Creates a IControlObject with the given label referencing the given ref\n */\nexport const createControlElement = (ref: string): ControlElement => ({\n type: 'Control',\n scope: ref,\n});\n\n/**\n * Wraps the given {@code uiSchema} in a Layout if there is none already.\n * @param uischema The ui schema to wrap in a layout.\n * @param layoutType The type of the layout to create.\n * @returns the wrapped uiSchema.\n */\nconst wrapInLayoutIfNecessary = (\n uischema: UISchemaElement,\n layoutType: string\n): Layout => {\n if (!isEmpty(uischema) && !isLayout(uischema)) {\n const verticalLayout: Layout = createLayout(layoutType);\n verticalLayout.elements.push(uischema);\n\n return verticalLayout;\n }\n\n return uischema as Layout;\n};\n\n/**\n * Adds the given {@code labelName} to the {@code layout} if it exists\n * @param layout\n * The layout which is to receive the label\n * @param labelName\n * The name of the schema\n */\nconst addLabel = (layout: Layout, labelName: string) => {\n if (!isEmpty(labelName)) {\n const fixedLabel = startCase(labelName);\n if (isGroup(layout)) {\n layout.label = fixedLabel;\n } else {\n // add label with name\n const label: LabelElement = {\n type: 'Label',\n text: fixedLabel,\n };\n layout.elements.push(label);\n }\n }\n};\n\n/**\n * Returns whether the given {@code jsonSchema} is a combinator ({@code oneOf}, {@code anyOf}, {@code allOf}) at the root level\n * @param jsonSchema\n * the schema to check\n */\nconst isCombinator = (jsonSchema: JsonSchema): boolean => {\n return (\n !isEmpty(jsonSchema) &&\n (!isEmpty(jsonSchema.oneOf) ||\n !isEmpty(jsonSchema.anyOf) ||\n !isEmpty(jsonSchema.allOf))\n );\n};\n\nconst generateUISchema = (\n jsonSchema: JsonSchema,\n schemaElements: UISchemaElement[],\n currentRef: string,\n schemaName: string,\n layoutType: string,\n rootSchema?: JsonSchema\n): UISchemaElement => {\n if (!isEmpty(jsonSchema) && jsonSchema.$ref !== undefined) {\n return generateUISchema(\n resolveSchema(rootSchema, jsonSchema.$ref, rootSchema),\n schemaElements,\n currentRef,\n schemaName,\n layoutType,\n rootSchema\n );\n }\n\n if (isCombinator(jsonSchema)) {\n const controlObject: ControlElement = createControlElement(currentRef);\n schemaElements.push(controlObject);\n\n return controlObject;\n }\n\n const types = deriveTypes(jsonSchema);\n if (types.length === 0) {\n return null;\n }\n\n if (types.length > 1) {\n const controlObject: ControlElement = createControlElement(currentRef);\n schemaElements.push(controlObject);\n return controlObject;\n }\n\n if (currentRef === '#' && types[0] === 'object') {\n const layout: Layout = createLayout(layoutType);\n schemaElements.push(layout);\n\n if (jsonSchema.properties && keys(jsonSchema.properties).length > 1) {\n addLabel(layout, schemaName);\n }\n\n if (!isEmpty(jsonSchema.properties)) {\n // traverse properties\n const nextRef: string = currentRef + '/properties';\n Object.keys(jsonSchema.properties).map((propName) => {\n let value = jsonSchema.properties[propName];\n const ref = `${nextRef}/${encode(propName)}`;\n if (value.$ref !== undefined) {\n value = resolveSchema(rootSchema, value.$ref, rootSchema);\n }\n generateUISchema(\n value,\n layout.elements,\n ref,\n propName,\n layoutType,\n rootSchema\n );\n });\n }\n\n return layout;\n }\n\n switch (types[0]) {\n case 'object': // object items will be handled by the object control itself\n /* falls through */\n case 'array': // array items will be handled by the array control itself\n /* falls through */\n case 'string':\n /* falls through */\n case 'number':\n /* falls through */\n case 'integer':\n /* falls through */\n case 'null':\n /* falls through */\n case 'boolean': {\n const controlObject: ControlElement = createControlElement(currentRef);\n schemaElements.push(controlObject);\n\n return controlObject;\n }\n default:\n throw new Error('Unknown type: ' + JSON.stringify(jsonSchema));\n }\n};\n\n/**\n * Generate a default UI schema.\n * @param {JsonSchema} jsonSchema the JSON schema to generated a UI schema for\n * @param {string} layoutType the desired layout type for the root layout\n * of the generated UI schema\n */\nexport const generateDefaultUISchema = (\n jsonSchema: JsonSchema,\n layoutType = 'VerticalLayout',\n prefix = '#',\n rootSchema = jsonSchema\n): UISchemaElement =>\n wrapInLayoutIfNecessary(\n generateUISchema(jsonSchema, [], prefix, '', layoutType, rootSchema),\n layoutType\n );\n","/*\n The MIT License\n \n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport { generateJsonSchema } from './schema';\nimport { createControlElement, generateDefaultUISchema } from './uischema';\nimport type { ControlElement, JsonSchema, UISchemaElement } from '../';\n\nexport const Generate: {\n // TODO fix @typescript-eslint/ban-types\n // eslint-disable-next-line @typescript-eslint/ban-types\n jsonSchema(instance: Object, options?: any): JsonSchema;\n uiSchema(\n jsonSchema: JsonSchema,\n layoutType?: string,\n prefix?: string,\n rootSchema?: JsonSchema\n ): UISchemaElement;\n controlElement(ref: string): ControlElement;\n} = {\n jsonSchema: generateJsonSchema,\n uiSchema: generateDefaultUISchema,\n controlElement: createControlElement,\n};\n","/*\n The MIT License\n \n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport type AJV from 'ajv';\nimport type { ErrorObject } from 'ajv';\nimport type { JsonSchema, UISchemaElement } from '../models';\nimport { generateDefaultUISchema, generateJsonSchema } from '../generators';\n\nimport type { RankedTester } from '../testers';\nimport type { UISchemaTester, ValidationMode } from '../reducers';\nimport type { ErrorTranslator, Translator } from '../i18n';\n\nexport const INIT = 'jsonforms/INIT' as const;\nexport const UPDATE_CORE = 'jsonforms/UPDATE_CORE' as const;\nexport const SET_AJV = 'jsonforms/SET_AJV' as const;\nexport const UPDATE_DATA = 'jsonforms/UPDATE' as const;\nexport const UPDATE_ERRORS = 'jsonforms/UPDATE_ERRORS' as const;\nexport const VALIDATE = 'jsonforms/VALIDATE' as const;\nexport const ADD_RENDERER = 'jsonforms/ADD_RENDERER' as const;\nexport const REMOVE_RENDERER = 'jsonforms/REMOVE_RENDERER' as const;\nexport const ADD_CELL = 'jsonforms/ADD_CELL' as const;\nexport const REMOVE_CELL = 'jsonforms/REMOVE_CELL' as const;\nexport const SET_CONFIG = 'jsonforms/SET_CONFIG' as const;\nexport const ADD_UI_SCHEMA = 'jsonforms/ADD_UI_SCHEMA' as const;\nexport const REMOVE_UI_SCHEMA = 'jsonforms/REMOVE_UI_SCHEMA' as const;\nexport const SET_SCHEMA = 'jsonforms/SET_SCHEMA' as const;\nexport const SET_UISCHEMA = 'jsonforms/SET_UISCHEMA' as const;\nexport const SET_VALIDATION_MODE = 'jsonforms/SET_VALIDATION_MODE' as const;\n\nexport const SET_LOCALE = 'jsonforms/SET_LOCALE' as const;\nexport const SET_TRANSLATOR = 'jsonforms/SET_TRANSLATOR' as const;\nexport const UPDATE_I18N = 'jsonforms/UPDATE_I18N' as const;\n\nexport const ADD_DEFAULT_DATA = 'jsonforms/ADD_DEFAULT_DATA' as const;\nexport const REMOVE_DEFAULT_DATA = 'jsonforms/REMOVE_DEFAULT_DATA' as const;\n\nexport type CoreActions =\n | InitAction\n | UpdateCoreAction\n | UpdateAction\n | UpdateErrorsAction\n | SetAjvAction\n | SetSchemaAction\n | SetUISchemaAction\n | SetValidationModeAction;\n\nexport interface UpdateAction {\n type: 'jsonforms/UPDATE';\n path: string;\n updater(existingData?: any): any;\n}\n\nexport interface UpdateErrorsAction {\n type: 'jsonforms/UPDATE_ERRORS';\n errors: ErrorObject[];\n}\n\nexport interface InitAction {\n type: 'jsonforms/INIT';\n data: any;\n schema: JsonSchema;\n uischema: UISchemaElement;\n options?: InitActionOptions | AJV;\n}\n\nexport interface UpdateCoreAction {\n type: 'jsonforms/UPDATE_CORE';\n data?: any;\n schema?: JsonSchema;\n uischema?: UISchemaElement;\n options?: InitActionOptions | AJV;\n}\n\nexport interface InitActionOptions {\n ajv?: AJV;\n validationMode?: ValidationMode;\n additionalErrors?: ErrorObject[];\n}\n\nexport interface SetValidationModeAction {\n type: 'jsonforms/SET_VALIDATION_MODE';\n validationMode: ValidationMode;\n}\n\nexport const init = (\n data: any,\n schema: JsonSchema = generateJsonSchema(data),\n uischema?: UISchemaElement,\n options?: InitActionOptions | AJV\n) => ({\n type: INIT,\n data,\n schema,\n uischema:\n typeof uischema === 'object' ? uischema : generateDefaultUISchema(schema),\n options,\n});\n\nexport const updateCore = (\n data: any,\n schema: JsonSchema,\n uischema?: UISchemaElement,\n options?: AJV | InitActionOptions\n): UpdateCoreAction => ({\n type: UPDATE_CORE,\n data,\n schema,\n uischema,\n options,\n});\n\nexport interface RegisterDefaultDataAction {\n type: 'jsonforms/ADD_DEFAULT_DATA';\n schemaPath: string;\n data: any;\n}\n\nexport const registerDefaultData = (schemaPath: string, data: any) => ({\n type: ADD_DEFAULT_DATA,\n schemaPath,\n data,\n});\n\nexport interface UnregisterDefaultDataAction {\n type: 'jsonforms/REMOVE_DEFAULT_DATA';\n schemaPath: string;\n}\n\nexport const unregisterDefaultData = (schemaPath: string) => ({\n type: REMOVE_DEFAULT_DATA,\n schemaPath,\n});\n\nexport interface SetAjvAction {\n type: 'jsonforms/SET_AJV';\n ajv: AJV;\n}\n\nexport const setAjv = (ajv: AJV) => ({\n type: SET_AJV,\n ajv,\n});\n\nexport const update = (\n path: string,\n updater: (existingData: any) => any\n): UpdateAction => ({\n type: UPDATE_DATA,\n path,\n updater,\n});\n\nexport const updateErrors = (errors: ErrorObject[]): UpdateErrorsAction => ({\n type: UPDATE_ERRORS,\n errors,\n});\n\nexport interface AddRendererAction {\n type: 'jsonforms/ADD_RENDERER';\n tester: RankedTester;\n renderer: any;\n}\n\nexport const registerRenderer = (tester: RankedTester, renderer: any) => ({\n type: ADD_RENDERER,\n tester,\n renderer,\n});\n\nexport interface AddCellRendererAction {\n type: 'jsonforms/ADD_CELL';\n tester: RankedTester;\n cell: any;\n}\n\nexport const registerCell = (tester: RankedTester, cell: any) => ({\n type: ADD_CELL,\n tester,\n cell,\n});\n\nexport interface RemoveCellRendererAction {\n type: 'jsonforms/REMOVE_CELL';\n tester: RankedTester;\n cell: any;\n}\n\nexport const unregisterCell = (tester: RankedTester, cell: any) => ({\n type: REMOVE_CELL,\n tester,\n cell,\n});\n\nexport interface RemoveRendererAction {\n type: 'jsonforms/REMOVE_RENDERER';\n tester: RankedTester;\n renderer: any;\n}\n\nexport const unregisterRenderer = (tester: RankedTester, renderer: any) => ({\n type: REMOVE_RENDERER,\n tester,\n renderer,\n});\n\nexport interface SetConfigAction {\n type: 'jsonforms/SET_CONFIG';\n config: any;\n}\n\nexport const setConfig = (config: any): SetConfigAction => ({\n type: SET_CONFIG,\n config,\n});\n\nexport const setValidationMode = (\n validationMode: ValidationMode\n): SetValidationModeAction => ({\n type: SET_VALIDATION_MODE,\n validationMode,\n});\n\nexport type UISchemaActions = AddUISchemaAction | RemoveUISchemaAction;\n\nexport interface AddUISchemaAction {\n type: 'jsonforms/ADD_UI_SCHEMA';\n tester: UISchemaTester;\n uischema: UISchemaElement;\n}\n\nexport const registerUISchema = (\n tester: UISchemaTester,\n uischema: UISchemaElement\n): AddUISchemaAction => {\n return {\n type: ADD_UI_SCHEMA,\n tester,\n uischema,\n };\n};\n\nexport interface RemoveUISchemaAction {\n type: 'jsonforms/REMOVE_UI_SCHEMA';\n tester: UISchemaTester;\n}\n\nexport const unregisterUISchema = (\n tester: UISchemaTester\n): RemoveUISchemaAction => {\n return {\n type: REMOVE_UI_SCHEMA,\n tester,\n };\n};\n\nexport type I18nActions =\n | SetLocaleAction\n | SetTranslatorAction\n | UpdateI18nAction;\n\nexport interface SetLocaleAction {\n type: 'jsonforms/SET_LOCALE';\n locale: string | undefined;\n}\n\nexport const setLocale = (locale: string | undefined): SetLocaleAction => ({\n type: SET_LOCALE,\n locale,\n});\n\nexport interface SetSchemaAction {\n type: 'jsonforms/SET_SCHEMA';\n schema: JsonSchema;\n}\n\nexport const setSchema = (schema: JsonSchema): SetSchemaAction => ({\n type: SET_SCHEMA,\n schema,\n});\n\nexport interface SetTranslatorAction {\n type: 'jsonforms/SET_TRANSLATOR';\n translator?: Translator;\n errorTranslator?: ErrorTranslator;\n}\n\nexport const setTranslator = (\n translator?: Translator,\n errorTranslator?: ErrorTranslator\n): SetTranslatorAction => ({\n type: SET_TRANSLATOR,\n translator,\n errorTranslator,\n});\n\nexport interface UpdateI18nAction {\n type: 'jsonforms/UPDATE_I18N';\n locale: string | undefined;\n translator: Translator | undefined;\n errorTranslator: ErrorTranslator | undefined;\n}\n\nexport const updateI18n = (\n locale: string | undefined,\n translator: Translator | undefined,\n errorTranslator: ErrorTranslator | undefined\n): UpdateI18nAction => ({\n type: UPDATE_I18N,\n locale,\n translator,\n errorTranslator,\n});\n\nexport interface SetUISchemaAction {\n type: 'jsonforms/SET_UISCHEMA';\n uischema: UISchemaElement;\n}\n\nexport const setUISchema = (uischema: UISchemaElement): SetUISchemaAction => ({\n type: SET_UISCHEMA,\n uischema,\n});\n","/*\n The MIT License\n \n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\nimport { convertToValidClassName, createLabelDescriptionFrom } from './util';\nimport type { ControlElement, JsonSchema, LabelDescription } from './models';\n\nexport const Helpers: {\n createLabelDescriptionFrom(\n withLabel: ControlElement,\n schema: JsonSchema\n ): LabelDescription;\n convertToValidClassName(s: string): string;\n} = {\n createLabelDescriptionFrom,\n convertToValidClassName,\n};\n"],"names":["isObjectSchema","evaluateCondition","composePaths"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,MAAM,qBAAqB,GAAG,sBAAsB,CAAC;AACrD,MAAM,mBAAmB,GAAG,UAAU,CAAC;AAIvC,MAAM,QAAQ,GAAG,CACf,UAAiB,EACjB,aAAoC,KACnB;IACjB,MAAM,KAAK,GAAoC,EAAE,CAAC;AAElD,IAAA,OAAO,UAAU,CAAC,MAAM,CAAC,CAAC,IAAI,KAAI;AAChC,QAAA,MAAM,kBAAkB,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC;AAC/C,QAAA,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,KAAK,EAAE,kBAAkB,CAAC,EAAE;AACnE,YAAA,OAAO,KAAK,CAAC;AACd,SAAA;AAAM,aAAA;AACL,YAAA,KAAK,CAAC,kBAAkB,CAAC,GAAG,IAAI,CAAC;AACjC,YAAA,OAAO,IAAI,CAAC;AACb,SAAA;AACH,KAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,MAAM,GAAG,CAAA;AACP,IAAA,WAAA,CACU,UAA8D,EAAA;QAA9D,IAAU,CAAA,UAAA,GAAV,UAAU,CAAoD;AAKxE,QAAA,IAAA,CAAA,YAAY,GAAG,CAAC,IAAY,KAAiB;YAC3C,MAAM,KAAK,GAAe,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;AAChD,YAAA,MAAM,MAAM,GAAgB;AAC1B,gBAAA,IAAI,EAAE,QAAQ;AACd,gBAAA,UAAU,EAAE,KAAK;gBACjB,oBAAoB,EAAE,IAAI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AA0B,EAC1B,UAAkC,EAClC,eAA4C,MACtB;AACtB,IAAA,IAAI,EAAE,WAAW;IACjB,MAAM;IACN,UAAU;IACV,eAAe;AAChB,CAAA,EAAE;MAOU,WAAW,GAAG,CAAC,QAAyB,MAAyB;AAC5E,IAAA,IAAI,EAAE,YAAY;IAClB,QAAQ;AACT,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC3TY,MAAA,OAAO,GAMhB;IACF,0BAA0B;IAC1B,uBAAuB;;;;;"} \ No newline at end of file diff --git a/packages/core/src/util/renderer.ts b/packages/core/src/util/renderer.ts index 222ba64507..6cd76d8518 100644 --- a/packages/core/src/util/renderer.ts +++ b/packages/core/src/util/renderer.ts @@ -60,7 +60,7 @@ import type { CombinatorKeyword } from './combinators'; import { moveDown, moveUp } from './array'; import type { AnyAction, Dispatch } from './type'; import { Resolve, convertDateToString, hasType } from './util'; -import { composePaths, composeWithUi, toDataPath } from './path'; +import { composePaths, composeWithUi } from './path'; import { CoreActions, update } from '../actions'; import type { ErrorObject } from 'ajv'; import type { JsonFormsState } from '../store'; @@ -87,6 +87,21 @@ import has from 'lodash/has'; import any from 'lodash/fp/any'; import all from 'lodash/fp/all'; +const dataPathToJsonPointer = (dataPath: string): string => { + const parts = dataPath.split('.'); + let jsonPointer = '#'; + + parts.forEach((part) => { + if (part.match(/^\d+$/)) { + jsonPointer += '/items'; + } else { + jsonPointer += `/properties/${part}`; + } + }); + + return jsonPointer; +}; + const checkDataCondition = ( propertyCondition: unknown, property: string, @@ -130,7 +145,7 @@ const checkPropertyCondition = ( ); } - if (has(propertiesCondition[property], 'properties')) { + if (has(propertiesCondition[property], 'properties') && has(data, property)) { const nextPropertyConditions = get( propertiesCondition[property], 'properties' @@ -215,7 +230,7 @@ const evaluateCondition = ( }; /** - * Go through parent's properties untill the segment is found at the exact level it is defined and check if it is required + * Go through parent's properties until the segment is found at the exact level it is defined and check if it is required */ const extractRequired = ( schema: JsonSchema, @@ -226,10 +241,14 @@ const extractRequired = ( let currentSchema = schema; while ( i < prevSegments.length && - has(currentSchema, 'properties') && - has(get(currentSchema, 'properties'), prevSegments[i]) + (has(currentSchema, prevSegments[i]) || + (has(currentSchema, 'properties') && + has(get(currentSchema, 'properties'), prevSegments[i]))) ) { - currentSchema = get(get(currentSchema, 'properties'), prevSegments[i]); + if (has(currentSchema, 'properties')) { + currentSchema = get(currentSchema, 'properties'); + } + currentSchema = get(currentSchema, prevSegments[i]); ++i; } @@ -310,37 +329,49 @@ const conditionallyRequired = ( }, nestedAllOfSchema); }; +const getNextHigherSchemaPath = (schemaPath: string): string => { + const pathSegments = schemaPath.split('/'); + const lastSegment = pathSegments[pathSegments.length - 1]; + + // We'd normally jump two segments back, but if we're in an `items` key, we want to check its parent + // Example path: '#/properties/anotherObject/properties/myArray/items/properties/propertyName' + const nextHigherSegmentIndexDifference = lastSegment === 'items' ? 1 : 2; + const nextHigherSchemaSegments = pathSegments.slice( + 0, + pathSegments.length - nextHigherSegmentIndexDifference + ); + + return nextHigherSchemaSegments.join('/'); +}; + +const getNextHigherDataPath = (dataPath: string): string => { + const dataPathSegments = dataPath.split('.'); + return dataPathSegments.slice(0, dataPathSegments.length - 1).join('.'); +}; + /** * Check if property is being required in the parent schema */ const isRequiredInParent = ( schema: JsonSchema, - rootSchema: JsonSchema, - path: string, + schemaPath: string, segment: string, prevSegments: string[], - data: Record + data: Record, + dataPath: string ): boolean => { - const pathSegments = path.split('/'); - const lastSegment = pathSegments[pathSegments.length - 3]; - const nextHigherSchemaSegments = pathSegments.slice( - 0, - pathSegments.length - 4 - ); + const pathSegments = schemaPath.split('/'); + const lastSegment = pathSegments[pathSegments.length - 1]; + const nextHigherSchemaPath = getNextHigherSchemaPath(schemaPath); - if (!nextHigherSchemaSegments.length) { + if (!nextHigherSchemaPath) { return false; } - const nextHigherSchemaPath = nextHigherSchemaSegments.join('/'); + const nextHigherSchema = Resolve.schema(schema, nextHigherSchemaPath, schema); - const nextHigherSchema = Resolve.schema( - schema, - nextHigherSchemaPath, - rootSchema - ); - - const currentData = Resolve.data(data, toDataPath(nextHigherSchemaPath)); + const nextHigherDataPath = getNextHigherDataPath(dataPath); + const currentData = Resolve.data(data, nextHigherDataPath); return ( conditionallyRequired( @@ -356,26 +387,38 @@ const isRequiredInParent = ( [lastSegment, ...prevSegments], currentData )) || + // TODO: Were we previously skipping each other parent + // when calling `isRequiredInParent` recursively (because of + // the `slice` call with (pathSegments.length - 4) - hence going + // back two times on each call) isRequiredInParent( schema, - rootSchema, nextHigherSchemaPath, segment, [lastSegment, ...prevSegments], - currentData + // TODO: Why was this currentData? + data, + nextHigherDataPath ) ); }; +const isRequiredInSchema = (schema: JsonSchema, segment: string): boolean => { + return ( + schema !== undefined && + schema.required !== undefined && + schema.required.indexOf(segment) !== -1 + ); +}; + const isRequired = ( schema: JsonSchema, schemaPath: string, - rootSchema: JsonSchema, - data: any, - config: any + rootSchema: JsonSchema ): boolean => { const pathSegments = schemaPath.split('/'); const lastSegment = pathSegments[pathSegments.length - 1]; + // TODO: This does not work correctly with "items" in the schemaPath // Skip "properties", "items" etc. to resolve the parent const nextHigherSchemaSegments = pathSegments.slice( 0, @@ -387,15 +430,32 @@ const isRequired = ( nextHigherSchemaPath, rootSchema ); - const currentData = Resolve.data(data, toDataPath(nextHigherSchemaPath)); + return isRequiredInSchema(nextHigherSchema, lastSegment); +}; - if (!config?.allowDynamicCheck) { - return ( - nextHigherSchema !== undefined && - nextHigherSchema.required !== undefined && - nextHigherSchema.required.indexOf(lastSegment) !== -1 - ); - } +// TODO: This may now be combinable with `isRequiredInParent` in a +// single function +const isConditionallyRequired = ( + rootSchema: JsonSchema, + schemaPath: string, + data: any, + dataPath: string +): boolean => { + const pathSegments = schemaPath.split('/'); + const lastSegment = pathSegments[pathSegments.length - 1]; + + const nextHigherSchemaPath = getNextHigherSchemaPath(schemaPath); + const nextHigherSchema = Resolve.schema( + rootSchema, + nextHigherSchemaPath, + rootSchema + ); + + // We need the `dataPath` to be able to resolve data in arrays, + // for example `myObject.myArray.0.myProperty` has no + // equivalent for the index in the schema syntax + const nextHigherDataPath = getNextHigherDataPath(dataPath); + const currentData = Resolve.data(data, nextHigherDataPath); const requiredInIf = has(nextHigherSchema, 'if') && @@ -410,21 +470,15 @@ const isRequired = ( const requiredConditionallyInParent = isRequiredInParent( rootSchema, - rootSchema, - schemaPath, + // TODO: Why was this previously schemaPath + nextHigherSchemaPath, lastSegment, [], - data + data, + nextHigherDataPath ); - return ( - (nextHigherSchema !== undefined && - nextHigherSchema.required !== undefined && - nextHigherSchema.required.indexOf(lastSegment) !== -1) || - requiredInIf || - requiredConditionally || - requiredConditionallyInParent - ); + return requiredInIf || requiredConditionally || requiredConditionallyInParent; }; /** @@ -821,12 +875,17 @@ export const mapStateToControlProps = ( const config = getConfig(state); const required = controlElement.scope !== undefined && - isRequired( - ownProps.schema, - controlElement.scope, - rootSchema, - rootData, - config + !!( + isRequired(ownProps.schema, controlElement.scope, rootSchema) || + // IMPORTANT: The config.allowDynamicCheck condition was removed here, + // because this makes it more convenient to use in the author's specific + // usecase. Do not commit this to the json-forms origin repo. + isConditionallyRequired( + rootSchema, + dataPathToJsonPointer(path), + rootData, + path + ) ); const resolvedSchema = Resolve.schema( ownProps.schema || rootSchema, diff --git a/packages/core/test/util/renderer.test.ts b/packages/core/test/util/renderer.test.ts index c27af95292..0fe58d0348 100644 --- a/packages/core/test/util/renderer.test.ts +++ b/packages/core/test/util/renderer.test.ts @@ -446,52 +446,6 @@ test('mapStateToControlProps - id', (t) => { t.is(props.id, '#/properties/firstName'); }); -test('mapStateToControlProps - required not checked dynamically if not explicitly specified in config', (t) => { - const schema = { - type: 'object', - properties: { - notifications: { type: 'boolean' }, - firstName: { type: 'string' }, - }, - required: ['notifications'], - if: { - properties: { - notifications: { const: true }, - }, - }, - then: { - required: ['firstName'], - }, - }; - - const ownProps: OwnPropsOfControl = { - uischema: coreUISchema, - schema, - }; - - const createState = (data: { - notifications: boolean; - firstName: string; - }) => ({ - jsonforms: { - core: { - schema, - uischema: coreUISchema, - data, - errors: [] as ErrorObject[], - }, - }, - }); - - const stateTrue = createState({ notifications: true, firstName: 'Bart' }); - const stateFalse = createState({ notifications: false, firstName: 'Bart' }); - - const propsTrue = mapStateToControlProps(stateTrue, ownProps); - const propsFalse = mapStateToControlProps(stateFalse, ownProps); - t.false(propsTrue.required); - t.false(propsFalse.required); -}); - test('mapStateToControlProps - required with dynamic check based on single condition', (t) => { const schema = { type: 'object',