@limetech/lime-elements 35.0.0-next.24 → 35.0.0-next.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{checkbox.template-7f83d0b4.js → checkbox.template-7e3fd86a.js} +3 -1
- package/dist/cjs/lime-elements.cjs.js +1 -1
- package/dist/cjs/limel-checkbox.cjs.entry.js +6 -5
- package/dist/cjs/limel-form.cjs.entry.js +293 -107
- package/dist/cjs/limel-list_3.cjs.entry.js +2 -2
- package/dist/cjs/limel-menu-list.cjs.entry.js +1 -1
- package/dist/cjs/limel-table.cjs.entry.js +17 -6
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/checkbox/checkbox.css +24 -1
- package/dist/collection/components/checkbox/checkbox.js +5 -4
- package/dist/collection/components/checkbox/checkbox.template.js +3 -1
- package/dist/collection/components/form/form.js +34 -0
- package/dist/collection/components/list/list.css +25 -1
- package/dist/collection/components/menu-list/menu-list.css +25 -1
- package/dist/collection/components/table/table.js +18 -5
- package/dist/esm/{checkbox.template-f429c5b6.js → checkbox.template-e68ade4d.js} +3 -1
- package/dist/esm/lime-elements.js +1 -1
- package/dist/esm/limel-checkbox.entry.js +6 -5
- package/dist/esm/limel-form.entry.js +294 -108
- package/dist/esm/limel-list_3.entry.js +2 -2
- package/dist/esm/limel-menu-list.entry.js +1 -1
- package/dist/esm/limel-table.entry.js +17 -6
- package/dist/esm/loader.js +1 -1
- package/dist/lime-elements/lime-elements.esm.js +1 -1
- package/dist/lime-elements/p-0c5655e2.js +1 -0
- package/dist/lime-elements/p-1bacecd5.entry.js +73 -0
- package/dist/lime-elements/{p-0f6ca408.entry.js → p-2542b5a3.entry.js} +1 -1
- package/dist/lime-elements/p-2a7c3c07.entry.js +1 -0
- package/dist/lime-elements/{p-68c4e708.entry.js → p-8487c3c9.entry.js} +3 -3
- package/dist/lime-elements/p-e66816a4.entry.js +82 -0
- package/dist/types/components/checkbox/checkbox.d.ts +3 -2
- package/dist/types/components/checkbox/checkbox.template.d.ts +1 -0
- package/dist/types/components/form/form.d.ts +8 -1
- package/dist/types/components/form/form.types.d.ts +6 -0
- package/dist/types/components/table/table.d.ts +2 -0
- package/dist/types/components.d.ts +11 -3
- package/package.json +2 -2
- package/dist/lime-elements/p-3f5ba6f4.entry.js +0 -1
- package/dist/lime-elements/p-555f774c.entry.js +0 -82
- package/dist/lime-elements/p-6acee2e5.entry.js +0 -73
- package/dist/lime-elements/p-be2bd743.js +0 -1
|
@@ -3,7 +3,7 @@ import { c as createCommonjsModule, a as commonjsGlobal } from './_commonjsHelpe
|
|
|
3
3
|
import { k as keys$3, a as arrayMap$1, g as getTag$1, m as mapToArray$1, i as isBuffer, b as isTypedArray$1, c as isArguments$3, d as isPrototype$1, e as baseKeys$1, S as Set$2, s as setToArray$1, f as SetCache$1, h as cacheHas$1, j as isEqual$1 } from './isEqual-4f22635f.js';
|
|
4
4
|
import { i as isArray$2 } from './isArray-80298bc7.js';
|
|
5
5
|
import { i as isArrayLike$1 } from './isArrayLike-dd37ba9a.js';
|
|
6
|
-
import { g as getPrototype$1, t as toString$3, b as baseIteratee$1, a as get$2, p as pickBy,
|
|
6
|
+
import { g as getPrototype$1, t as toString$3, b as baseIteratee$1, a as get$2, p as pickBy, h as has$1, n as negate } from './pickBy-8a849e46.js';
|
|
7
7
|
import { b as baseAssignValue$1 } from './_assignValue-08fe10bc.js';
|
|
8
8
|
import { b as baseGetTag$1 } from './isObject-c74e273c.js';
|
|
9
9
|
import { i as isObjectLike$1 } from './isObjectLike-38996507.js';
|
|
@@ -8863,6 +8863,15 @@ function (_Component) {
|
|
|
8863
8863
|
});
|
|
8864
8864
|
}
|
|
8865
8865
|
|
|
8866
|
+
if (isMultiSelect$1(schema, rootSchema)) {
|
|
8867
|
+
// If array has enum or uniqueItems set to true, call renderMultiSelect() to render the default multiselect widget or a custom widget, if specified.
|
|
8868
|
+
return this.renderMultiSelect();
|
|
8869
|
+
}
|
|
8870
|
+
|
|
8871
|
+
if (isCustomWidget$1(uiSchema)) {
|
|
8872
|
+
return this.renderCustomWidget();
|
|
8873
|
+
}
|
|
8874
|
+
|
|
8866
8875
|
if (isFixedItems$1(schema)) {
|
|
8867
8876
|
return this.renderFixedArray();
|
|
8868
8877
|
}
|
|
@@ -8871,10 +8880,6 @@ function (_Component) {
|
|
|
8871
8880
|
return this.renderFiles();
|
|
8872
8881
|
}
|
|
8873
8882
|
|
|
8874
|
-
if (isMultiSelect$1(schema, rootSchema)) {
|
|
8875
|
-
return this.renderMultiSelect();
|
|
8876
|
-
}
|
|
8877
|
-
|
|
8878
8883
|
return this.renderNormalArray();
|
|
8879
8884
|
}
|
|
8880
8885
|
}, {
|
|
@@ -8897,6 +8902,7 @@ function (_Component) {
|
|
|
8897
8902
|
onBlur = _this$props5.onBlur,
|
|
8898
8903
|
onFocus = _this$props5.onFocus,
|
|
8899
8904
|
idPrefix = _this$props5.idPrefix,
|
|
8905
|
+
idSeparator = _this$props5.idSeparator,
|
|
8900
8906
|
rawErrors = _this$props5.rawErrors;
|
|
8901
8907
|
var title = schema.title === undefined ? name : schema.title;
|
|
8902
8908
|
var ArrayFieldTemplate = registry.ArrayFieldTemplate,
|
|
@@ -8915,7 +8921,7 @@ function (_Component) {
|
|
|
8915
8921
|
var itemSchema = retrieveSchema$1(schema.items, rootSchema, item);
|
|
8916
8922
|
var itemErrorSchema = errorSchema ? errorSchema[index] : undefined;
|
|
8917
8923
|
var itemIdPrefix = idSchema.$id + "_" + index;
|
|
8918
|
-
var itemIdSchema = toIdSchema$1(itemSchema, itemIdPrefix, rootSchema, item, idPrefix);
|
|
8924
|
+
var itemIdSchema = toIdSchema$1(itemSchema, itemIdPrefix, rootSchema, item, idPrefix, idSeparator);
|
|
8919
8925
|
return _this2.renderArrayFieldItem({
|
|
8920
8926
|
key: key,
|
|
8921
8927
|
index: index,
|
|
@@ -8952,13 +8958,12 @@ function (_Component) {
|
|
|
8952
8958
|
return react.createElement(Component, arrayProps);
|
|
8953
8959
|
}
|
|
8954
8960
|
}, {
|
|
8955
|
-
key: "
|
|
8956
|
-
value: function
|
|
8961
|
+
key: "renderCustomWidget",
|
|
8962
|
+
value: function renderCustomWidget() {
|
|
8957
8963
|
var _this$props6 = this.props,
|
|
8958
8964
|
schema = _this$props6.schema,
|
|
8959
8965
|
idSchema = _this$props6.idSchema,
|
|
8960
8966
|
uiSchema = _this$props6.uiSchema,
|
|
8961
|
-
formData = _this$props6.formData,
|
|
8962
8967
|
disabled = _this$props6.disabled,
|
|
8963
8968
|
readonly = _this$props6.readonly,
|
|
8964
8969
|
required = _this$props6.required,
|
|
@@ -8966,24 +8971,18 @@ function (_Component) {
|
|
|
8966
8971
|
autofocus = _this$props6.autofocus,
|
|
8967
8972
|
onBlur = _this$props6.onBlur,
|
|
8968
8973
|
onFocus = _this$props6.onFocus,
|
|
8974
|
+
items = _this$props6.formData,
|
|
8969
8975
|
_this$props6$registry = _this$props6.registry,
|
|
8970
8976
|
registry = _this$props6$registry === void 0 ? getDefaultRegistry$1() : _this$props6$registry,
|
|
8971
8977
|
rawErrors = _this$props6.rawErrors,
|
|
8972
8978
|
name = _this$props6.name;
|
|
8973
|
-
var items = this.props.formData;
|
|
8974
8979
|
var widgets = registry.widgets,
|
|
8975
|
-
rootSchema = registry.rootSchema,
|
|
8976
8980
|
formContext = registry.formContext;
|
|
8977
|
-
var itemsSchema = retrieveSchema$1(schema.items, rootSchema, formData);
|
|
8978
8981
|
var title = schema.title || name;
|
|
8979
|
-
var enumOptions = optionsList$1(itemsSchema);
|
|
8980
8982
|
|
|
8981
|
-
var
|
|
8982
|
-
|
|
8983
|
-
|
|
8984
|
-
_getUiOptions$enumOpt2 = _getUiOptions$enumOpt.widget,
|
|
8985
|
-
widget = _getUiOptions$enumOpt2 === void 0 ? "select" : _getUiOptions$enumOpt2,
|
|
8986
|
-
options = _objectWithoutProperties$g(_getUiOptions$enumOpt, ["widget"]);
|
|
8983
|
+
var _getUiOptions2 = _objectSpread$g({}, getUiOptions$1(uiSchema)),
|
|
8984
|
+
widget = _getUiOptions2.widget,
|
|
8985
|
+
options = _objectWithoutProperties$g(_getUiOptions2, ["widget"]);
|
|
8987
8986
|
|
|
8988
8987
|
var Widget = getWidget$1(schema, widget, widgets);
|
|
8989
8988
|
return react.createElement(Widget, {
|
|
@@ -9007,73 +9006,129 @@ function (_Component) {
|
|
|
9007
9006
|
});
|
|
9008
9007
|
}
|
|
9009
9008
|
}, {
|
|
9010
|
-
key: "
|
|
9011
|
-
value: function
|
|
9009
|
+
key: "renderMultiSelect",
|
|
9010
|
+
value: function renderMultiSelect() {
|
|
9012
9011
|
var _this$props7 = this.props,
|
|
9013
9012
|
schema = _this$props7.schema,
|
|
9014
|
-
uiSchema = _this$props7.uiSchema,
|
|
9015
9013
|
idSchema = _this$props7.idSchema,
|
|
9016
|
-
|
|
9014
|
+
uiSchema = _this$props7.uiSchema,
|
|
9015
|
+
formData = _this$props7.formData,
|
|
9017
9016
|
disabled = _this$props7.disabled,
|
|
9018
9017
|
readonly = _this$props7.readonly,
|
|
9018
|
+
required = _this$props7.required,
|
|
9019
|
+
placeholder = _this$props7.placeholder,
|
|
9019
9020
|
autofocus = _this$props7.autofocus,
|
|
9020
9021
|
onBlur = _this$props7.onBlur,
|
|
9021
9022
|
onFocus = _this$props7.onFocus,
|
|
9022
9023
|
_this$props7$registry = _this$props7.registry,
|
|
9023
9024
|
registry = _this$props7$registry === void 0 ? getDefaultRegistry$1() : _this$props7$registry,
|
|
9024
|
-
rawErrors = _this$props7.rawErrors
|
|
9025
|
-
|
|
9025
|
+
rawErrors = _this$props7.rawErrors,
|
|
9026
|
+
name = _this$props7.name;
|
|
9026
9027
|
var items = this.props.formData;
|
|
9027
9028
|
var widgets = registry.widgets,
|
|
9029
|
+
rootSchema = registry.rootSchema,
|
|
9028
9030
|
formContext = registry.formContext;
|
|
9031
|
+
var itemsSchema = retrieveSchema$1(schema.items, rootSchema, formData);
|
|
9032
|
+
var title = schema.title || name;
|
|
9033
|
+
var enumOptions = optionsList$1(itemsSchema);
|
|
9029
9034
|
|
|
9030
|
-
var
|
|
9031
|
-
|
|
9032
|
-
|
|
9033
|
-
|
|
9035
|
+
var _getUiOptions$enumOpt = _objectSpread$g({}, getUiOptions$1(uiSchema), {
|
|
9036
|
+
enumOptions: enumOptions
|
|
9037
|
+
}),
|
|
9038
|
+
_getUiOptions$enumOpt2 = _getUiOptions$enumOpt.widget,
|
|
9039
|
+
widget = _getUiOptions$enumOpt2 === void 0 ? "select" : _getUiOptions$enumOpt2,
|
|
9040
|
+
options = _objectWithoutProperties$g(_getUiOptions$enumOpt, ["widget"]);
|
|
9034
9041
|
|
|
9035
9042
|
var Widget = getWidget$1(schema, widget, widgets);
|
|
9036
9043
|
return react.createElement(Widget, {
|
|
9037
|
-
options: options,
|
|
9038
9044
|
id: idSchema && idSchema.$id,
|
|
9039
9045
|
multiple: true,
|
|
9040
9046
|
onChange: this.onSelectChange,
|
|
9041
9047
|
onBlur: onBlur,
|
|
9042
9048
|
onFocus: onFocus,
|
|
9049
|
+
options: options,
|
|
9043
9050
|
schema: schema,
|
|
9044
|
-
|
|
9051
|
+
registry: registry,
|
|
9045
9052
|
value: items,
|
|
9046
9053
|
disabled: disabled,
|
|
9047
9054
|
readonly: readonly,
|
|
9055
|
+
required: required,
|
|
9056
|
+
label: title,
|
|
9057
|
+
placeholder: placeholder,
|
|
9048
9058
|
formContext: formContext,
|
|
9049
9059
|
autofocus: autofocus,
|
|
9050
9060
|
rawErrors: rawErrors
|
|
9051
9061
|
});
|
|
9052
9062
|
}
|
|
9053
9063
|
}, {
|
|
9054
|
-
key: "
|
|
9055
|
-
value: function
|
|
9056
|
-
var _this3 = this;
|
|
9057
|
-
|
|
9064
|
+
key: "renderFiles",
|
|
9065
|
+
value: function renderFiles() {
|
|
9058
9066
|
var _this$props8 = this.props,
|
|
9059
9067
|
schema = _this$props8.schema,
|
|
9060
9068
|
uiSchema = _this$props8.uiSchema,
|
|
9061
|
-
formData = _this$props8.formData,
|
|
9062
|
-
errorSchema = _this$props8.errorSchema,
|
|
9063
|
-
idPrefix = _this$props8.idPrefix,
|
|
9064
9069
|
idSchema = _this$props8.idSchema,
|
|
9065
9070
|
name = _this$props8.name,
|
|
9066
|
-
required = _this$props8.required,
|
|
9067
9071
|
disabled = _this$props8.disabled,
|
|
9068
9072
|
readonly = _this$props8.readonly,
|
|
9069
9073
|
autofocus = _this$props8.autofocus,
|
|
9070
|
-
_this$props8$registry = _this$props8.registry,
|
|
9071
|
-
registry = _this$props8$registry === void 0 ? getDefaultRegistry$1() : _this$props8$registry,
|
|
9072
9074
|
onBlur = _this$props8.onBlur,
|
|
9073
9075
|
onFocus = _this$props8.onFocus,
|
|
9076
|
+
_this$props8$registry = _this$props8.registry,
|
|
9077
|
+
registry = _this$props8$registry === void 0 ? getDefaultRegistry$1() : _this$props8$registry,
|
|
9074
9078
|
rawErrors = _this$props8.rawErrors;
|
|
9075
9079
|
var title = schema.title || name;
|
|
9076
9080
|
var items = this.props.formData;
|
|
9081
|
+
var widgets = registry.widgets,
|
|
9082
|
+
formContext = registry.formContext;
|
|
9083
|
+
|
|
9084
|
+
var _getUiOptions3 = getUiOptions$1(uiSchema),
|
|
9085
|
+
_getUiOptions3$widget = _getUiOptions3.widget,
|
|
9086
|
+
widget = _getUiOptions3$widget === void 0 ? "files" : _getUiOptions3$widget,
|
|
9087
|
+
options = _objectWithoutProperties$g(_getUiOptions3, ["widget"]);
|
|
9088
|
+
|
|
9089
|
+
var Widget = getWidget$1(schema, widget, widgets);
|
|
9090
|
+
return react.createElement(Widget, {
|
|
9091
|
+
options: options,
|
|
9092
|
+
id: idSchema && idSchema.$id,
|
|
9093
|
+
multiple: true,
|
|
9094
|
+
onChange: this.onSelectChange,
|
|
9095
|
+
onBlur: onBlur,
|
|
9096
|
+
onFocus: onFocus,
|
|
9097
|
+
schema: schema,
|
|
9098
|
+
title: title,
|
|
9099
|
+
value: items,
|
|
9100
|
+
disabled: disabled,
|
|
9101
|
+
readonly: readonly,
|
|
9102
|
+
formContext: formContext,
|
|
9103
|
+
autofocus: autofocus,
|
|
9104
|
+
rawErrors: rawErrors
|
|
9105
|
+
});
|
|
9106
|
+
}
|
|
9107
|
+
}, {
|
|
9108
|
+
key: "renderFixedArray",
|
|
9109
|
+
value: function renderFixedArray() {
|
|
9110
|
+
var _this3 = this;
|
|
9111
|
+
|
|
9112
|
+
var _this$props9 = this.props,
|
|
9113
|
+
schema = _this$props9.schema,
|
|
9114
|
+
uiSchema = _this$props9.uiSchema,
|
|
9115
|
+
formData = _this$props9.formData,
|
|
9116
|
+
errorSchema = _this$props9.errorSchema,
|
|
9117
|
+
idPrefix = _this$props9.idPrefix,
|
|
9118
|
+
idSeparator = _this$props9.idSeparator,
|
|
9119
|
+
idSchema = _this$props9.idSchema,
|
|
9120
|
+
name = _this$props9.name,
|
|
9121
|
+
required = _this$props9.required,
|
|
9122
|
+
disabled = _this$props9.disabled,
|
|
9123
|
+
readonly = _this$props9.readonly,
|
|
9124
|
+
autofocus = _this$props9.autofocus,
|
|
9125
|
+
_this$props9$registry = _this$props9.registry,
|
|
9126
|
+
registry = _this$props9$registry === void 0 ? getDefaultRegistry$1() : _this$props9$registry,
|
|
9127
|
+
onBlur = _this$props9.onBlur,
|
|
9128
|
+
onFocus = _this$props9.onFocus,
|
|
9129
|
+
rawErrors = _this$props9.rawErrors;
|
|
9130
|
+
var title = schema.title || name;
|
|
9131
|
+
var items = this.props.formData;
|
|
9077
9132
|
var ArrayFieldTemplate = registry.ArrayFieldTemplate,
|
|
9078
9133
|
rootSchema = registry.rootSchema,
|
|
9079
9134
|
fields = registry.fields,
|
|
@@ -9103,7 +9158,7 @@ function (_Component) {
|
|
|
9103
9158
|
var additional = index >= itemSchemas.length;
|
|
9104
9159
|
var itemSchema = additional ? retrieveSchema$1(schema.additionalItems, rootSchema, item) : itemSchemas[index];
|
|
9105
9160
|
var itemIdPrefix = idSchema.$id + "_" + index;
|
|
9106
|
-
var itemIdSchema = toIdSchema$1(itemSchema, itemIdPrefix, rootSchema, item, idPrefix);
|
|
9161
|
+
var itemIdSchema = toIdSchema$1(itemSchema, itemIdPrefix, rootSchema, item, idPrefix, idSeparator);
|
|
9107
9162
|
var itemUiSchema = additional ? uiSchema.additionalItems || {} : Array.isArray(uiSchema.items) ? uiSchema.items[index] : uiSchema.items || {};
|
|
9108
9163
|
var itemErrorSchema = errorSchema ? errorSchema[index] : undefined;
|
|
9109
9164
|
return _this3.renderArrayFieldItem({
|
|
@@ -9156,12 +9211,12 @@ function (_Component) {
|
|
|
9156
9211
|
onBlur = props.onBlur,
|
|
9157
9212
|
onFocus = props.onFocus,
|
|
9158
9213
|
rawErrors = props.rawErrors;
|
|
9159
|
-
var _this$
|
|
9160
|
-
disabled = _this$
|
|
9161
|
-
readonly = _this$
|
|
9162
|
-
uiSchema = _this$
|
|
9163
|
-
_this$
|
|
9164
|
-
registry = _this$
|
|
9214
|
+
var _this$props10 = this.props,
|
|
9215
|
+
disabled = _this$props10.disabled,
|
|
9216
|
+
readonly = _this$props10.readonly,
|
|
9217
|
+
uiSchema = _this$props10.uiSchema,
|
|
9218
|
+
_this$props10$registr = _this$props10.registry,
|
|
9219
|
+
registry = _this$props10$registr === void 0 ? getDefaultRegistry$1() : _this$props10$registr;
|
|
9165
9220
|
var SchemaField = registry.fields.SchemaField;
|
|
9166
9221
|
|
|
9167
9222
|
var _orderable$removable$ = _objectSpread$g({
|
|
@@ -9501,6 +9556,7 @@ function (_Component) {
|
|
|
9501
9556
|
errorSchema = _this$props3.errorSchema,
|
|
9502
9557
|
formData = _this$props3.formData,
|
|
9503
9558
|
idPrefix = _this$props3.idPrefix,
|
|
9559
|
+
idSeparator = _this$props3.idSeparator,
|
|
9504
9560
|
idSchema = _this$props3.idSchema,
|
|
9505
9561
|
onBlur = _this$props3.onBlur,
|
|
9506
9562
|
onChange = _this$props3.onChange,
|
|
@@ -9561,6 +9617,7 @@ function (_Component) {
|
|
|
9561
9617
|
errorSchema: errorSchema,
|
|
9562
9618
|
idSchema: idSchema,
|
|
9563
9619
|
idPrefix: idPrefix,
|
|
9620
|
+
idSeparator: idSeparator,
|
|
9564
9621
|
formData: formData,
|
|
9565
9622
|
onChange: onChange,
|
|
9566
9623
|
onBlur: onBlur,
|
|
@@ -9931,6 +9988,7 @@ function (_Component) {
|
|
|
9931
9988
|
disabled = _this$props2.disabled,
|
|
9932
9989
|
readonly = _this$props2.readonly,
|
|
9933
9990
|
idPrefix = _this$props2.idPrefix,
|
|
9991
|
+
idSeparator = _this$props2.idSeparator,
|
|
9934
9992
|
onBlur = _this$props2.onBlur,
|
|
9935
9993
|
onFocus = _this$props2.onFocus,
|
|
9936
9994
|
_this$props2$registry = _this$props2.registry,
|
|
@@ -9978,6 +10036,7 @@ function (_Component) {
|
|
|
9978
10036
|
errorSchema: errorSchema[name],
|
|
9979
10037
|
idSchema: idSchema[name],
|
|
9980
10038
|
idPrefix: idPrefix,
|
|
10039
|
+
idSeparator: idSeparator,
|
|
9981
10040
|
formData: (formData || {})[name],
|
|
9982
10041
|
wasPropertyKeyModified: _this2.state.wasPropertyKeyModified,
|
|
9983
10042
|
onKeyChange: _this2.onKeyChange(name),
|
|
@@ -10256,6 +10315,7 @@ function SchemaFieldRender$1(props) {
|
|
|
10256
10315
|
formData = props.formData,
|
|
10257
10316
|
errorSchema = props.errorSchema,
|
|
10258
10317
|
idPrefix = props.idPrefix,
|
|
10318
|
+
idSeparator = props.idSeparator,
|
|
10259
10319
|
name = props.name,
|
|
10260
10320
|
onChange = props.onChange,
|
|
10261
10321
|
onKeyChange = props.onKeyChange,
|
|
@@ -10271,7 +10331,7 @@ function SchemaFieldRender$1(props) {
|
|
|
10271
10331
|
var FieldTemplate = uiSchema["ui:FieldTemplate"] || registry.FieldTemplate || DefaultTemplate$1;
|
|
10272
10332
|
var idSchema = props.idSchema;
|
|
10273
10333
|
var schema = retrieveSchema$1(props.schema, rootSchema, formData);
|
|
10274
|
-
idSchema = mergeObjects$1(toIdSchema$1(schema, null, rootSchema, formData, idPrefix), idSchema);
|
|
10334
|
+
idSchema = mergeObjects$1(toIdSchema$1(schema, null, rootSchema, formData, idPrefix, idSeparator), idSchema);
|
|
10275
10335
|
var FieldComponent = getFieldComponent$1(schema, uiSchema, idSchema, fields);
|
|
10276
10336
|
var DescriptionField = fields.DescriptionField;
|
|
10277
10337
|
var disabled = Boolean(props.disabled || uiSchema["ui:disabled"]);
|
|
@@ -19393,7 +19453,7 @@ function getDisplayLabel$1(schema, uiSchema, rootSchema) {
|
|
|
19393
19453
|
var schemaType = getSchemaType$1(schema);
|
|
19394
19454
|
|
|
19395
19455
|
if (schemaType === "array") {
|
|
19396
|
-
displayLabel = isMultiSelect$1(schema, rootSchema) || isFilesArray$1(schema, uiSchema, rootSchema);
|
|
19456
|
+
displayLabel = isMultiSelect$1(schema, rootSchema) || isFilesArray$1(schema, uiSchema, rootSchema) || isCustomWidget$1(uiSchema);
|
|
19397
19457
|
}
|
|
19398
19458
|
|
|
19399
19459
|
if (schemaType === "object") {
|
|
@@ -19570,6 +19630,12 @@ function isFixedItems$1(schema) {
|
|
|
19570
19630
|
return isObject$1(item);
|
|
19571
19631
|
});
|
|
19572
19632
|
}
|
|
19633
|
+
function isCustomWidget$1(uiSchema) {
|
|
19634
|
+
return (// TODO: Remove the `&& uiSchema["ui:widget"] !== "hidden"` once we support hidden widgets for arrays.
|
|
19635
|
+
// https://react-jsonschema-form.readthedocs.io/en/latest/usage/widgets/#hidden-widgets
|
|
19636
|
+
"widget" in getUiOptions$1(uiSchema) && getUiOptions$1(uiSchema)["widget"] !== "hidden"
|
|
19637
|
+
);
|
|
19638
|
+
}
|
|
19573
19639
|
function allowAdditionalItems$1(schema) {
|
|
19574
19640
|
if (schema.additionalItems === true) {
|
|
19575
19641
|
console.warn("additionalItems=true is currently not supported");
|
|
@@ -19972,6 +20038,7 @@ function shouldRender$1(comp, nextProps, nextState) {
|
|
|
19972
20038
|
function toIdSchema$1(schema, id, rootSchema) {
|
|
19973
20039
|
var formData = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
19974
20040
|
var idPrefix = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : "root";
|
|
20041
|
+
var idSeparator = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : "_";
|
|
19975
20042
|
var idSchema = {
|
|
19976
20043
|
$id: id || idPrefix
|
|
19977
20044
|
};
|
|
@@ -19979,11 +20046,11 @@ function toIdSchema$1(schema, id, rootSchema) {
|
|
|
19979
20046
|
if ("$ref" in schema || "dependencies" in schema || "allOf" in schema) {
|
|
19980
20047
|
var _schema = retrieveSchema$1(schema, rootSchema, formData);
|
|
19981
20048
|
|
|
19982
|
-
return toIdSchema$1(_schema, id, rootSchema, formData, idPrefix);
|
|
20049
|
+
return toIdSchema$1(_schema, id, rootSchema, formData, idPrefix, idSeparator);
|
|
19983
20050
|
}
|
|
19984
20051
|
|
|
19985
20052
|
if ("items" in schema && !schema.items.$ref) {
|
|
19986
|
-
return toIdSchema$1(schema.items, id, rootSchema, formData, idPrefix);
|
|
20053
|
+
return toIdSchema$1(schema.items, id, rootSchema, formData, idPrefix, idSeparator);
|
|
19987
20054
|
}
|
|
19988
20055
|
|
|
19989
20056
|
if (schema.type !== "object") {
|
|
@@ -19992,10 +20059,10 @@ function toIdSchema$1(schema, id, rootSchema) {
|
|
|
19992
20059
|
|
|
19993
20060
|
for (var name in schema.properties || {}) {
|
|
19994
20061
|
var field = schema.properties[name];
|
|
19995
|
-
var fieldId = idSchema.$id +
|
|
20062
|
+
var fieldId = idSchema.$id + idSeparator + name;
|
|
19996
20063
|
idSchema[name] = toIdSchema$1(isObject$1(field) ? field : {}, fieldId, rootSchema, // It's possible that formData is not an object -- this can happen if an
|
|
19997
20064
|
// array item has just been added, but not populated with data yet
|
|
19998
|
-
(formData || {})[name], idPrefix);
|
|
20065
|
+
(formData || {})[name], idPrefix, idSeparator);
|
|
19999
20066
|
}
|
|
20000
20067
|
|
|
20001
20068
|
return idSchema;
|
|
@@ -20568,7 +20635,7 @@ function (_Component) {
|
|
|
20568
20635
|
errors = toErrorList$1(errorSchema);
|
|
20569
20636
|
}
|
|
20570
20637
|
|
|
20571
|
-
var idSchema = toIdSchema$1(retrievedSchema, uiSchema["ui:rootFieldId"], rootSchema, formData, props.idPrefix);
|
|
20638
|
+
var idSchema = toIdSchema$1(retrievedSchema, uiSchema["ui:rootFieldId"], rootSchema, formData, props.idPrefix, props.idSeparator);
|
|
20572
20639
|
var nextState = {
|
|
20573
20640
|
schema: schema,
|
|
20574
20641
|
uiSchema: uiSchema,
|
|
@@ -20671,6 +20738,7 @@ function (_Component) {
|
|
|
20671
20738
|
children = _this$props5.children,
|
|
20672
20739
|
id = _this$props5.id,
|
|
20673
20740
|
idPrefix = _this$props5.idPrefix,
|
|
20741
|
+
idSeparator = _this$props5.idSeparator,
|
|
20674
20742
|
className = _this$props5.className,
|
|
20675
20743
|
tagName = _this$props5.tagName,
|
|
20676
20744
|
name = _this$props5.name,
|
|
@@ -20721,6 +20789,7 @@ function (_Component) {
|
|
|
20721
20789
|
errorSchema: errorSchema,
|
|
20722
20790
|
idSchema: idSchema,
|
|
20723
20791
|
idPrefix: idPrefix,
|
|
20792
|
+
idSeparator: idSeparator,
|
|
20724
20793
|
formContext: formContext,
|
|
20725
20794
|
formData: formData,
|
|
20726
20795
|
onChange: this.onChange,
|
|
@@ -21855,6 +21924,44 @@ function mapKeys(object, iteratee) {
|
|
|
21855
21924
|
return result;
|
|
21856
21925
|
}
|
|
21857
21926
|
|
|
21927
|
+
/**
|
|
21928
|
+
* Creates an object with the same keys as `object` and values generated
|
|
21929
|
+
* by running each own enumerable string keyed property of `object` thru
|
|
21930
|
+
* `iteratee`. The iteratee is invoked with three arguments:
|
|
21931
|
+
* (value, key, object).
|
|
21932
|
+
*
|
|
21933
|
+
* @static
|
|
21934
|
+
* @memberOf _
|
|
21935
|
+
* @since 2.4.0
|
|
21936
|
+
* @category Object
|
|
21937
|
+
* @param {Object} object The object to iterate over.
|
|
21938
|
+
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
|
|
21939
|
+
* @returns {Object} Returns the new mapped object.
|
|
21940
|
+
* @see _.mapKeys
|
|
21941
|
+
* @example
|
|
21942
|
+
*
|
|
21943
|
+
* var users = {
|
|
21944
|
+
* 'fred': { 'user': 'fred', 'age': 40 },
|
|
21945
|
+
* 'pebbles': { 'user': 'pebbles', 'age': 1 }
|
|
21946
|
+
* };
|
|
21947
|
+
*
|
|
21948
|
+
* _.mapValues(users, function(o) { return o.age; });
|
|
21949
|
+
* // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
|
|
21950
|
+
*
|
|
21951
|
+
* // The `_.property` iteratee shorthand.
|
|
21952
|
+
* _.mapValues(users, 'age');
|
|
21953
|
+
* // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
|
|
21954
|
+
*/
|
|
21955
|
+
function mapValues(object, iteratee) {
|
|
21956
|
+
var result = {};
|
|
21957
|
+
iteratee = baseIteratee$1(iteratee);
|
|
21958
|
+
|
|
21959
|
+
baseForOwn(object, function(value, key, object) {
|
|
21960
|
+
baseAssignValue$1(result, key, iteratee(value, key, object));
|
|
21961
|
+
});
|
|
21962
|
+
return result;
|
|
21963
|
+
}
|
|
21964
|
+
|
|
21858
21965
|
/** Used as references for various `Number` constants. */
|
|
21859
21966
|
var INFINITY = 1 / 0;
|
|
21860
21967
|
|
|
@@ -23166,6 +23273,15 @@ function (_Component) {
|
|
|
23166
23273
|
});
|
|
23167
23274
|
}
|
|
23168
23275
|
|
|
23276
|
+
if (isMultiSelect(schema, rootSchema)) {
|
|
23277
|
+
// If array has enum or uniqueItems set to true, call renderMultiSelect() to render the default multiselect widget or a custom widget, if specified.
|
|
23278
|
+
return this.renderMultiSelect();
|
|
23279
|
+
}
|
|
23280
|
+
|
|
23281
|
+
if (isCustomWidget(uiSchema)) {
|
|
23282
|
+
return this.renderCustomWidget();
|
|
23283
|
+
}
|
|
23284
|
+
|
|
23169
23285
|
if (isFixedItems(schema)) {
|
|
23170
23286
|
return this.renderFixedArray();
|
|
23171
23287
|
}
|
|
@@ -23174,10 +23290,6 @@ function (_Component) {
|
|
|
23174
23290
|
return this.renderFiles();
|
|
23175
23291
|
}
|
|
23176
23292
|
|
|
23177
|
-
if (isMultiSelect(schema, rootSchema)) {
|
|
23178
|
-
return this.renderMultiSelect();
|
|
23179
|
-
}
|
|
23180
|
-
|
|
23181
23293
|
return this.renderNormalArray();
|
|
23182
23294
|
}
|
|
23183
23295
|
}, {
|
|
@@ -23200,6 +23312,7 @@ function (_Component) {
|
|
|
23200
23312
|
onBlur = _this$props5.onBlur,
|
|
23201
23313
|
onFocus = _this$props5.onFocus,
|
|
23202
23314
|
idPrefix = _this$props5.idPrefix,
|
|
23315
|
+
idSeparator = _this$props5.idSeparator,
|
|
23203
23316
|
rawErrors = _this$props5.rawErrors;
|
|
23204
23317
|
var title = schema.title === undefined ? name : schema.title;
|
|
23205
23318
|
var ArrayFieldTemplate = registry.ArrayFieldTemplate,
|
|
@@ -23218,7 +23331,7 @@ function (_Component) {
|
|
|
23218
23331
|
var itemSchema = retrieveSchema(schema.items, rootSchema, item);
|
|
23219
23332
|
var itemErrorSchema = errorSchema ? errorSchema[index] : undefined;
|
|
23220
23333
|
var itemIdPrefix = idSchema.$id + "_" + index;
|
|
23221
|
-
var itemIdSchema = toIdSchema(itemSchema, itemIdPrefix, rootSchema, item, idPrefix);
|
|
23334
|
+
var itemIdSchema = toIdSchema(itemSchema, itemIdPrefix, rootSchema, item, idPrefix, idSeparator);
|
|
23222
23335
|
return _this2.renderArrayFieldItem({
|
|
23223
23336
|
key: key,
|
|
23224
23337
|
index: index,
|
|
@@ -23255,13 +23368,12 @@ function (_Component) {
|
|
|
23255
23368
|
return react.createElement(Component, arrayProps);
|
|
23256
23369
|
}
|
|
23257
23370
|
}, {
|
|
23258
|
-
key: "
|
|
23259
|
-
value: function
|
|
23371
|
+
key: "renderCustomWidget",
|
|
23372
|
+
value: function renderCustomWidget() {
|
|
23260
23373
|
var _this$props6 = this.props,
|
|
23261
23374
|
schema = _this$props6.schema,
|
|
23262
23375
|
idSchema = _this$props6.idSchema,
|
|
23263
23376
|
uiSchema = _this$props6.uiSchema,
|
|
23264
|
-
formData = _this$props6.formData,
|
|
23265
23377
|
disabled = _this$props6.disabled,
|
|
23266
23378
|
readonly = _this$props6.readonly,
|
|
23267
23379
|
required = _this$props6.required,
|
|
@@ -23269,24 +23381,18 @@ function (_Component) {
|
|
|
23269
23381
|
autofocus = _this$props6.autofocus,
|
|
23270
23382
|
onBlur = _this$props6.onBlur,
|
|
23271
23383
|
onFocus = _this$props6.onFocus,
|
|
23384
|
+
items = _this$props6.formData,
|
|
23272
23385
|
_this$props6$registry = _this$props6.registry,
|
|
23273
23386
|
registry = _this$props6$registry === void 0 ? getDefaultRegistry() : _this$props6$registry,
|
|
23274
23387
|
rawErrors = _this$props6.rawErrors,
|
|
23275
23388
|
name = _this$props6.name;
|
|
23276
|
-
var items = this.props.formData;
|
|
23277
23389
|
var widgets = registry.widgets,
|
|
23278
|
-
rootSchema = registry.rootSchema,
|
|
23279
23390
|
formContext = registry.formContext;
|
|
23280
|
-
var itemsSchema = retrieveSchema(schema.items, rootSchema, formData);
|
|
23281
23391
|
var title = schema.title || name;
|
|
23282
|
-
var enumOptions = optionsList(itemsSchema);
|
|
23283
23392
|
|
|
23284
|
-
var
|
|
23285
|
-
|
|
23286
|
-
|
|
23287
|
-
_getUiOptions$enumOpt2 = _getUiOptions$enumOpt.widget,
|
|
23288
|
-
widget = _getUiOptions$enumOpt2 === void 0 ? "select" : _getUiOptions$enumOpt2,
|
|
23289
|
-
options = _objectWithoutProperties$7(_getUiOptions$enumOpt, ["widget"]);
|
|
23393
|
+
var _getUiOptions2 = _objectSpread$7({}, getUiOptions(uiSchema)),
|
|
23394
|
+
widget = _getUiOptions2.widget,
|
|
23395
|
+
options = _objectWithoutProperties$7(_getUiOptions2, ["widget"]);
|
|
23290
23396
|
|
|
23291
23397
|
var Widget = getWidget(schema, widget, widgets);
|
|
23292
23398
|
return react.createElement(Widget, {
|
|
@@ -23310,73 +23416,129 @@ function (_Component) {
|
|
|
23310
23416
|
});
|
|
23311
23417
|
}
|
|
23312
23418
|
}, {
|
|
23313
|
-
key: "
|
|
23314
|
-
value: function
|
|
23419
|
+
key: "renderMultiSelect",
|
|
23420
|
+
value: function renderMultiSelect() {
|
|
23315
23421
|
var _this$props7 = this.props,
|
|
23316
23422
|
schema = _this$props7.schema,
|
|
23317
|
-
uiSchema = _this$props7.uiSchema,
|
|
23318
23423
|
idSchema = _this$props7.idSchema,
|
|
23319
|
-
|
|
23424
|
+
uiSchema = _this$props7.uiSchema,
|
|
23425
|
+
formData = _this$props7.formData,
|
|
23320
23426
|
disabled = _this$props7.disabled,
|
|
23321
23427
|
readonly = _this$props7.readonly,
|
|
23428
|
+
required = _this$props7.required,
|
|
23429
|
+
placeholder = _this$props7.placeholder,
|
|
23322
23430
|
autofocus = _this$props7.autofocus,
|
|
23323
23431
|
onBlur = _this$props7.onBlur,
|
|
23324
23432
|
onFocus = _this$props7.onFocus,
|
|
23325
23433
|
_this$props7$registry = _this$props7.registry,
|
|
23326
23434
|
registry = _this$props7$registry === void 0 ? getDefaultRegistry() : _this$props7$registry,
|
|
23327
|
-
rawErrors = _this$props7.rawErrors
|
|
23328
|
-
|
|
23435
|
+
rawErrors = _this$props7.rawErrors,
|
|
23436
|
+
name = _this$props7.name;
|
|
23329
23437
|
var items = this.props.formData;
|
|
23330
23438
|
var widgets = registry.widgets,
|
|
23439
|
+
rootSchema = registry.rootSchema,
|
|
23331
23440
|
formContext = registry.formContext;
|
|
23441
|
+
var itemsSchema = retrieveSchema(schema.items, rootSchema, formData);
|
|
23442
|
+
var title = schema.title || name;
|
|
23443
|
+
var enumOptions = optionsList(itemsSchema);
|
|
23332
23444
|
|
|
23333
|
-
var
|
|
23334
|
-
|
|
23335
|
-
|
|
23336
|
-
|
|
23445
|
+
var _getUiOptions$enumOpt = _objectSpread$7({}, getUiOptions(uiSchema), {
|
|
23446
|
+
enumOptions: enumOptions
|
|
23447
|
+
}),
|
|
23448
|
+
_getUiOptions$enumOpt2 = _getUiOptions$enumOpt.widget,
|
|
23449
|
+
widget = _getUiOptions$enumOpt2 === void 0 ? "select" : _getUiOptions$enumOpt2,
|
|
23450
|
+
options = _objectWithoutProperties$7(_getUiOptions$enumOpt, ["widget"]);
|
|
23337
23451
|
|
|
23338
23452
|
var Widget = getWidget(schema, widget, widgets);
|
|
23339
23453
|
return react.createElement(Widget, {
|
|
23340
|
-
options: options,
|
|
23341
23454
|
id: idSchema && idSchema.$id,
|
|
23342
23455
|
multiple: true,
|
|
23343
23456
|
onChange: this.onSelectChange,
|
|
23344
23457
|
onBlur: onBlur,
|
|
23345
23458
|
onFocus: onFocus,
|
|
23459
|
+
options: options,
|
|
23346
23460
|
schema: schema,
|
|
23347
|
-
|
|
23461
|
+
registry: registry,
|
|
23348
23462
|
value: items,
|
|
23349
23463
|
disabled: disabled,
|
|
23350
23464
|
readonly: readonly,
|
|
23465
|
+
required: required,
|
|
23466
|
+
label: title,
|
|
23467
|
+
placeholder: placeholder,
|
|
23351
23468
|
formContext: formContext,
|
|
23352
23469
|
autofocus: autofocus,
|
|
23353
23470
|
rawErrors: rawErrors
|
|
23354
23471
|
});
|
|
23355
23472
|
}
|
|
23356
23473
|
}, {
|
|
23357
|
-
key: "
|
|
23358
|
-
value: function
|
|
23359
|
-
var _this3 = this;
|
|
23360
|
-
|
|
23474
|
+
key: "renderFiles",
|
|
23475
|
+
value: function renderFiles() {
|
|
23361
23476
|
var _this$props8 = this.props,
|
|
23362
23477
|
schema = _this$props8.schema,
|
|
23363
23478
|
uiSchema = _this$props8.uiSchema,
|
|
23364
|
-
formData = _this$props8.formData,
|
|
23365
|
-
errorSchema = _this$props8.errorSchema,
|
|
23366
|
-
idPrefix = _this$props8.idPrefix,
|
|
23367
23479
|
idSchema = _this$props8.idSchema,
|
|
23368
23480
|
name = _this$props8.name,
|
|
23369
|
-
required = _this$props8.required,
|
|
23370
23481
|
disabled = _this$props8.disabled,
|
|
23371
23482
|
readonly = _this$props8.readonly,
|
|
23372
23483
|
autofocus = _this$props8.autofocus,
|
|
23373
|
-
_this$props8$registry = _this$props8.registry,
|
|
23374
|
-
registry = _this$props8$registry === void 0 ? getDefaultRegistry() : _this$props8$registry,
|
|
23375
23484
|
onBlur = _this$props8.onBlur,
|
|
23376
23485
|
onFocus = _this$props8.onFocus,
|
|
23486
|
+
_this$props8$registry = _this$props8.registry,
|
|
23487
|
+
registry = _this$props8$registry === void 0 ? getDefaultRegistry() : _this$props8$registry,
|
|
23377
23488
|
rawErrors = _this$props8.rawErrors;
|
|
23378
23489
|
var title = schema.title || name;
|
|
23379
23490
|
var items = this.props.formData;
|
|
23491
|
+
var widgets = registry.widgets,
|
|
23492
|
+
formContext = registry.formContext;
|
|
23493
|
+
|
|
23494
|
+
var _getUiOptions3 = getUiOptions(uiSchema),
|
|
23495
|
+
_getUiOptions3$widget = _getUiOptions3.widget,
|
|
23496
|
+
widget = _getUiOptions3$widget === void 0 ? "files" : _getUiOptions3$widget,
|
|
23497
|
+
options = _objectWithoutProperties$7(_getUiOptions3, ["widget"]);
|
|
23498
|
+
|
|
23499
|
+
var Widget = getWidget(schema, widget, widgets);
|
|
23500
|
+
return react.createElement(Widget, {
|
|
23501
|
+
options: options,
|
|
23502
|
+
id: idSchema && idSchema.$id,
|
|
23503
|
+
multiple: true,
|
|
23504
|
+
onChange: this.onSelectChange,
|
|
23505
|
+
onBlur: onBlur,
|
|
23506
|
+
onFocus: onFocus,
|
|
23507
|
+
schema: schema,
|
|
23508
|
+
title: title,
|
|
23509
|
+
value: items,
|
|
23510
|
+
disabled: disabled,
|
|
23511
|
+
readonly: readonly,
|
|
23512
|
+
formContext: formContext,
|
|
23513
|
+
autofocus: autofocus,
|
|
23514
|
+
rawErrors: rawErrors
|
|
23515
|
+
});
|
|
23516
|
+
}
|
|
23517
|
+
}, {
|
|
23518
|
+
key: "renderFixedArray",
|
|
23519
|
+
value: function renderFixedArray() {
|
|
23520
|
+
var _this3 = this;
|
|
23521
|
+
|
|
23522
|
+
var _this$props9 = this.props,
|
|
23523
|
+
schema = _this$props9.schema,
|
|
23524
|
+
uiSchema = _this$props9.uiSchema,
|
|
23525
|
+
formData = _this$props9.formData,
|
|
23526
|
+
errorSchema = _this$props9.errorSchema,
|
|
23527
|
+
idPrefix = _this$props9.idPrefix,
|
|
23528
|
+
idSeparator = _this$props9.idSeparator,
|
|
23529
|
+
idSchema = _this$props9.idSchema,
|
|
23530
|
+
name = _this$props9.name,
|
|
23531
|
+
required = _this$props9.required,
|
|
23532
|
+
disabled = _this$props9.disabled,
|
|
23533
|
+
readonly = _this$props9.readonly,
|
|
23534
|
+
autofocus = _this$props9.autofocus,
|
|
23535
|
+
_this$props9$registry = _this$props9.registry,
|
|
23536
|
+
registry = _this$props9$registry === void 0 ? getDefaultRegistry() : _this$props9$registry,
|
|
23537
|
+
onBlur = _this$props9.onBlur,
|
|
23538
|
+
onFocus = _this$props9.onFocus,
|
|
23539
|
+
rawErrors = _this$props9.rawErrors;
|
|
23540
|
+
var title = schema.title || name;
|
|
23541
|
+
var items = this.props.formData;
|
|
23380
23542
|
var ArrayFieldTemplate = registry.ArrayFieldTemplate,
|
|
23381
23543
|
rootSchema = registry.rootSchema,
|
|
23382
23544
|
fields = registry.fields,
|
|
@@ -23406,7 +23568,7 @@ function (_Component) {
|
|
|
23406
23568
|
var additional = index >= itemSchemas.length;
|
|
23407
23569
|
var itemSchema = additional ? retrieveSchema(schema.additionalItems, rootSchema, item) : itemSchemas[index];
|
|
23408
23570
|
var itemIdPrefix = idSchema.$id + "_" + index;
|
|
23409
|
-
var itemIdSchema = toIdSchema(itemSchema, itemIdPrefix, rootSchema, item, idPrefix);
|
|
23571
|
+
var itemIdSchema = toIdSchema(itemSchema, itemIdPrefix, rootSchema, item, idPrefix, idSeparator);
|
|
23410
23572
|
var itemUiSchema = additional ? uiSchema.additionalItems || {} : Array.isArray(uiSchema.items) ? uiSchema.items[index] : uiSchema.items || {};
|
|
23411
23573
|
var itemErrorSchema = errorSchema ? errorSchema[index] : undefined;
|
|
23412
23574
|
return _this3.renderArrayFieldItem({
|
|
@@ -23459,12 +23621,12 @@ function (_Component) {
|
|
|
23459
23621
|
onBlur = props.onBlur,
|
|
23460
23622
|
onFocus = props.onFocus,
|
|
23461
23623
|
rawErrors = props.rawErrors;
|
|
23462
|
-
var _this$
|
|
23463
|
-
disabled = _this$
|
|
23464
|
-
readonly = _this$
|
|
23465
|
-
uiSchema = _this$
|
|
23466
|
-
_this$
|
|
23467
|
-
registry = _this$
|
|
23624
|
+
var _this$props10 = this.props,
|
|
23625
|
+
disabled = _this$props10.disabled,
|
|
23626
|
+
readonly = _this$props10.readonly,
|
|
23627
|
+
uiSchema = _this$props10.uiSchema,
|
|
23628
|
+
_this$props10$registr = _this$props10.registry,
|
|
23629
|
+
registry = _this$props10$registr === void 0 ? getDefaultRegistry() : _this$props10$registr;
|
|
23468
23630
|
var SchemaField = registry.fields.SchemaField;
|
|
23469
23631
|
|
|
23470
23632
|
var _orderable$removable$ = _objectSpread$7({
|
|
@@ -23804,6 +23966,7 @@ function (_Component) {
|
|
|
23804
23966
|
errorSchema = _this$props3.errorSchema,
|
|
23805
23967
|
formData = _this$props3.formData,
|
|
23806
23968
|
idPrefix = _this$props3.idPrefix,
|
|
23969
|
+
idSeparator = _this$props3.idSeparator,
|
|
23807
23970
|
idSchema = _this$props3.idSchema,
|
|
23808
23971
|
onBlur = _this$props3.onBlur,
|
|
23809
23972
|
onChange = _this$props3.onChange,
|
|
@@ -23864,6 +24027,7 @@ function (_Component) {
|
|
|
23864
24027
|
errorSchema: errorSchema,
|
|
23865
24028
|
idSchema: idSchema,
|
|
23866
24029
|
idPrefix: idPrefix,
|
|
24030
|
+
idSeparator: idSeparator,
|
|
23867
24031
|
formData: formData,
|
|
23868
24032
|
onChange: onChange,
|
|
23869
24033
|
onBlur: onBlur,
|
|
@@ -24234,6 +24398,7 @@ function (_Component) {
|
|
|
24234
24398
|
disabled = _this$props2.disabled,
|
|
24235
24399
|
readonly = _this$props2.readonly,
|
|
24236
24400
|
idPrefix = _this$props2.idPrefix,
|
|
24401
|
+
idSeparator = _this$props2.idSeparator,
|
|
24237
24402
|
onBlur = _this$props2.onBlur,
|
|
24238
24403
|
onFocus = _this$props2.onFocus,
|
|
24239
24404
|
_this$props2$registry = _this$props2.registry,
|
|
@@ -24281,6 +24446,7 @@ function (_Component) {
|
|
|
24281
24446
|
errorSchema: errorSchema[name],
|
|
24282
24447
|
idSchema: idSchema[name],
|
|
24283
24448
|
idPrefix: idPrefix,
|
|
24449
|
+
idSeparator: idSeparator,
|
|
24284
24450
|
formData: (formData || {})[name],
|
|
24285
24451
|
wasPropertyKeyModified: _this2.state.wasPropertyKeyModified,
|
|
24286
24452
|
onKeyChange: _this2.onKeyChange(name),
|
|
@@ -26177,7 +26343,7 @@ function getDisplayLabel(schema, uiSchema, rootSchema) {
|
|
|
26177
26343
|
var schemaType = getSchemaType(schema);
|
|
26178
26344
|
|
|
26179
26345
|
if (schemaType === "array") {
|
|
26180
|
-
displayLabel = isMultiSelect(schema, rootSchema) || isFilesArray(schema, uiSchema, rootSchema);
|
|
26346
|
+
displayLabel = isMultiSelect(schema, rootSchema) || isFilesArray(schema, uiSchema, rootSchema) || isCustomWidget(uiSchema);
|
|
26181
26347
|
}
|
|
26182
26348
|
|
|
26183
26349
|
if (schemaType === "object") {
|
|
@@ -26354,6 +26520,12 @@ function isFixedItems(schema) {
|
|
|
26354
26520
|
return isObject(item);
|
|
26355
26521
|
});
|
|
26356
26522
|
}
|
|
26523
|
+
function isCustomWidget(uiSchema) {
|
|
26524
|
+
return (// TODO: Remove the `&& uiSchema["ui:widget"] !== "hidden"` once we support hidden widgets for arrays.
|
|
26525
|
+
// https://react-jsonschema-form.readthedocs.io/en/latest/usage/widgets/#hidden-widgets
|
|
26526
|
+
"widget" in getUiOptions(uiSchema) && getUiOptions(uiSchema)["widget"] !== "hidden"
|
|
26527
|
+
);
|
|
26528
|
+
}
|
|
26357
26529
|
function allowAdditionalItems(schema) {
|
|
26358
26530
|
if (schema.additionalItems === true) {
|
|
26359
26531
|
console.warn("additionalItems=true is currently not supported");
|
|
@@ -26756,6 +26928,7 @@ function shouldRender(comp, nextProps, nextState) {
|
|
|
26756
26928
|
function toIdSchema(schema, id, rootSchema) {
|
|
26757
26929
|
var formData = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
26758
26930
|
var idPrefix = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : "root";
|
|
26931
|
+
var idSeparator = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : "_";
|
|
26759
26932
|
var idSchema = {
|
|
26760
26933
|
$id: id || idPrefix
|
|
26761
26934
|
};
|
|
@@ -26763,11 +26936,11 @@ function toIdSchema(schema, id, rootSchema) {
|
|
|
26763
26936
|
if ("$ref" in schema || "dependencies" in schema || "allOf" in schema) {
|
|
26764
26937
|
var _schema = retrieveSchema(schema, rootSchema, formData);
|
|
26765
26938
|
|
|
26766
|
-
return toIdSchema(_schema, id, rootSchema, formData, idPrefix);
|
|
26939
|
+
return toIdSchema(_schema, id, rootSchema, formData, idPrefix, idSeparator);
|
|
26767
26940
|
}
|
|
26768
26941
|
|
|
26769
26942
|
if ("items" in schema && !schema.items.$ref) {
|
|
26770
|
-
return toIdSchema(schema.items, id, rootSchema, formData, idPrefix);
|
|
26943
|
+
return toIdSchema(schema.items, id, rootSchema, formData, idPrefix, idSeparator);
|
|
26771
26944
|
}
|
|
26772
26945
|
|
|
26773
26946
|
if (schema.type !== "object") {
|
|
@@ -26776,10 +26949,10 @@ function toIdSchema(schema, id, rootSchema) {
|
|
|
26776
26949
|
|
|
26777
26950
|
for (var name in schema.properties || {}) {
|
|
26778
26951
|
var field = schema.properties[name];
|
|
26779
|
-
var fieldId = idSchema.$id +
|
|
26952
|
+
var fieldId = idSchema.$id + idSeparator + name;
|
|
26780
26953
|
idSchema[name] = toIdSchema(isObject(field) ? field : {}, fieldId, rootSchema, // It's possible that formData is not an object -- this can happen if an
|
|
26781
26954
|
// array item has just been added, but not populated with data yet
|
|
26782
|
-
(formData || {})[name], idPrefix);
|
|
26955
|
+
(formData || {})[name], idPrefix, idSeparator);
|
|
26783
26956
|
}
|
|
26784
26957
|
|
|
26785
26958
|
return idSchema;
|
|
@@ -27234,6 +27407,7 @@ function SchemaFieldRender(props) {
|
|
|
27234
27407
|
formData = props.formData,
|
|
27235
27408
|
errorSchema = props.errorSchema,
|
|
27236
27409
|
idPrefix = props.idPrefix,
|
|
27410
|
+
idSeparator = props.idSeparator,
|
|
27237
27411
|
name = props.name,
|
|
27238
27412
|
onChange = props.onChange,
|
|
27239
27413
|
onKeyChange = props.onKeyChange,
|
|
@@ -27249,7 +27423,7 @@ function SchemaFieldRender(props) {
|
|
|
27249
27423
|
var FieldTemplate = uiSchema["ui:FieldTemplate"] || registry.FieldTemplate || DefaultTemplate;
|
|
27250
27424
|
var idSchema = props.idSchema;
|
|
27251
27425
|
var schema = retrieveSchema(props.schema, rootSchema, formData);
|
|
27252
|
-
idSchema = mergeObjects(toIdSchema(schema, null, rootSchema, formData, idPrefix), idSchema);
|
|
27426
|
+
idSchema = mergeObjects(toIdSchema(schema, null, rootSchema, formData, idPrefix, idSeparator), idSchema);
|
|
27253
27427
|
var FieldComponent = getFieldComponent(schema, uiSchema, idSchema, fields);
|
|
27254
27428
|
var DescriptionField = fields.DescriptionField;
|
|
27255
27429
|
var disabled = Boolean(props.disabled || uiSchema["ui:disabled"]);
|
|
@@ -28143,6 +28317,7 @@ let Form = class {
|
|
|
28143
28317
|
widgets: widgets,
|
|
28144
28318
|
liveValidate: true,
|
|
28145
28319
|
showErrorList: false,
|
|
28320
|
+
extraErrors: this.getExtraErrors(this.errors),
|
|
28146
28321
|
FieldTemplate: FieldTemplate,
|
|
28147
28322
|
ArrayFieldTemplate: ArrayFieldTemplate,
|
|
28148
28323
|
ObjectFieldTemplate: ObjectFieldTemplate,
|
|
@@ -28209,6 +28384,17 @@ let Form = class {
|
|
|
28209
28384
|
};
|
|
28210
28385
|
});
|
|
28211
28386
|
}
|
|
28387
|
+
getExtraErrors(errors) {
|
|
28388
|
+
if (!errors) {
|
|
28389
|
+
return;
|
|
28390
|
+
}
|
|
28391
|
+
return mapValues(errors, (error) => {
|
|
28392
|
+
if (Array.isArray(error)) {
|
|
28393
|
+
return { __errors: error };
|
|
28394
|
+
}
|
|
28395
|
+
return this.getExtraErrors(error);
|
|
28396
|
+
});
|
|
28397
|
+
}
|
|
28212
28398
|
getCustomErrorMessages(originalErrors) {
|
|
28213
28399
|
if (!this.transformErrors) {
|
|
28214
28400
|
return originalErrors;
|