@luomus/laji-form 15.1.63 → 15.1.65
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/laji-form.js +1 -1
- package/dist/laji-form.js.LICENSE.txt +1 -1
- package/lib/Context.d.ts +1 -1
- package/lib/Context.js +1 -2
- package/lib/ReactContext.js +22 -8
- package/lib/components/BaseComponent.d.ts +1 -2
- package/lib/components/BaseComponent.js +2 -3
- package/lib/components/LajiForm.d.ts +13 -13
- package/lib/components/LajiForm.js +51 -35
- package/lib/components/VirtualSchemaField.d.ts +14 -14
- package/lib/components/VirtualSchemaField.js +31 -18
- package/lib/components/components/Affix.d.ts +2 -2
- package/lib/components/components/Affix.js +25 -12
- package/lib/components/components/Button.d.ts +6 -6
- package/lib/components/components/Button.js +23 -9
- package/lib/components/components/DeleteButton.d.ts +4 -4
- package/lib/components/components/DeleteButton.js +25 -11
- package/lib/components/components/ErrorPanel.d.ts +3 -3
- package/lib/components/components/ErrorPanel.js +22 -8
- package/lib/components/components/FailedBackgroundJobsPanel.d.ts +2 -2
- package/lib/components/components/FailedBackgroundJobsPanel.js +25 -11
- package/lib/components/components/FetcherInput.d.ts +1 -1
- package/lib/components/components/FetcherInput.js +28 -14
- package/lib/components/components/Fullscreen.d.ts +1 -1
- package/lib/components/components/Fullscreen.js +23 -9
- package/lib/components/components/GlyphButton.d.ts +5 -5
- package/lib/components/components/GlyphButton.js +22 -8
- package/lib/components/components/Help.d.ts +1 -1
- package/lib/components/components/Help.js +25 -12
- package/lib/components/components/Label.d.ts +1 -1
- package/lib/components/components/Label.js +24 -11
- package/lib/components/components/OverlayTrigger.d.ts +4 -4
- package/lib/components/components/OverlayTrigger.js +22 -8
- package/lib/components/components/Stretch.d.ts +4 -4
- package/lib/components/components/Stretch.js +25 -11
- package/lib/components/components/TooltipComponent.d.ts +1 -1
- package/lib/components/components/TooltipComponent.js +26 -12
- package/lib/components/components/index.js +5 -1
- package/lib/components/fields/AnnotationField.d.ts +8 -4
- package/lib/components/fields/AnnotationField.js +34 -20
- package/lib/components/fields/AnyToBooleanField.d.ts +4 -4
- package/lib/components/fields/AnyToBooleanField.js +22 -8
- package/lib/components/fields/ArrayBulkField.d.ts +9 -4
- package/lib/components/fields/ArrayBulkField.js +24 -10
- package/lib/components/fields/ArrayCombinerField.d.ts +4 -4
- package/lib/components/fields/ArrayCombinerField.js +25 -11
- package/lib/components/fields/ArrayField.d.ts +1 -0
- package/lib/components/fields/ArrayField.js +41 -27
- package/lib/components/fields/ArrayPropertySumField.d.ts +2 -2
- package/lib/components/fields/ArrayPropertySumField.js +24 -10
- package/lib/components/fields/AsArrayField.d.ts +7 -5
- package/lib/components/fields/AsArrayField.js +22 -8
- package/lib/components/fields/AudioArrayField.js +22 -8
- package/lib/components/fields/AutoArrayField.d.ts +2 -2
- package/lib/components/fields/AutoArrayField.js +26 -12
- package/lib/components/fields/AutosuggestField.d.ts +14 -6
- package/lib/components/fields/AutosuggestField.js +61 -47
- package/lib/components/fields/CombinedValueDisplayField.d.ts +6 -6
- package/lib/components/fields/CombinedValueDisplayField.js +24 -10
- package/lib/components/fields/CondensedObjectField.d.ts +3 -3
- package/lib/components/fields/CondensedObjectField.js +33 -19
- package/lib/components/fields/ConditionalOnChangeField.d.ts +7 -7
- package/lib/components/fields/ConditionalOnChangeField.js +22 -8
- package/lib/components/fields/ConditionalUiSchemaField.d.ts +19 -19
- package/lib/components/fields/ConditionalUiSchemaField.js +28 -14
- package/lib/components/fields/ContextInjectionField.d.ts +7 -7
- package/lib/components/fields/ContextInjectionField.js +26 -13
- package/lib/components/fields/DataLeakerField.d.ts +6 -6
- package/lib/components/fields/DataLeakerField.js +25 -11
- package/lib/components/fields/DefaultValueArrayField.d.ts +6 -6
- package/lib/components/fields/DefaultValueArrayField.js +23 -9
- package/lib/components/fields/DependentBooleanField.d.ts +6 -6
- package/lib/components/fields/DependentBooleanField.js +24 -10
- package/lib/components/fields/DependentDisableField.d.ts +4 -4
- package/lib/components/fields/DependentDisableField.js +24 -10
- package/lib/components/fields/EnumRangeArrayField.d.ts +2 -3
- package/lib/components/fields/EnumRangeArrayField.js +26 -12
- package/lib/components/fields/ExtraLabelRowField.d.ts +9 -8
- package/lib/components/fields/ExtraLabelRowField.js +27 -13
- package/lib/components/fields/FakePropertyField.d.ts +2 -2
- package/lib/components/fields/FakePropertyField.js +26 -12
- package/lib/components/fields/FillDateRangeField.d.ts +28 -0
- package/lib/components/fields/FillDateRangeField.js +91 -0
- package/lib/components/fields/FilterArrayField.d.ts +13 -12
- package/lib/components/fields/FilterArrayField.js +27 -13
- package/lib/components/fields/FlatField.d.ts +4 -4
- package/lib/components/fields/FlatField.js +35 -21
- package/lib/components/fields/GeocoderField.d.ts +12 -4
- package/lib/components/fields/GeocoderField.js +38 -24
- package/lib/components/fields/GridLayoutField.d.ts +7 -7
- package/lib/components/fields/GridLayoutField.js +23 -9
- package/lib/components/fields/HiddenField.d.ts +2 -2
- package/lib/components/fields/HiddenField.js +22 -8
- package/lib/components/fields/HiddenWithTextField.d.ts +6 -7
- package/lib/components/fields/HiddenWithTextField.js +22 -8
- package/lib/components/fields/ImageArrayField.d.ts +17 -17
- package/lib/components/fields/ImageArrayField.js +53 -39
- package/lib/components/fields/ImageDisplayField.d.ts +4 -3
- package/lib/components/fields/ImageDisplayField.js +25 -11
- package/lib/components/fields/InitiallyHiddenField.d.ts +9 -4
- package/lib/components/fields/InitiallyHiddenField.js +23 -9
- package/lib/components/fields/InjectDefaultValueField.d.ts +6 -6
- package/lib/components/fields/InjectDefaultValueField.js +23 -9
- package/lib/components/fields/InjectField.d.ts +8 -8
- package/lib/components/fields/InjectField.js +34 -20
- package/lib/components/fields/InputWithDefaultValueButtonField.d.ts +8 -8
- package/lib/components/fields/InputWithDefaultValueButtonField.js +29 -15
- package/lib/components/fields/LocalityField.d.ts +4 -2
- package/lib/components/fields/LocalityField.js +28 -14
- package/lib/components/fields/LocationChooserField.d.ts +5 -4
- package/lib/components/fields/LocationChooserField.js +60 -46
- package/lib/components/fields/MapArrayField.d.ts +17 -4
- package/lib/components/fields/MapArrayField.js +137 -132
- package/lib/components/fields/MapField.d.ts +10 -2
- package/lib/components/fields/MapField.js +42 -29
- package/lib/components/fields/MultiActiveArrayField.d.ts +3 -3
- package/lib/components/fields/MultiActiveArrayField.js +29 -15
- package/lib/components/fields/MultiAnyToBooleanField.d.ts +6 -2
- package/lib/components/fields/MultiAnyToBooleanField.js +25 -11
- package/lib/components/fields/MultiArrayField.d.ts +11 -10
- package/lib/components/fields/MultiArrayField.js +45 -31
- package/lib/components/fields/MultiLanguageField.d.ts +3 -2
- package/lib/components/fields/MultiLanguageField.js +23 -9
- package/lib/components/fields/MultiTagArrayField.d.ts +8 -4
- package/lib/components/fields/MultiTagArrayField.js +34 -20
- package/lib/components/fields/NamedPlaceChooserField/NamedPlaceChooser.d.ts +2 -2
- package/lib/components/fields/NamedPlaceChooserField/NamedPlaceChooser.js +25 -11
- package/lib/components/fields/NamedPlaceChooserField/NamedPlaceChooserField.d.ts +6 -6
- package/lib/components/fields/NamedPlaceChooserField/NamedPlaceChooserField.js +29 -16
- package/lib/components/fields/NamedPlaceChooserField/Popup.d.ts +1 -1
- package/lib/components/fields/NamedPlaceChooserField/Popup.js +29 -15
- package/lib/components/fields/NamedPlaceSaverField.d.ts +7 -5
- package/lib/components/fields/NamedPlaceSaverField.js +35 -21
- package/lib/components/fields/NestField.d.ts +4 -4
- package/lib/components/fields/NestField.js +36 -23
- package/lib/components/fields/ObjectField.js +36 -22
- package/lib/components/fields/PdfArrayField.js +22 -8
- package/lib/components/fields/PrefillingArrayField.d.ts +2 -2
- package/lib/components/fields/PrefillingArrayField.js +23 -9
- package/lib/components/fields/PrefixArrayField.d.ts +35 -0
- package/lib/components/fields/PrefixArrayField.js +138 -0
- package/lib/components/fields/SchemaField.d.ts +1 -1
- package/lib/components/fields/SchemaField.js +34 -20
- package/lib/components/fields/ScopeField.d.ts +14 -6
- package/lib/components/fields/ScopeField.js +53 -39
- package/lib/components/fields/SectionArrayField.d.ts +2 -2
- package/lib/components/fields/SectionArrayField.js +110 -96
- package/lib/components/fields/SelectTreeField.d.ts +0 -1
- package/lib/components/fields/SelectTreeField.js +30 -16
- package/lib/components/fields/SingleActiveArrayField.d.ts +14 -2
- package/lib/components/fields/SingleActiveArrayField.js +112 -98
- package/lib/components/fields/SingleItemArrayField.d.ts +3 -2
- package/lib/components/fields/SingleItemArrayField.js +28 -14
- package/lib/components/fields/SortArrayField.d.ts +9 -9
- package/lib/components/fields/SortArrayField.js +43 -29
- package/lib/components/fields/SplitField.d.ts +4 -4
- package/lib/components/fields/SplitField.js +26 -12
- package/lib/components/fields/StringToArrayField.d.ts +5 -5
- package/lib/components/fields/StringToArrayField.js +23 -9
- package/lib/components/fields/SumField.d.ts +6 -6
- package/lib/components/fields/SumField.js +22 -8
- package/lib/components/fields/TableField.d.ts +4 -3
- package/lib/components/fields/TableField.js +31 -17
- package/lib/components/fields/TagArrayField.d.ts +8 -2
- package/lib/components/fields/TagArrayField.js +37 -23
- package/lib/components/fields/ToggleAdditionalArrayFieldsField.d.ts +10 -5
- package/lib/components/fields/ToggleAdditionalArrayFieldsField.js +30 -16
- package/lib/components/fields/UiFieldApplierField.d.ts +4 -4
- package/lib/components/fields/UiFieldApplierField.js +33 -19
- package/lib/components/fields/UiFieldMapperArrayField.d.ts +7 -6
- package/lib/components/fields/UiFieldMapperArrayField.js +26 -12
- package/lib/components/fields/UnitCountShorthandField.d.ts +6 -6
- package/lib/components/fields/UnitCountShorthandField.js +31 -17
- package/lib/components/fields/UnitListShorthandArrayField.d.ts +6 -5
- package/lib/components/fields/UnitListShorthandArrayField.js +31 -17
- package/lib/components/fields/UnitShorthandField.d.ts +11 -5
- package/lib/components/fields/UnitShorthandField.js +41 -27
- package/lib/components/templates/ArrayFieldTemplate.d.ts +2 -1
- package/lib/components/templates/ArrayFieldTemplate.js +60 -46
- package/lib/components/templates/BaseInputTemplate.d.ts +3 -0
- package/lib/components/templates/BaseInputTemplate.js +26 -13
- package/lib/components/templates/DescriptionField.js +25 -11
- package/lib/components/templates/ErrorListTemplate.d.ts +5 -0
- package/lib/components/templates/ErrorListTemplate.js +26 -12
- package/lib/components/templates/FieldTemplate.d.ts +8 -0
- package/lib/components/templates/FieldTemplate.js +31 -17
- package/lib/components/templates/ObjectFieldTemplate.js +30 -17
- package/lib/components/templates/TitleField.js +27 -13
- package/lib/components/widgets/AnyToBooleanWidget.d.ts +6 -6
- package/lib/components/widgets/AnyToBooleanWidget.js +24 -10
- package/lib/components/widgets/AutosuggestWidget.d.ts +14 -2
- package/lib/components/widgets/AutosuggestWidget.js +49 -35
- package/lib/components/widgets/CheckboxWidget.d.ts +3 -0
- package/lib/components/widgets/CheckboxWidget.js +32 -18
- package/lib/components/widgets/DateTimeWidget.d.ts +16 -8
- package/lib/components/widgets/DateTimeWidget.js +67 -35
- package/lib/components/widgets/DateWidget.d.ts +11 -11
- package/lib/components/widgets/DateWidget.js +36 -14
- package/lib/components/widgets/HiddenWidget.d.ts +4 -4
- package/lib/components/widgets/HiddenWidget.js +22 -8
- package/lib/components/widgets/ImageSelectWidget.d.ts +1 -0
- package/lib/components/widgets/ImageSelectWidget.js +24 -10
- package/lib/components/widgets/InformalTaxonGroupChooserWidget.d.ts +12 -0
- package/lib/components/widgets/InformalTaxonGroupChooserWidget.js +26 -12
- package/lib/components/widgets/InputGroupWidget.d.ts +4 -3
- package/lib/components/widgets/InputGroupWidget.js +25 -11
- package/lib/components/widgets/InputWithDefaultValueButtonWidget.d.ts +18 -8
- package/lib/components/widgets/InputWithDefaultValueButtonWidget.js +50 -14
- package/lib/components/widgets/NumberWidget.d.ts +3 -2
- package/lib/components/widgets/NumberWidget.js +23 -9
- package/lib/components/widgets/PlainTextWidget.d.ts +3 -3
- package/lib/components/widgets/PlainTextWidget.js +24 -10
- package/lib/components/widgets/SelectWidget.d.ts +5 -6
- package/lib/components/widgets/SelectWidget.js +92 -72
- package/lib/components/widgets/SeparatedDateTimeWidget.d.ts +3 -2
- package/lib/components/widgets/SeparatedDateTimeWidget.js +22 -8
- package/lib/components/widgets/TaxonImageWidget.d.ts +3 -2
- package/lib/components/widgets/TaxonImageWidget.js +24 -10
- package/lib/components/widgets/TextSelectWidget.d.ts +10 -2
- package/lib/components/widgets/TextSelectWidget.js +26 -12
- package/lib/components/widgets/TextareaWidget.d.ts +5 -0
- package/lib/components/widgets/TextareaWidget.js +25 -11
- package/lib/components/widgets/TimeWidget.d.ts +2 -2
- package/lib/components/widgets/TimeWidget.js +24 -10
- package/lib/components/widgets/URLWidget.d.ts +2 -2
- package/lib/components/widgets/URLWidget.js +22 -8
- package/lib/components/widgets/UpperCaseWidget.d.ts +3 -2
- package/lib/components/widgets/UpperCaseWidget.js +23 -9
- package/lib/index.d.ts +1 -1
- package/lib/index.js +25 -11
- package/lib/services/custom-event-service.d.ts +1 -1
- package/lib/services/focus-service.d.ts +1 -1
- package/lib/services/focus-service.js +3 -3
- package/lib/services/id-service.d.ts +1 -1
- package/lib/services/id-service.js +5 -6
- package/lib/services/key-handler-service.d.ts +3 -4
- package/lib/services/key-handler-service.js +4 -4
- package/lib/services/multi-active-array-service.d.ts +1 -1
- package/lib/services/settings-service.d.ts +2 -3
- package/lib/services/settings-service.js +3 -3
- package/lib/services/submit-hook-service.js +1 -1
- package/lib/themes/bs3.js +22 -8
- package/lib/themes/bs5.js +23 -9
- package/lib/themes/stub.js +22 -8
- package/lib/themes/theme.d.ts +15 -15
- package/lib/translations.json +5 -0
- package/lib/types.d.ts +18 -19
- package/lib/types.js +3 -4
- package/lib/utils.d.ts +9 -9
- package/lib/utils.js +138 -134
- package/lib/validation.js +28 -12
- package/package.json +12 -11
- package/test-export/test-utils.d.ts +7 -7
- package/test-export/test-utils.js +36 -22
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -17,13 +21,23 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
17
21
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
18
22
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
19
23
|
};
|
|
20
|
-
var __importStar = (this && this.__importStar) || function (
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
};
|
|
24
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
25
|
+
var ownKeys = function(o) {
|
|
26
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
27
|
+
var ar = [];
|
|
28
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
29
|
+
return ar;
|
|
30
|
+
};
|
|
31
|
+
return ownKeys(o);
|
|
32
|
+
};
|
|
33
|
+
return function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
37
|
+
__setModuleDefault(result, mod);
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
40
|
+
})();
|
|
27
41
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
28
42
|
var t = {};
|
|
29
43
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -55,15 +69,15 @@ const getOptions = (options) => {
|
|
|
55
69
|
], rowValueField = "/units/%{row}/individualCount", } = options;
|
|
56
70
|
return Object.assign(Object.assign({}, options), { sectionField, rowDefinerField, rowDefinerFields, rowValueField });
|
|
57
71
|
};
|
|
58
|
-
const hideFields = (schema, uiSchema, fields) => fields.reduce((_uiSchema, field) => utils_1.updateSafelyWithJSONPointer(_uiSchema, { "ui:field": "HiddenField" }, utils_1.uiSchemaJSONPointer(schema, field.replace("%{row}", "0"))), uiSchema);
|
|
72
|
+
const hideFields = (schema, uiSchema, fields) => fields.reduce((_uiSchema, field) => (0, utils_1.updateSafelyWithJSONPointer)(_uiSchema, { "ui:field": "HiddenField" }, (0, utils_1.uiSchemaJSONPointer)(schema, field.replace("%{row}", "0"))), uiSchema);
|
|
59
73
|
const walkUiOrder = (schema, uiSchema, pathToShouldBeLast) => {
|
|
60
|
-
let [prop, ...next] = pathToShouldBeLast.split("/").filter(s => !utils_1.isEmptyString(s));
|
|
74
|
+
let [prop, ...next] = pathToShouldBeLast.split("/").filter(s => !(0, utils_1.isEmptyString)(s));
|
|
61
75
|
if (!prop) {
|
|
62
76
|
return uiSchema;
|
|
63
77
|
}
|
|
64
78
|
const nextPath = `/${next.join("/")}`;
|
|
65
|
-
const nextSchema = utils_1.parseSchemaFromFormDataPointer(schema, prop);
|
|
66
|
-
const nextUiSchema = utils_1.parseUiSchemaFromFormDataPointer(uiSchema, prop);
|
|
79
|
+
const nextSchema = (0, utils_1.parseSchemaFromFormDataPointer)(schema, prop);
|
|
80
|
+
const nextUiSchema = (0, utils_1.parseUiSchemaFromFormDataPointer)(uiSchema, prop);
|
|
67
81
|
if (!isNaN(prop)) {
|
|
68
82
|
return Object.assign(Object.assign({}, uiSchema), { items: walkUiOrder(nextSchema, nextUiSchema, nextPath) });
|
|
69
83
|
}
|
|
@@ -84,11 +98,11 @@ const walkFieldTemplate = (schema, uiSchema = {}, template) => {
|
|
|
84
98
|
return uiSchema;
|
|
85
99
|
};
|
|
86
100
|
const InvisibleTitle = (props) => {
|
|
87
|
-
const uiSchema = Object.assign(Object.assign({}, (props.uiSchema || {})), { "ui:options": Object.assign(Object.assign({}, utils_1.getUiOptions(props.uiSchema)), { titleClassName: "hidden-title-text" }) });
|
|
101
|
+
const uiSchema = Object.assign(Object.assign({}, (props.uiSchema || {})), { "ui:options": Object.assign(Object.assign({}, (0, utils_1.getUiOptions)(props.uiSchema)), { titleClassName: "hidden-title-text" }) });
|
|
88
102
|
return React.createElement(TitleField_1.default, Object.assign({}, props, { uiSchema: uiSchema }));
|
|
89
103
|
};
|
|
90
104
|
const NoLineBreakTitle = (props) => {
|
|
91
|
-
const uiSchema = Object.assign(Object.assign({}, (props.uiSchema || {})), { "ui:options": Object.assign(Object.assign({}, utils_1.getUiOptions(props.uiSchema)), { titleClassName: "no-line-break" }) });
|
|
105
|
+
const uiSchema = Object.assign(Object.assign({}, (props.uiSchema || {})), { "ui:options": Object.assign(Object.assign({}, (0, utils_1.getUiOptions)(props.uiSchema)), { titleClassName: "no-line-break" }) });
|
|
92
106
|
return React.createElement(TitleField_1.default, Object.assign({}, props, { uiSchema: uiSchema }));
|
|
93
107
|
};
|
|
94
108
|
const invisibleStyle = { visibility: "hidden" };
|
|
@@ -105,14 +119,14 @@ let SectionArrayField = class SectionArrayField extends React.Component {
|
|
|
105
119
|
const formContext = Object.assign(Object.assign({}, props.formContext), { Label: () => null, this: this, originalUiSchema: uiSchema, errorSchema: props.errorSchema, errorsAsPopup: true });
|
|
106
120
|
let _uiSchema = hideFields(schema, Object.assign(Object.assign({}, uiSchema), { "ui:ArrayFieldTemplate": SectionArrayFieldTemplate }), [sectionField, rowDefinerField]);
|
|
107
121
|
const [containerPointer] = rowDefinerField.split("%{row}");
|
|
108
|
-
_uiSchema = utils_1.updateSafelyWithJSONPointer(_uiSchema, false, `/${utils_1.uiSchemaJSONPointer(schema, containerPointer)}/ui:options/removable`);
|
|
109
|
-
_uiSchema = utils_1.updateSafelyWithJSONPointer(_uiSchema, [{ fn: "add", className: "invisible" }], `/${utils_1.uiSchemaJSONPointer(schema, containerPointer)}/ui:options/buttons`);
|
|
110
|
-
_uiSchema = utils_1.updateSafelyWithJSONPointer(_uiSchema, containerArrayKeyFunctions, `/${utils_1.uiSchemaJSONPointer(schema, containerPointer)}/ui:options/arrayKeyFunctions`);
|
|
122
|
+
_uiSchema = (0, utils_1.updateSafelyWithJSONPointer)(_uiSchema, false, `/${(0, utils_1.uiSchemaJSONPointer)(schema, containerPointer)}/ui:options/removable`);
|
|
123
|
+
_uiSchema = (0, utils_1.updateSafelyWithJSONPointer)(_uiSchema, [{ fn: "add", className: "invisible" }], `/${(0, utils_1.uiSchemaJSONPointer)(schema, containerPointer)}/ui:options/buttons`);
|
|
124
|
+
_uiSchema = (0, utils_1.updateSafelyWithJSONPointer)(_uiSchema, containerArrayKeyFunctions, `/${(0, utils_1.uiSchemaJSONPointer)(schema, containerPointer)}/ui:options/arrayKeyFunctions`);
|
|
111
125
|
_uiSchema = walkFieldTemplate(schema, _uiSchema, NoLabelsObjectFieldTemplate);
|
|
112
126
|
//_uiSchema = updateSafelyWithJSONPointer(_uiSchema, {"ui:functions": [{"ui:field": "SingleItemArrayField"}, ...currentUiFunctions], ...contentUiSchema }, uiSchemaJSONPointer(schema, containerPointer));
|
|
113
127
|
_uiSchema = walkUiOrder(schema, _uiSchema, rowDefinerField.replace("%{row}", 0));
|
|
114
|
-
_uiSchema = utils_1.updateSafelyWithJSONPointer(_uiSchema, this.arrayKeyFunctions, "/ui:options/arrayKeyFunctions");
|
|
115
|
-
_uiSchema = utils_1.updateSafelyWithJSONPointer(_uiSchema, true, "/ui:options/keepPropFocusOnNavigate");
|
|
128
|
+
_uiSchema = (0, utils_1.updateSafelyWithJSONPointer)(_uiSchema, this.arrayKeyFunctions, "/ui:options/arrayKeyFunctions");
|
|
129
|
+
_uiSchema = (0, utils_1.updateSafelyWithJSONPointer)(_uiSchema, true, "/ui:options/keepPropFocusOnNavigate");
|
|
116
130
|
return {
|
|
117
131
|
uiSchema: _uiSchema,
|
|
118
132
|
formContext,
|
|
@@ -151,18 +165,18 @@ let SectionArrayFieldTemplate = class SectionArrayFieldTemplate extends React.Co
|
|
|
151
165
|
this.containerRef = React.createRef();
|
|
152
166
|
this.onFocuses = [];
|
|
153
167
|
this.getOnFocus = (i) => () => {
|
|
154
|
-
this.props.formContext.globals[`${this.props.idSchema.$id}.activeIdx`] = i + (utils_1.getUiOptions(this.props.uiSchema).startIdx || 0);
|
|
168
|
+
this.props.formContext.globals[`${this.props.idSchema.$id}.activeIdx`] = i + ((0, utils_1.getUiOptions)(this.props.uiSchema).startIdx || 0);
|
|
155
169
|
};
|
|
156
170
|
this.getElemsForRowIdx = (rowIdx) => {
|
|
157
|
-
const { rowValueField, rowDefinerField } = getOptions(utils_1.getUiOptions(this.props.uiSchema));
|
|
171
|
+
const { rowValueField, rowDefinerField } = getOptions((0, utils_1.getUiOptions)(this.props.uiSchema));
|
|
158
172
|
return [
|
|
159
|
-
`${this.props.idSchema.$id}_0_${utils_1.JSONPointerToId(rowDefinerField.replace("%{row}", rowIdx))}`,
|
|
160
|
-
...this.props.formData.map((_, idx) => `${this.props.idSchema.$id}_${idx}_${utils_1.JSONPointerToId(rowValueField.replace("%{row}", rowIdx))}`)
|
|
173
|
+
`${this.props.idSchema.$id}_0_${(0, utils_1.JSONPointerToId)(rowDefinerField.replace("%{row}", rowIdx))}`,
|
|
174
|
+
...this.props.formData.map((_, idx) => `${this.props.idSchema.$id}_${idx}_${(0, utils_1.JSONPointerToId)(rowValueField.replace("%{row}", rowIdx))}`)
|
|
161
175
|
].map(id => document.getElementById(id));
|
|
162
176
|
};
|
|
163
177
|
this.onContainerFocus = (e) => {
|
|
164
178
|
const { id } = e.target;
|
|
165
|
-
const [rowIdx] = getIdxsFromId(this.props.idSchema, getOptions(utils_1.getUiOptions(this.props.uiSchema)), id);
|
|
179
|
+
const [rowIdx] = getIdxsFromId(this.props.idSchema, getOptions((0, utils_1.getUiOptions)(this.props.uiSchema)), id);
|
|
166
180
|
if (rowIdx !== undefined) {
|
|
167
181
|
this.focusedRowIdx = rowIdx;
|
|
168
182
|
this.getElemsForRowIdx(rowIdx).forEach(elem => {
|
|
@@ -182,12 +196,12 @@ let SectionArrayFieldTemplate = class SectionArrayFieldTemplate extends React.Co
|
|
|
182
196
|
}
|
|
183
197
|
};
|
|
184
198
|
this.getAddButtonElem = () => {
|
|
185
|
-
return react_dom_1.findDOMNode(this.addButtonRef.current);
|
|
199
|
+
return (0, react_dom_1.findDOMNode)(this.addButtonRef.current);
|
|
186
200
|
};
|
|
187
201
|
this.showAddSection = () => {
|
|
188
202
|
this.setState({ showAddSection: true }, () => {
|
|
189
203
|
setTimeout(() => {
|
|
190
|
-
react_dom_1.findDOMNode(this.sectionInputRef.current).focus();
|
|
204
|
+
(0, react_dom_1.findDOMNode)(this.sectionInputRef.current).focus();
|
|
191
205
|
});
|
|
192
206
|
});
|
|
193
207
|
};
|
|
@@ -213,8 +227,8 @@ let SectionArrayFieldTemplate = class SectionArrayFieldTemplate extends React.Co
|
|
|
213
227
|
React.createElement(components_1.Button, { onClick: this.hideAddSection, variant: "default" }, translations.Cancel)));
|
|
214
228
|
};
|
|
215
229
|
this.sectorIsValid = (newSection) => {
|
|
216
|
-
const { sectionField } = getOptions(utils_1.getUiOptions(this.props.uiSchema));
|
|
217
|
-
const existingNumbers = this.props.formData.map(item => "" + utils_1.parseJSONPointer(item, sectionField));
|
|
230
|
+
const { sectionField } = getOptions((0, utils_1.getUiOptions)(this.props.uiSchema));
|
|
231
|
+
const existingNumbers = this.props.formData.map(item => "" + (0, utils_1.parseJSONPointer)(item, sectionField));
|
|
218
232
|
return !(isNaN(parseInt(newSection)) || parseInt(newSection) < 0 || parseInt(newSection) > 50 || existingNumbers.includes(newSection));
|
|
219
233
|
};
|
|
220
234
|
this.onNewSectionChange = (e) => {
|
|
@@ -233,66 +247,66 @@ let SectionArrayFieldTemplate = class SectionArrayFieldTemplate extends React.Co
|
|
|
233
247
|
this.addSection = () => {
|
|
234
248
|
const { registry, formContext, uiSchema, schema } = this.props;
|
|
235
249
|
const { newSection } = this.state;
|
|
236
|
-
const { rowDefinerField, rowDefinerFields, sectionField } = getOptions(utils_1.getUiOptions(uiSchema));
|
|
250
|
+
const { rowDefinerField, rowDefinerFields, sectionField } = getOptions((0, utils_1.getUiOptions)(uiSchema));
|
|
237
251
|
const [containerPointer] = rowDefinerField.split("/%{row}");
|
|
238
|
-
const copiedRowDefinerData = (utils_1.parseJSONPointer(this.props.formData[0] || {}, containerPointer) || []).reduce((result, item, idx) => {
|
|
252
|
+
const copiedRowDefinerData = ((0, utils_1.parseJSONPointer)(this.props.formData[0] || {}, containerPointer) || []).reduce((result, item, idx) => {
|
|
239
253
|
return [rowDefinerField, ...rowDefinerFields].reduce((_result, field) => {
|
|
240
|
-
const [_, parsedField] = field.split("/%{row}");
|
|
241
|
-
return utils_1.updateFormDataWithJSONPointer({
|
|
254
|
+
const [_, parsedField] = field.split("/%{row}");
|
|
255
|
+
return (0, utils_1.updateFormDataWithJSONPointer)({
|
|
242
256
|
schema: schema.items,
|
|
243
257
|
formData: _result,
|
|
244
258
|
registry
|
|
245
|
-
}, utils_1.parseJSONPointer(item, parsedField), field.replace(/%{row}/g, idx));
|
|
259
|
+
}, (0, utils_1.parseJSONPointer)(item, parsedField), field.replace(/%{row}/g, idx));
|
|
246
260
|
}, result);
|
|
247
|
-
}, utils_1.getDefaultFormState(schema.items));
|
|
261
|
+
}, (0, utils_1.getDefaultFormState)(schema.items));
|
|
248
262
|
const tmpIdTree = formContext.services.ids.getRelativeTmpIdTree(this.props.idSchema.$id);
|
|
249
263
|
const _item = copiedRowDefinerData;
|
|
250
|
-
let [item] = utils_1.addLajiFormIds(_item, tmpIdTree, this.props.idSchema.$id);
|
|
251
|
-
item = utils_1.updateFormDataWithJSONPointer({ schema: schema.items, formData: item, registry }, parseInt(newSection), sectionField);
|
|
264
|
+
let [item] = (0, utils_1.addLajiFormIds)(_item, tmpIdTree, this.props.idSchema.$id);
|
|
265
|
+
item = (0, utils_1.updateFormDataWithJSONPointer)({ schema: schema.items, formData: item, registry }, parseInt(newSection), sectionField);
|
|
252
266
|
const items = [...this.props.formData, item];
|
|
253
267
|
const idx = items.findIndex(i => i === item);
|
|
254
268
|
const idToFocus = `${this.props.idSchema.$id}_${idx}`;
|
|
255
|
-
let { idToScrollAfterAdd = `${this.props.idSchema.$id}-add-section` } = utils_1.getUiOptions(uiSchema || {});
|
|
256
|
-
Context_1.default(formContext.contextId).idToFocus = idToFocus;
|
|
257
|
-
Context_1.default(formContext.contextId).idToScroll = idToScrollAfterAdd;
|
|
269
|
+
let { idToScrollAfterAdd = `${this.props.idSchema.$id}-add-section` } = (0, utils_1.getUiOptions)(uiSchema || {});
|
|
270
|
+
(0, Context_1.default)(formContext.contextId).idToFocus = idToFocus;
|
|
271
|
+
(0, Context_1.default)(formContext.contextId).idToScroll = idToScrollAfterAdd;
|
|
258
272
|
formContext.this.props.onChange(items);
|
|
259
273
|
this.hideAddSection();
|
|
260
274
|
};
|
|
261
275
|
this.onRowDefinerChange = formData => {
|
|
262
|
-
const { rowDefinerField, rowDefinerFields } = getOptions(utils_1.getUiOptions(this.props.uiSchema));
|
|
276
|
+
const { rowDefinerField, rowDefinerFields } = getOptions((0, utils_1.getUiOptions)(this.props.uiSchema));
|
|
263
277
|
const [containerPointer] = rowDefinerField.split("%{row}");
|
|
264
|
-
const rowDefinerItemIdsToContainerIdxs = (utils_1.parseJSONPointer(this.props.formData[0] || {}, containerPointer) || []).reduce((map, item, idx) => {
|
|
265
|
-
map[utils_1.getUUID(item)] = idx;
|
|
278
|
+
const rowDefinerItemIdsToContainerIdxs = ((0, utils_1.parseJSONPointer)(this.props.formData[0] || {}, containerPointer) || []).reduce((map, item, idx) => {
|
|
279
|
+
map[(0, utils_1.getUUID)(item)] = idx;
|
|
266
280
|
return map;
|
|
267
281
|
}, {});
|
|
268
|
-
const tmpIdTree = this.props.formContext.services.ids.getRelativeTmpIdTree(`${this.props.idSchema.$id}_${utils_1.JSONPointerToId(containerPointer.substr(0, containerPointer.length - 1))}`);
|
|
269
|
-
const oldIds = utils_1.getAllLajiFormIdsDeeply(this.props.formData, tmpIdTree);
|
|
282
|
+
const tmpIdTree = this.props.formContext.services.ids.getRelativeTmpIdTree(`${this.props.idSchema.$id}_${(0, utils_1.JSONPointerToId)(containerPointer.substr(0, containerPointer.length - 1))}`);
|
|
283
|
+
const oldIds = (0, utils_1.getAllLajiFormIdsDeeply)(this.props.formData, tmpIdTree);
|
|
270
284
|
let ids = {};
|
|
271
285
|
const _formData = this.props.formData.map((item, containerIdx) => {
|
|
272
|
-
const items = utils_1.parseJSONPointer(formData, containerPointer).map((unit, idx) => {
|
|
273
|
-
let rowDefinerItem = utils_1.parseJSONPointer(item, `${containerPointer}/${rowDefinerItemIdsToContainerIdxs[utils_1.getUUID(unit)]}`);
|
|
286
|
+
const items = (0, utils_1.parseJSONPointer)(formData, containerPointer).map((unit, idx) => {
|
|
287
|
+
let rowDefinerItem = (0, utils_1.parseJSONPointer)(item, `${containerPointer}/${rowDefinerItemIdsToContainerIdxs[(0, utils_1.getUUID)(unit)]}`);
|
|
274
288
|
if (!rowDefinerItem) {
|
|
275
289
|
// If container is first and it has UUID, it's an item added to the definer column. It has a UUID already, so
|
|
276
290
|
// we don't define it again, or else it will be rendered again and won't be autofocused properly.
|
|
277
|
-
const [_rowDefinerItem, _ids] = containerIdx === 0 && utils_1.getUUID(unit)
|
|
278
|
-
? utils_1.addLajiFormIds(unit, tmpIdTree)
|
|
279
|
-
: utils_1.addLajiFormIds(this.props.formContext.utils.filterItemIdsDeeply(unit, this.props.idSchema.$id), tmpIdTree, false);
|
|
291
|
+
const [_rowDefinerItem, _ids] = containerIdx === 0 && (0, utils_1.getUUID)(unit)
|
|
292
|
+
? (0, utils_1.addLajiFormIds)(unit, tmpIdTree)
|
|
293
|
+
: (0, utils_1.addLajiFormIds)(this.props.formContext.utils.filterItemIdsDeeply(unit, this.props.idSchema.$id), tmpIdTree, false);
|
|
280
294
|
rowDefinerItem = _rowDefinerItem;
|
|
281
295
|
ids = Object.assign(Object.assign({}, ids), _ids);
|
|
282
296
|
}
|
|
283
297
|
const updatedUnit = [rowDefinerField, ...rowDefinerFields].reduce((updatedNewUnit, field) => {
|
|
284
|
-
const [_, contentPointer] = field.split("%{row}");
|
|
298
|
+
const [_, contentPointer] = field.split("%{row}");
|
|
285
299
|
const pointer = field.replace("%{row}", idx);
|
|
286
|
-
const value = utils_1.parseJSONPointer(formData, pointer);
|
|
287
|
-
return utils_1.updateFormDataWithJSONPointer({
|
|
288
|
-
schema: utils_1.parseSchemaFromFormDataPointer(this.props.schema.items, containerPointer).items,
|
|
300
|
+
const value = (0, utils_1.parseJSONPointer)(formData, pointer);
|
|
301
|
+
return (0, utils_1.updateFormDataWithJSONPointer)({
|
|
302
|
+
schema: (0, utils_1.parseSchemaFromFormDataPointer)(this.props.schema.items, containerPointer).items,
|
|
289
303
|
formData: updatedNewUnit,
|
|
290
304
|
registry: this.props.registry
|
|
291
305
|
}, value, contentPointer);
|
|
292
306
|
}, rowDefinerItem);
|
|
293
|
-
return utils_1.addLajiFormIds(updatedUnit, tmpIdTree, false)[0];
|
|
307
|
+
return (0, utils_1.addLajiFormIds)(updatedUnit, tmpIdTree, false)[0];
|
|
294
308
|
});
|
|
295
|
-
return utils_1.updateFormDataWithJSONPointer({
|
|
309
|
+
return (0, utils_1.updateFormDataWithJSONPointer)({
|
|
296
310
|
schema: this.props.schema.items,
|
|
297
311
|
formData: item,
|
|
298
312
|
registry: this.props.registry
|
|
@@ -317,18 +331,18 @@ let SectionArrayFieldTemplate = class SectionArrayFieldTemplate extends React.Co
|
|
|
317
331
|
}
|
|
318
332
|
renderRowDefinerColumn() {
|
|
319
333
|
const { formData, uiSchema, schema, registry } = this.props;
|
|
320
|
-
const { rowDefinerField, rowValueField, sectionField } = getOptions(utils_1.getUiOptions(uiSchema));
|
|
334
|
+
const { rowDefinerField, rowValueField, sectionField } = getOptions((0, utils_1.getUiOptions)(uiSchema));
|
|
321
335
|
const [containerPointer] = rowDefinerField.split("/%{row}");
|
|
322
336
|
const { SchemaField } = this.props.registry.fields;
|
|
323
337
|
const { originalUiSchema } = this.props.formContext;
|
|
324
338
|
const _schema = schema.items;
|
|
325
339
|
const _formData = formData[0];
|
|
326
340
|
let __uiSchema = hideFields(schema, originalUiSchema, [rowValueField, sectionField]);
|
|
327
|
-
__uiSchema = utils_1.updateSafelyWithJSONPointer(__uiSchema.items, false, `${containerPointer}/ui:options/removable`);
|
|
341
|
+
__uiSchema = (0, utils_1.updateSafelyWithJSONPointer)(__uiSchema.items, false, `${containerPointer}/ui:options/removable`);
|
|
328
342
|
__uiSchema = walkUiOrder(schema.items, __uiSchema, rowDefinerField.replace("%{row}", 0));
|
|
329
343
|
__uiSchema = walkFieldTemplate(schema.items, __uiSchema, RowDefinerObjectFieldTemplate);
|
|
330
344
|
__uiSchema = walkUiOrder(schema.items, __uiSchema, `${containerPointer}/0/identifications`);
|
|
331
|
-
const formContext = Object.assign(Object.assign({}, this.props.formContext), { rowDefinerField, sectionPointer: utils_1.idSchemaIdToJSONPointer(this.props.idSchema.$id) });
|
|
345
|
+
const formContext = Object.assign(Object.assign({}, this.props.formContext), { rowDefinerField, sectionPointer: (0, utils_1.idSchemaIdToJSONPointer)(this.props.idSchema.$id) });
|
|
332
346
|
const idSchema = this.props.registry.schemaUtils.toIdSchema(this.props.schema.items, `${this.props.idSchema.$id}_0`);
|
|
333
347
|
const sectionLabel = (React.createElement(components_1.Affix, { className: "background", containerRef: this.containerRef, topOffset: this.props.formContext.topOffset, bottomOffset: this.props.formContext.bottomOffset },
|
|
334
348
|
React.createElement("legend", null, this.props.formContext.translations.Section)));
|
|
@@ -337,7 +351,7 @@ let SectionArrayFieldTemplate = class SectionArrayFieldTemplate extends React.Co
|
|
|
337
351
|
return React.createElement(SectionContent, { content: content, sectionLabel: sectionLabel, sectionSum: sectionSum });
|
|
338
352
|
}
|
|
339
353
|
renderSections() {
|
|
340
|
-
const { sectionField, rowValueField } = getOptions(utils_1.getUiOptions(this.props.uiSchema));
|
|
354
|
+
const { sectionField, rowValueField } = getOptions((0, utils_1.getUiOptions)(this.props.uiSchema));
|
|
341
355
|
return (this.props.formData || []).map((item, idx) => {
|
|
342
356
|
if (!this.props.items[idx]) {
|
|
343
357
|
return null;
|
|
@@ -345,27 +359,27 @@ let SectionArrayFieldTemplate = class SectionArrayFieldTemplate extends React.Co
|
|
|
345
359
|
const { children, hasRemove, index, disabled, readonly, onDropIndexClick } = this.props.items[idx];
|
|
346
360
|
const del = hasRemove && (React.createElement(components_1.DeleteButton, { id: `${this.props.idSchema.$id}_${index}`, disabled: disabled || readonly, translations: this.props.formContext.translations, onClick: onDropIndexClick(index), className: "horizontally-centered" }));
|
|
347
361
|
const sectionLabel = (React.createElement(components_1.Affix, { className: index % 2 ? "background" : " darker", containerRef: this.containerRef, topOffset: this.props.formContext.topOffset, bottomOffset: this.props.formContext.bottomOffset },
|
|
348
|
-
React.createElement("legend", { className: "horizontally-centered" }, utils_1.parseJSONPointer(this.props.formData[index], sectionField))));
|
|
362
|
+
React.createElement("legend", { className: "horizontally-centered" }, (0, utils_1.parseJSONPointer)(this.props.formData[index], sectionField))));
|
|
349
363
|
const [arr, field] = rowValueField.split("/%{row}");
|
|
350
|
-
const sum = (utils_1.parseJSONPointer(item, arr) || []).reduce((sum, item) => sum + (utils_1.parseJSONPointer(item, field) || 0), 0);
|
|
364
|
+
const sum = ((0, utils_1.parseJSONPointer)(item, arr) || []).reduce((sum, item) => sum + ((0, utils_1.parseJSONPointer)(item, field) || 0), 0);
|
|
351
365
|
const sectionSum = (React.createElement("strong", { className: "horizontally-centered text-muted" }, sum));
|
|
352
|
-
return (React.createElement(Section, { onFocus: this.getOnFocus(idx), key: utils_1.getUUID(item), className: index % 2 ? undefined : "darker", id: `${this.props.idSchema.$id}_${idx}-section` },
|
|
366
|
+
return (React.createElement(Section, { onFocus: this.getOnFocus(idx), key: (0, utils_1.getUUID)(item), className: index % 2 ? undefined : "darker", id: `${this.props.idSchema.$id}_${idx}-section` },
|
|
353
367
|
React.createElement(SectionContent, { delete: del, sectionLabel: sectionLabel, sectionSum: sectionSum, content: children })));
|
|
354
368
|
});
|
|
355
369
|
}
|
|
356
370
|
renderRowDefinerDeleteColumn() {
|
|
357
371
|
const { schema, registry, formData } = this.props;
|
|
358
|
-
const { rowDefinerField, rowValueField, sectionField } = getOptions(utils_1.getUiOptions(this.props.uiSchema));
|
|
372
|
+
const { rowDefinerField, rowValueField, sectionField } = getOptions((0, utils_1.getUiOptions)(this.props.uiSchema));
|
|
359
373
|
const [containerPointer] = rowDefinerField.split("/%{row}");
|
|
360
374
|
const { SchemaField } = this.props.registry.fields;
|
|
361
375
|
const { originalUiSchema } = this.props.formContext;
|
|
362
376
|
let _schema = schema.items;
|
|
363
377
|
const _formData = formData[0];
|
|
364
378
|
let __uiSchema = hideFields(schema, originalUiSchema, [rowValueField, sectionField]);
|
|
365
|
-
__uiSchema = utils_1.updateSafelyWithJSONPointer(__uiSchema, [{ fn: "add", className: "invisible" }], `/${utils_1.uiSchemaJSONPointer(schema, containerPointer)}/ui:options/buttons`);
|
|
379
|
+
__uiSchema = (0, utils_1.updateSafelyWithJSONPointer)(__uiSchema, [{ fn: "add", className: "invisible" }], `/${(0, utils_1.uiSchemaJSONPointer)(schema, containerPointer)}/ui:options/buttons`);
|
|
366
380
|
__uiSchema = walkUiOrder(schema.items, __uiSchema.items, rowDefinerField.replace("%{row}", 0));
|
|
367
381
|
__uiSchema = walkFieldTemplate(schema.items, __uiSchema, InvisibleLabelObjectFieldTemplate);
|
|
368
|
-
const formContext = Object.assign(Object.assign({}, this.props.formContext), { containerPointer, sectionPointer: utils_1.idSchemaIdToJSONPointer(this.props.idSchema.$id) });
|
|
382
|
+
const formContext = Object.assign(Object.assign({}, this.props.formContext), { containerPointer, sectionPointer: (0, utils_1.idSchemaIdToJSONPointer)(this.props.idSchema.$id) });
|
|
369
383
|
const { Overlay, Popover, Glyphicon } = this.context.theme;
|
|
370
384
|
const add = (React.createElement(React.Fragment, null,
|
|
371
385
|
React.createElement(components_1.Affix, { containerRef: this.containerRef, topOffset: this.props.formContext.topOffset, bottomOffset: this.props.formContext.bottomOffset },
|
|
@@ -381,37 +395,37 @@ let SectionArrayFieldTemplate = class SectionArrayFieldTemplate extends React.Co
|
|
|
381
395
|
}
|
|
382
396
|
renderRowDefinerSumColumn() {
|
|
383
397
|
const { schema, registry, formData } = this.props;
|
|
384
|
-
const { rowDefinerField, rowDefinerFields, rowValueField, sectionField } = getOptions(utils_1.getUiOptions(this.props.uiSchema));
|
|
398
|
+
const { rowDefinerField, rowDefinerFields, rowValueField, sectionField } = getOptions((0, utils_1.getUiOptions)(this.props.uiSchema));
|
|
385
399
|
const [containerPointer, valueField] = rowValueField.split("/%{row}");
|
|
386
400
|
const { SchemaField } = this.props.registry.fields;
|
|
387
401
|
const { originalUiSchema } = this.props.formContext;
|
|
388
|
-
let _schema = utils_1.updateSafelyWithJSONPointer(schema.items, { type: "integer" }, `/properties/${containerPointer}/items/properties/sum`);
|
|
402
|
+
let _schema = (0, utils_1.updateSafelyWithJSONPointer)(schema.items, { type: "integer" }, `/properties/${containerPointer}/items/properties/sum`);
|
|
389
403
|
let _formData = formData[0];
|
|
390
404
|
const sums = formData.reduce((sums, item) => {
|
|
391
|
-
(utils_1.parseJSONPointer(item, containerPointer) || []).forEach((definerItem, idx) => {
|
|
392
|
-
sums[idx] = (sums[idx] || 0) + (utils_1.parseJSONPointer(definerItem, valueField) || 0);
|
|
405
|
+
((0, utils_1.parseJSONPointer)(item, containerPointer) || []).forEach((definerItem, idx) => {
|
|
406
|
+
sums[idx] = (sums[idx] || 0) + ((0, utils_1.parseJSONPointer)(definerItem, valueField) || 0);
|
|
393
407
|
});
|
|
394
408
|
return sums;
|
|
395
409
|
}, []);
|
|
396
410
|
sums.forEach((sum, idx) => {
|
|
397
|
-
_formData = utils_1.updateSafelyWithJSONPointer(_formData || {}, sum, `${containerPointer}/${idx}/sum`);
|
|
411
|
+
_formData = (0, utils_1.updateSafelyWithJSONPointer)(_formData || {}, sum, `${containerPointer}/${idx}/sum`);
|
|
398
412
|
});
|
|
399
|
-
let containerUiSchema = Object.keys(utils_1.parseSchemaFromFormDataPointer(_schema, containerPointer).items.properties).reduce((uiSchema, field) => {
|
|
413
|
+
let containerUiSchema = Object.keys((0, utils_1.parseSchemaFromFormDataPointer)(_schema, containerPointer).items.properties).reduce((uiSchema, field) => {
|
|
400
414
|
if (field === "sum") {
|
|
401
415
|
return uiSchema;
|
|
402
416
|
}
|
|
403
417
|
return Object.assign(Object.assign({}, uiSchema), { [field]: { "ui:field": "HiddenField" } });
|
|
404
|
-
}, utils_1.parseUiSchemaFromFormDataPointer(originalUiSchema, containerPointer).items);
|
|
405
|
-
let __uiSchema = utils_1.updateSafelyWithJSONPointer(originalUiSchema, containerUiSchema, `/items/${containerPointer}/items`);
|
|
418
|
+
}, (0, utils_1.parseUiSchemaFromFormDataPointer)(originalUiSchema, containerPointer).items);
|
|
419
|
+
let __uiSchema = (0, utils_1.updateSafelyWithJSONPointer)(originalUiSchema, containerUiSchema, `/items/${containerPointer}/items`);
|
|
406
420
|
__uiSchema = hideFields(schema, __uiSchema, [rowValueField, sectionField, rowDefinerField, ...rowDefinerFields]);
|
|
407
|
-
__uiSchema = utils_1.updateSafelyWithJSONPointer(__uiSchema.items, Object.assign(Object.assign({}, utils_1.parseJSONPointer(__uiSchema.items, `${containerPointer}/ui:options`)), { removable: false, buttons: [{ fn: "add", className: "invisible" }] }), `${containerPointer}/ui:options`);
|
|
408
|
-
__uiSchema = utils_1.updateSafelyWithJSONPointer(__uiSchema, {
|
|
421
|
+
__uiSchema = (0, utils_1.updateSafelyWithJSONPointer)(__uiSchema.items, Object.assign(Object.assign({}, (0, utils_1.parseJSONPointer)(__uiSchema.items, `${containerPointer}/ui:options`)), { removable: false, buttons: [{ fn: "add", className: "invisible" }] }), `${containerPointer}/ui:options`);
|
|
422
|
+
__uiSchema = (0, utils_1.updateSafelyWithJSONPointer)(__uiSchema, {
|
|
409
423
|
"ui:widget": "PlainTextWidget",
|
|
410
424
|
"ui:options": { strong: true, centered: true }
|
|
411
425
|
}, `${containerPointer}/items/sum`);
|
|
412
426
|
__uiSchema = walkFieldTemplate(schema.items, __uiSchema, SumObjectFieldTemplate);
|
|
413
427
|
__uiSchema = walkUiOrder(schema.items, __uiSchema, rowDefinerField.replace("%{row}", 0));
|
|
414
|
-
const formContext = Object.assign(Object.assign({}, this.props.formContext), { containerPointer, sectionPointer: utils_1.idSchemaIdToJSONPointer(this.props.idSchema.$id), rowValueField,
|
|
428
|
+
const formContext = Object.assign(Object.assign({}, this.props.formContext), { containerPointer, sectionPointer: (0, utils_1.idSchemaIdToJSONPointer)(this.props.idSchema.$id), rowValueField,
|
|
415
429
|
rowDefinerField });
|
|
416
430
|
const sumLabel = (React.createElement(components_1.Affix, { containerRef: this.containerRef, topOffset: this.props.formContext.topOffset, bottomOffset: this.props.formContext.bottomOffset },
|
|
417
431
|
React.createElement("legend", { className: "bg-info horizontally-centered" }, this.props.formContext.translations.Sum)));
|
|
@@ -426,7 +440,7 @@ SectionArrayFieldTemplate = __decorate([
|
|
|
426
440
|
const withoutItemPointers = pointer => pointer.replace(/\/([0-9]+|%{row})/g, "");
|
|
427
441
|
const InvisibleLabelObjectFieldTemplate = (props) => {
|
|
428
442
|
const { containerPointer } = props.formContext;
|
|
429
|
-
const pointer = utils_1.idSchemaIdToJSONPointer(props.idSchema.$id);
|
|
443
|
+
const pointer = (0, utils_1.idSchemaIdToJSONPointer)(props.idSchema.$id);
|
|
430
444
|
const containerPointerWithoutItemPointers = withoutItemPointers(containerPointer);
|
|
431
445
|
const pointerWithoutItemPointers = withoutItemPointers(pointer);
|
|
432
446
|
return props.properties.map(prop => {
|
|
@@ -443,7 +457,7 @@ const InvisibleLabelObjectFieldTemplate = (props) => {
|
|
|
443
457
|
};
|
|
444
458
|
const SumObjectFieldTemplate = (props) => {
|
|
445
459
|
const { containerPointer } = props.formContext;
|
|
446
|
-
const pointer = utils_1.idSchemaIdToJSONPointer(props.idSchema.$id);
|
|
460
|
+
const pointer = (0, utils_1.idSchemaIdToJSONPointer)(props.idSchema.$id);
|
|
447
461
|
const containerPointerWithoutItemPointers = withoutItemPointers(containerPointer);
|
|
448
462
|
const pointerWithoutItemPointers = withoutItemPointers(pointer);
|
|
449
463
|
return props.properties.map(prop => {
|
|
@@ -463,7 +477,7 @@ const NoLabelsObjectFieldTemplate = (props) => {
|
|
|
463
477
|
return props.properties.map(prop => prop.content);
|
|
464
478
|
};
|
|
465
479
|
const RowDefinerObjectFieldTemplate = (props) => {
|
|
466
|
-
const pointer = utils_1.idSchemaIdToJSONPointer(props.idSchema.$id);
|
|
480
|
+
const pointer = (0, utils_1.idSchemaIdToJSONPointer)(props.idSchema.$id);
|
|
467
481
|
const rowDefinerFieldWithoutItemPointers = withoutItemPointers(props.formContext.rowDefinerField);
|
|
468
482
|
const pointerWithoutItemPointers = withoutItemPointers(pointer);
|
|
469
483
|
return props.properties.map(prop => {
|
|
@@ -483,12 +497,12 @@ const getIdxsFromId = (idSchema, options, _id) => {
|
|
|
483
497
|
const { rowDefinerField } = options;
|
|
484
498
|
const id = idSchema.$id;
|
|
485
499
|
const sectionIdx = _id.match(new RegExp(`${id}_(\\d+)`))
|
|
486
|
-
&& !_id.match(new RegExp(`${id}_\\d+_${utils_1.JSONPointerToId(rowDefinerField.replace("%{row}", "\\d+"))}`))
|
|
500
|
+
&& !_id.match(new RegExp(`${id}_\\d+_${(0, utils_1.JSONPointerToId)(rowDefinerField.replace("%{row}", "\\d+"))}`))
|
|
487
501
|
? +_id.match(new RegExp(`${id}_(\\d+)`))[1]
|
|
488
502
|
: undefined;
|
|
489
503
|
const [containerPointer] = rowDefinerField.split("%{row}");
|
|
490
|
-
const horizontalIdx = _id.match(new RegExp(`${id}_\\d+_${utils_1.JSONPointerToId(containerPointer)}`))
|
|
491
|
-
? +_id.match(new RegExp(`${id}_\\d+_${utils_1.JSONPointerToId(containerPointer)}(\\d+)`))[1]
|
|
504
|
+
const horizontalIdx = _id.match(new RegExp(`${id}_\\d+_${(0, utils_1.JSONPointerToId)(containerPointer)}`))
|
|
505
|
+
? +_id.match(new RegExp(`${id}_\\d+_${(0, utils_1.JSONPointerToId)(containerPointer)}(\\d+)`))[1]
|
|
492
506
|
: undefined;
|
|
493
507
|
return [horizontalIdx, sectionIdx];
|
|
494
508
|
};
|
|
@@ -506,19 +520,19 @@ const _arrayKeyFunctions = options => {
|
|
|
506
520
|
return false;
|
|
507
521
|
}
|
|
508
522
|
const getNonRowSectionFieldsForSectionIdx = sectionIdx => {
|
|
509
|
-
let tabbable = utils_1.getTabbableFields(document.getElementById(`${id}_${sectionIdx}-section`));
|
|
523
|
+
let tabbable = (0, utils_1.getTabbableFields)(document.getElementById(`${id}_${sectionIdx}-section`));
|
|
510
524
|
return tabbable.filter(elem => {
|
|
511
|
-
return !elem.id.match(new RegExp(utils_1.JSONPointerToId(rowValueField.replace("%{row}", "\\d+"))));
|
|
525
|
+
return !elem.id.match(new RegExp((0, utils_1.JSONPointerToId)(rowValueField.replace("%{row}", "\\d+"))));
|
|
512
526
|
});
|
|
513
527
|
};
|
|
514
528
|
const goOverToNonRowLogic = (currentProp, reverse = true, last = true) => {
|
|
515
|
-
let tabbableInSection = utils_1.getTabbableFields(document.getElementById(`${id}_${last ? getProps().formData.length - 1 : 0}-section`));
|
|
529
|
+
let tabbableInSection = (0, utils_1.getTabbableFields)(document.getElementById(`${id}_${last ? getProps().formData.length - 1 : 0}-section`));
|
|
516
530
|
if (reverse) {
|
|
517
531
|
tabbableInSection = tabbableInSection.reverse();
|
|
518
532
|
}
|
|
519
533
|
let currentPropEncountered = false;
|
|
520
534
|
const elem = tabbableInSection.find(elem => {
|
|
521
|
-
if (!elem.id.match(new RegExp(utils_1.JSONPointerToId(rowValueField.replace("%{row}", "\\d+"))))) {
|
|
535
|
+
if (!elem.id.match(new RegExp((0, utils_1.JSONPointerToId)(rowValueField.replace("%{row}", "\\d+"))))) {
|
|
522
536
|
if (!currentProp || currentPropEncountered) {
|
|
523
537
|
return elem;
|
|
524
538
|
}
|
|
@@ -532,12 +546,12 @@ const _arrayKeyFunctions = options => {
|
|
|
532
546
|
if (left || right) {
|
|
533
547
|
// Horizontal navigation from row definer column to row value column.
|
|
534
548
|
if (right && currentSection === undefined) {
|
|
535
|
-
const idSuffix = utils_1.JSONPointerToId(rowValueField.replace("%{row}", currentRow));
|
|
549
|
+
const idSuffix = (0, utils_1.JSONPointerToId)(rowValueField.replace("%{row}", currentRow));
|
|
536
550
|
nextId = `${id}_0_${idSuffix}`;
|
|
537
551
|
// Horizontal navigation from row value column to row definer column.
|
|
538
552
|
}
|
|
539
553
|
else if (left && currentSection === 0 && currentRow !== undefined) {
|
|
540
|
-
const idSuffix = utils_1.JSONPointerToId(rowDefinerField.replace("%{row}", currentRow));
|
|
554
|
+
const idSuffix = (0, utils_1.JSONPointerToId)(rowDefinerField.replace("%{row}", currentRow));
|
|
541
555
|
nextId = `${id}_${currentSection}_${idSuffix}`;
|
|
542
556
|
// Horizontal navigation to next/prev row if goOverRow.
|
|
543
557
|
}
|
|
@@ -547,14 +561,14 @@ const _arrayKeyFunctions = options => {
|
|
|
547
561
|
}
|
|
548
562
|
// Horizontal navigation inside row matrix.
|
|
549
563
|
if (currentRow !== undefined) {
|
|
550
|
-
const idSuffix = utils_1.JSONPointerToId(rowDefinerField.replace("%{row}", currentRow + 1));
|
|
564
|
+
const idSuffix = (0, utils_1.JSONPointerToId)(rowDefinerField.replace("%{row}", currentRow + 1));
|
|
551
565
|
nextId = `${id}_${0}_${idSuffix}`;
|
|
552
566
|
}
|
|
553
567
|
else {
|
|
554
568
|
let tabbableInSection = getNonRowSectionFieldsForSectionIdx(getProps().formData.length - 1);
|
|
555
569
|
// Horizontal navigation inside non row section field.
|
|
556
570
|
if (currentId === getProps().formContext.utils.findNearestParentSchemaElemId(tabbableInSection[tabbableInSection.length - 1])) {
|
|
557
|
-
nextId = `${id}_0_${utils_1.JSONPointerToId(rowDefinerField.replace("%{row}", 0))}`;
|
|
571
|
+
nextId = `${id}_0_${(0, utils_1.JSONPointerToId)(rowDefinerField.replace("%{row}", 0))}`;
|
|
558
572
|
// Horizontal navigation from non row section to row field.
|
|
559
573
|
}
|
|
560
574
|
else {
|
|
@@ -571,7 +585,7 @@ const _arrayKeyFunctions = options => {
|
|
|
571
585
|
// Horizontal navigation inside row value fields.
|
|
572
586
|
}
|
|
573
587
|
else {
|
|
574
|
-
const idSuffix = utils_1.JSONPointerToId(rowValueField.replace("%{row}", currentRow - 1));
|
|
588
|
+
const idSuffix = (0, utils_1.JSONPointerToId)(rowValueField.replace("%{row}", currentRow - 1));
|
|
575
589
|
nextId = `${id}_${getProps().formData.length - 1}_${idSuffix}`;
|
|
576
590
|
}
|
|
577
591
|
}
|
|
@@ -595,7 +609,7 @@ const _arrayKeyFunctions = options => {
|
|
|
595
609
|
const containerId = currentSection !== undefined
|
|
596
610
|
? `${id}_${currentSection}-section`
|
|
597
611
|
: `${id}-section-definer`;
|
|
598
|
-
const tabbableOutsideContainer = utils_1.getTabbableFields(document.getElementById(containerId));
|
|
612
|
+
const tabbableOutsideContainer = (0, utils_1.getTabbableFields)(document.getElementById(containerId));
|
|
599
613
|
const tabbableIdx = tabbableOutsideContainer.findIndex(e => e === document.activeElement);
|
|
600
614
|
nextId = getProps().formContext.utils.findNearestParentSchemaElemId(tabbableOutsideContainer[tabbableIdx + amount]);
|
|
601
615
|
if (nextId === "root") {
|
|
@@ -608,7 +622,7 @@ const _arrayKeyFunctions = options => {
|
|
|
608
622
|
const { getProps, reverse } = props;
|
|
609
623
|
const id = getProps().idSchema.$id;
|
|
610
624
|
if (!reverse) {
|
|
611
|
-
const lastSectionElems = utils_1.getTabbableFields(document.getElementById(`${id}_${getProps().formData.length - 1}-section`));
|
|
625
|
+
const lastSectionElems = (0, utils_1.getTabbableFields)(document.getElementById(`${id}_${getProps().formData.length - 1}-section`));
|
|
612
626
|
const lastElem = lastSectionElems[lastSectionElems.length - 1];
|
|
613
627
|
if (document.activeElement === lastElem) {
|
|
614
628
|
return false;
|
|
@@ -616,10 +630,10 @@ const _arrayKeyFunctions = options => {
|
|
|
616
630
|
}
|
|
617
631
|
else {
|
|
618
632
|
const { rowDefinerField } = options;
|
|
619
|
-
const firstElem = utils_1.getTabbableFields(document.getElementById(`${id}_0-section`))[0];
|
|
633
|
+
const firstElem = (0, utils_1.getTabbableFields)(document.getElementById(`${id}_0-section`))[0];
|
|
620
634
|
if (document.activeElement === firstElem) {
|
|
621
|
-
const allTabbableFields = utils_1.getTabbableFields(react_dom_1.findDOMNode(getProps().formContext.formRef.current));
|
|
622
|
-
const matcher = new RegExp(utils_1.JSONPointerToId(rowDefinerField.replace("%{row}", "\\d+")));
|
|
635
|
+
const allTabbableFields = (0, utils_1.getTabbableFields)((0, react_dom_1.findDOMNode)(getProps().formContext.formRef.current));
|
|
636
|
+
const matcher = new RegExp((0, utils_1.JSONPointerToId)(rowDefinerField.replace("%{row}", "\\d+")));
|
|
623
637
|
const allTabbableFieldsWithoutRowDefinerInputs = allTabbableFields.filter(f => !f.id.match(matcher));
|
|
624
638
|
const input = getProps().formContext.utils.getNextInputInInputs(undefined, true, allTabbableFieldsWithoutRowDefinerInputs);
|
|
625
639
|
if (input) {
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -11,14 +15,25 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
11
15
|
}) : function(o, v) {
|
|
12
16
|
o["default"] = v;
|
|
13
17
|
});
|
|
14
|
-
var __importStar = (this && this.__importStar) || function (
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
21
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.default = SelectTreeField;
|
|
22
37
|
const React = __importStar(require("react"));
|
|
23
38
|
const utils_1 = require("../../utils");
|
|
24
39
|
const react_1 = require("react");
|
|
@@ -33,12 +48,12 @@ function SelectTreeField(props) {
|
|
|
33
48
|
const childProps = getChildProps(props);
|
|
34
49
|
const { onChange: parentOnChange } = props;
|
|
35
50
|
const { formData: childFormData } = childProps;
|
|
36
|
-
const onChange = react_1.useCallback((formData) => {
|
|
51
|
+
const onChange = (0, react_1.useCallback)((formData) => {
|
|
37
52
|
let selectNames = Object.keys(formData).sort((a, b) => { return +b - +a; });
|
|
38
53
|
for (let i in selectNames) {
|
|
39
54
|
if (formData[i] !== childFormData[i]) {
|
|
40
55
|
let value;
|
|
41
|
-
if (utils_1.isEmptyString(formData[i])) {
|
|
56
|
+
if ((0, utils_1.isEmptyString)(formData[i])) {
|
|
42
57
|
value = (+i > 0) ? formData[+i - 1] : undefined;
|
|
43
58
|
}
|
|
44
59
|
else {
|
|
@@ -52,7 +67,6 @@ function SelectTreeField(props) {
|
|
|
52
67
|
const SchemaField = props.registry.fields.SchemaField;
|
|
53
68
|
return React.createElement(SchemaField, Object.assign({}, props, childProps, { onChange: onChange }));
|
|
54
69
|
}
|
|
55
|
-
exports.default = SelectTreeField;
|
|
56
70
|
const getChildProps = (props) => {
|
|
57
71
|
let schema = { "type": "object", title: props.schema.title };
|
|
58
72
|
let formData = {};
|
|
@@ -61,7 +75,7 @@ const getChildProps = (props) => {
|
|
|
61
75
|
props.schema.oneOf.forEach((e) => {
|
|
62
76
|
dictionarifiedEnums[e.const] = e.title;
|
|
63
77
|
});
|
|
64
|
-
const tree = utils_1.getUiOptions(props.uiSchema).tree;
|
|
78
|
+
const tree = (0, utils_1.getUiOptions)(props.uiSchema).tree;
|
|
65
79
|
let levels = [];
|
|
66
80
|
let parentsMap = {};
|
|
67
81
|
let childrenMap = {};
|
|
@@ -98,7 +112,7 @@ const getChildProps = (props) => {
|
|
|
98
112
|
}
|
|
99
113
|
let searchTerm = props.formData;
|
|
100
114
|
let depth = 0;
|
|
101
|
-
if (!utils_1.isEmptyString(searchTerm)) {
|
|
115
|
+
if (!(0, utils_1.isEmptyString)(searchTerm)) {
|
|
102
116
|
for (const level of levels) {
|
|
103
117
|
if (level[searchTerm])
|
|
104
118
|
break;
|
|
@@ -109,17 +123,17 @@ const getChildProps = (props) => {
|
|
|
109
123
|
let d = depth;
|
|
110
124
|
while (d >= 0) {
|
|
111
125
|
formData[d] = n;
|
|
112
|
-
if (utils_1.isEmptyString(n)) {
|
|
126
|
+
if ((0, utils_1.isEmptyString)(n)) {
|
|
113
127
|
n = undefined; // object keys can't be "", so root key is in childrenMap 'undefined'.
|
|
114
128
|
}
|
|
115
129
|
addSelect(d, n, Object.keys(childrenMap[parentsMap[n]]));
|
|
116
130
|
d--;
|
|
117
131
|
n = parentsMap[n];
|
|
118
132
|
}
|
|
119
|
-
if (!utils_1.isEmptyString(searchTerm) && childrenMap[searchTerm] && Object.keys(childrenMap[searchTerm]).length) {
|
|
133
|
+
if (!(0, utils_1.isEmptyString)(searchTerm) && childrenMap[searchTerm] && Object.keys(childrenMap[searchTerm]).length) {
|
|
120
134
|
addSelect(depth + 1, searchTerm, Object.keys(childrenMap[searchTerm]));
|
|
121
135
|
formData[depth + 1] = undefined;
|
|
122
136
|
}
|
|
123
137
|
schema.properties = properties;
|
|
124
|
-
return { schema, formData, uiSchema: utils_1.getInnerUiSchema(props.uiSchema), idSchema };
|
|
138
|
+
return { schema, formData, uiSchema: (0, utils_1.getInnerUiSchema)(props.uiSchema), idSchema };
|
|
125
139
|
};
|