@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)
|
|
@@ -65,7 +79,7 @@ const popupMappers = {
|
|
|
65
79
|
}
|
|
66
80
|
};
|
|
67
81
|
const getPopupDataPromise = (props, itemFormData) => {
|
|
68
|
-
const { popupFields } = utils_1.getUiOptions(props.uiSchema);
|
|
82
|
+
const { popupFields } = (0, utils_1.getUiOptions)(props.uiSchema);
|
|
69
83
|
if (!props.formData)
|
|
70
84
|
return Promise.resolve({});
|
|
71
85
|
return Promise.all(popupFields.map(field => {
|
|
@@ -98,11 +112,11 @@ let SingleActiveArrayField = class SingleActiveArrayField extends React.Componen
|
|
|
98
112
|
this.getInitialActiveIdx = (props) => {
|
|
99
113
|
const { formData, uiSchema, schema } = props;
|
|
100
114
|
const formDataLength = (formData || []).length;
|
|
101
|
-
const options = utils_1.getUiOptions(uiSchema);
|
|
115
|
+
const options = (0, utils_1.getUiOptions)(uiSchema);
|
|
102
116
|
return (formDataLength === 1 || formDataLength === 0 && schema.minItems) ? 0 : options.initialActiveIdx;
|
|
103
117
|
};
|
|
104
118
|
this.updatePopups = (props) => {
|
|
105
|
-
const { popupFields } = utils_1.getUiOptions(this.props.uiSchema);
|
|
119
|
+
const { popupFields } = (0, utils_1.getUiOptions)(this.props.uiSchema);
|
|
106
120
|
let { popups } = this.state;
|
|
107
121
|
let count = 0;
|
|
108
122
|
if (popupFields)
|
|
@@ -126,7 +140,7 @@ let SingleActiveArrayField = class SingleActiveArrayField extends React.Componen
|
|
|
126
140
|
}
|
|
127
141
|
this.localContextKey = this.state.scrollHeightFixed;
|
|
128
142
|
this.localContext = Object.assign(Object.assign({}, this.props.formContext), { topOffset: this.props.formContext.topOffset + this.state.scrollHeightFixed });
|
|
129
|
-
this.localContext.utils = utils_1.ReactUtils(this.localContext);
|
|
143
|
+
this.localContext.utils = (0, utils_1.ReactUtils)(this.localContext);
|
|
130
144
|
return this.localContext;
|
|
131
145
|
};
|
|
132
146
|
this.updateRenderingMode = (normalRendering, callback) => {
|
|
@@ -139,7 +153,7 @@ let SingleActiveArrayField = class SingleActiveArrayField extends React.Componen
|
|
|
139
153
|
if (this.state.activeIdx === idx) {
|
|
140
154
|
idx = undefined;
|
|
141
155
|
}
|
|
142
|
-
const { onActiveChange } = utils_1.getUiOptions(this.props.uiSchema);
|
|
156
|
+
const { onActiveChange } = (0, utils_1.getUiOptions)(this.props.uiSchema);
|
|
143
157
|
onActiveChange ? onActiveChange(idx, prop, callback) : this.setState({ activeIdx: idx }, callback);
|
|
144
158
|
};
|
|
145
159
|
this.onDelete = (item) => (e) => {
|
|
@@ -165,10 +179,10 @@ let SingleActiveArrayField = class SingleActiveArrayField extends React.Componen
|
|
|
165
179
|
const idx = this.state.activeIdx !== undefined ?
|
|
166
180
|
this.state.activeIdx :
|
|
167
181
|
formData.length - 1;
|
|
168
|
-
ArrayFieldTemplate_1.beforeAdd(this.props, idx + 1);
|
|
182
|
+
(0, ArrayFieldTemplate_1.beforeAdd)(this.props, idx + 1);
|
|
169
183
|
this.props.onChange([
|
|
170
184
|
...formData.slice(0, idx + 1),
|
|
171
|
-
ArrayField_1.copyItemFunction(this, formData[idx])(...params),
|
|
185
|
+
(0, ArrayField_1.copyItemFunction)(this, formData[idx])(...params),
|
|
172
186
|
...formData.slice(idx + 1)
|
|
173
187
|
]);
|
|
174
188
|
},
|
|
@@ -192,13 +206,13 @@ let SingleActiveArrayField = class SingleActiveArrayField extends React.Componen
|
|
|
192
206
|
componentDidMount() {
|
|
193
207
|
this.mounted = true;
|
|
194
208
|
this.updatePopups(this.props);
|
|
195
|
-
if (utils_1.getUiOptions(this.props.uiSchema).receiveActiveIdxEvents !== false) {
|
|
209
|
+
if ((0, utils_1.getUiOptions)(this.props.uiSchema).receiveActiveIdxEvents !== false) {
|
|
196
210
|
this.props.formContext.services.customEvents.add(this.props.idSchema.$id, "activeIdx", this.onActiveChange);
|
|
197
211
|
}
|
|
198
212
|
}
|
|
199
213
|
componentWillUnmount() {
|
|
200
214
|
this.mounted = false;
|
|
201
|
-
if (utils_1.getUiOptions(this.props.uiSchema).receiveActiveIdxEvents !== false) {
|
|
215
|
+
if ((0, utils_1.getUiOptions)(this.props.uiSchema).receiveActiveIdxEvents !== false) {
|
|
202
216
|
this.props.formContext.services.customEvents.remove(this.props.idSchema.$id, "activeIdx", this.onActiveChange);
|
|
203
217
|
}
|
|
204
218
|
}
|
|
@@ -208,14 +222,14 @@ let SingleActiveArrayField = class SingleActiveArrayField extends React.Componen
|
|
|
208
222
|
this.updatePopups(props);
|
|
209
223
|
}
|
|
210
224
|
componentDidUpdate(prevProps, prevState) {
|
|
211
|
-
const options = utils_1.getUiOptions(this.props);
|
|
212
|
-
const prevOptions = utils_1.getUiOptions(prevProps);
|
|
225
|
+
const options = (0, utils_1.getUiOptions)(this.props);
|
|
226
|
+
const prevOptions = (0, utils_1.getUiOptions)(prevProps);
|
|
213
227
|
this.props.formContext.globals[`${this.props.idSchema.$id}.activeIdx`] = this.state.activeIdx;
|
|
214
|
-
const { idToFocusAfterNavigate, idToScrollAfterNavigate, focusOnNavigate = true, renderer = "accordion", affixed } = utils_1.getUiOptions(this.props.uiSchema);
|
|
228
|
+
const { idToFocusAfterNavigate, idToScrollAfterNavigate, focusOnNavigate = true, renderer = "accordion", affixed } = (0, utils_1.getUiOptions)(this.props.uiSchema);
|
|
215
229
|
if (renderer === "uncontrolled")
|
|
216
230
|
return;
|
|
217
231
|
if ((prevProps.formData || []).length === (this.props.formData || []).length && ("activeIdx" in options && options.activeIdx !== prevOptions.activeIdx || (!("activeIdx" in options) && this.state.activeIdx !== prevState.activeIdx))) {
|
|
218
|
-
const id = `${this.props.idSchema.$id}_${utils_1.getFormDataIndex(this.state.activeIdx, this.props.uiSchema)}`;
|
|
232
|
+
const id = `${this.props.idSchema.$id}_${(0, utils_1.getFormDataIndex)(this.state.activeIdx, this.props.uiSchema)}`;
|
|
219
233
|
const idToScroll = idToScrollAfterNavigate
|
|
220
234
|
? idToScrollAfterNavigate
|
|
221
235
|
: !affixed && (renderer === "accordion" || renderer === "pager")
|
|
@@ -237,7 +251,7 @@ let SingleActiveArrayField = class SingleActiveArrayField extends React.Componen
|
|
|
237
251
|
}
|
|
238
252
|
getStateFromProps(props) {
|
|
239
253
|
const state = {};
|
|
240
|
-
const options = utils_1.getUiOptions(props.uiSchema);
|
|
254
|
+
const options = (0, utils_1.getUiOptions)(props.uiSchema);
|
|
241
255
|
if ("activeIdx" in options) {
|
|
242
256
|
state.activeIdx = options.activeIdx;
|
|
243
257
|
}
|
|
@@ -247,13 +261,13 @@ let SingleActiveArrayField = class SingleActiveArrayField extends React.Componen
|
|
|
247
261
|
if (!state.activeIdx && this.props && props.idSchema.$id !== this.props.idSchema.$id) {
|
|
248
262
|
state.activeIdx = this.getInitialActiveIdx(props);
|
|
249
263
|
}
|
|
250
|
-
if (options.sortCols && options.sortCols !== utils_1.getUiOptions(this.props.uiSchema).sortCols) {
|
|
264
|
+
if (options.sortCols && options.sortCols !== (0, utils_1.getUiOptions)(this.props.uiSchema).sortCols) {
|
|
251
265
|
state.activeIdx = undefined;
|
|
252
266
|
}
|
|
253
267
|
return state;
|
|
254
268
|
}
|
|
255
269
|
render() {
|
|
256
|
-
const { renderer = "accordion", tableActiveItemClassNames } = utils_1.getUiOptions(this.props.uiSchema);
|
|
270
|
+
const { renderer = "accordion", tableActiveItemClassNames } = (0, utils_1.getUiOptions)(this.props.uiSchema);
|
|
257
271
|
let ArrayFieldTemplate = undefined;
|
|
258
272
|
switch (renderer) {
|
|
259
273
|
case "accordion":
|
|
@@ -273,9 +287,9 @@ let SingleActiveArrayField = class SingleActiveArrayField extends React.Componen
|
|
|
273
287
|
}
|
|
274
288
|
const formContext = Object.assign(Object.assign({}, this.getLocalFormContext()), { this: this, prevActiveIdx: this.prevActiveIdx, activeIdx: this.state.activeIdx });
|
|
275
289
|
const { registry: { fields: { ArrayField } } } = this.props;
|
|
276
|
-
const { buttons = [], buttonDefinitions } = utils_1.getUiOptions(this.props.uiSchema);
|
|
277
|
-
let uiSchema = Object.assign(Object.assign({}, this.props.uiSchema), { "ui:field": undefined, "ui:classNames": undefined, "ui:options": Object.assign(Object.assign({}, utils_1.getUiOptions(this.props.uiSchema)), { buttons, buttonDefinitions: buttonDefinitions
|
|
278
|
-
? deepmerge_1.default(this.buttonDefinitions, buttonDefinitions)
|
|
290
|
+
const { buttons = [], buttonDefinitions } = (0, utils_1.getUiOptions)(this.props.uiSchema);
|
|
291
|
+
let uiSchema = Object.assign(Object.assign({}, this.props.uiSchema), { "ui:field": undefined, "ui:classNames": undefined, "ui:options": Object.assign(Object.assign({}, (0, utils_1.getUiOptions)(this.props.uiSchema)), { buttons, buttonDefinitions: buttonDefinitions
|
|
292
|
+
? (0, deepmerge_1.default)(this.buttonDefinitions, buttonDefinitions)
|
|
279
293
|
: this.buttonDefinitions }) });
|
|
280
294
|
if (renderer === "table" && tableActiveItemClassNames && !this.state.normalRendering) {
|
|
281
295
|
uiSchema = Object.assign(Object.assign({}, uiSchema), { items: Object.assign(Object.assign({}, uiSchema.items), { "ui:classNames": tableActiveItemClassNames }) });
|
|
@@ -321,7 +335,7 @@ function handlesButtonsAndFocus(ComposedComponent) {
|
|
|
321
335
|
this.getFocusHandlers = (props) => {
|
|
322
336
|
const that = props.formContext.this;
|
|
323
337
|
return props.items.map((_, i) => {
|
|
324
|
-
const idx = utils_1.getFormDataIndex(i, that.props.uiSchema);
|
|
338
|
+
const idx = (0, utils_1.getFormDataIndex)(i, that.props.uiSchema);
|
|
325
339
|
return [`${that.props.idSchema.$id}_${idx}`, () => {
|
|
326
340
|
if (!isActive(i, that.state.activeIdx))
|
|
327
341
|
return new Promise(resolve => {
|
|
@@ -333,7 +347,7 @@ function handlesButtonsAndFocus(ComposedComponent) {
|
|
|
333
347
|
this.getSetOpenHandlers = (props) => {
|
|
334
348
|
const that = props.formContext.this;
|
|
335
349
|
return props.items.map((_, i) => {
|
|
336
|
-
const idx = utils_1.getFormDataIndex(i, that.props.uiSchema);
|
|
350
|
+
const idx = (0, utils_1.getFormDataIndex)(i, that.props.uiSchema);
|
|
337
351
|
return [`${that.props.idSchema.$id}_${idx}`, (open) => {
|
|
338
352
|
if (!Array.isArray(that.state.activeIdx)) {
|
|
339
353
|
return;
|
|
@@ -347,7 +361,7 @@ function handlesButtonsAndFocus(ComposedComponent) {
|
|
|
347
361
|
};
|
|
348
362
|
}
|
|
349
363
|
getKeyHandlers(props) {
|
|
350
|
-
const { renderer = "accordion" } = utils_1.getUiOptions(props.uiSchema);
|
|
364
|
+
const { renderer = "accordion" } = (0, utils_1.getUiOptions)(props.uiSchema);
|
|
351
365
|
const that = props.formContext.this;
|
|
352
366
|
return [ArrayFieldTemplate_1.arrayKeyFunctions, {
|
|
353
367
|
getProps: () => this.props,
|
|
@@ -407,7 +421,7 @@ function handlesButtonsAndFocus(ComposedComponent) {
|
|
|
407
421
|
const that = props.formContext.this;
|
|
408
422
|
const handlers = [];
|
|
409
423
|
if (that.state.activeIdx !== undefined) {
|
|
410
|
-
const activeIdxs = utils_1.asArray(that.state.activeIdx);
|
|
424
|
+
const activeIdxs = (0, utils_1.asArray)(that.state.activeIdx);
|
|
411
425
|
activeIdxs.forEach((idx) => {
|
|
412
426
|
const id = `${props.idSchema.$id}_${idx}`;
|
|
413
427
|
handlers.push([id, ArrayFieldTemplate_1.arrayItemKeyFunctions, { id, getProps: () => this.props, getDeleteButton: () => {
|
|
@@ -418,7 +432,7 @@ function handlesButtonsAndFocus(ComposedComponent) {
|
|
|
418
432
|
return handlers;
|
|
419
433
|
}
|
|
420
434
|
};
|
|
421
|
-
SingleAndMultiActiveArrayTemplateField.displayName = utils_1.getReactComponentName(ComposedComponent);
|
|
435
|
+
SingleAndMultiActiveArrayTemplateField.displayName = (0, utils_1.getReactComponentName)(ComposedComponent);
|
|
422
436
|
SingleAndMultiActiveArrayTemplateField = __decorate([
|
|
423
437
|
ArrayFieldTemplate_1.handlesArrayKeys
|
|
424
438
|
], SingleAndMultiActiveArrayTemplateField);
|
|
@@ -426,15 +440,15 @@ function handlesButtonsAndFocus(ComposedComponent) {
|
|
|
426
440
|
}
|
|
427
441
|
// Swallow unknown prop warnings.
|
|
428
442
|
const ButtonsWrapper = ({ props }) => {
|
|
429
|
-
const buttons = utils_1.getUiOptions(props.uiSchema).buttons;
|
|
430
|
-
return React.createElement("div", null, ArrayFieldTemplate_1.getButtonElems(buttons, props));
|
|
443
|
+
const buttons = (0, utils_1.getUiOptions)(props.uiSchema).buttons;
|
|
444
|
+
return React.createElement("div", null, (0, ArrayFieldTemplate_1.getButtonElems)(buttons, props));
|
|
431
445
|
};
|
|
432
446
|
const AccordionButtonsWrapper = ({ props, position }) => {
|
|
433
|
-
const buttons = ArrayFieldTemplate_1.getButtonsForPosition(props, ArrayFieldTemplate_1.getButtons(utils_1.getUiOptions(props.uiSchema).buttons, props), position);
|
|
447
|
+
const buttons = (0, ArrayFieldTemplate_1.getButtonsForPosition)(props, (0, ArrayFieldTemplate_1.getButtons)((0, utils_1.getUiOptions)(props.uiSchema).buttons, props), position);
|
|
434
448
|
const { Row, Col } = React.useContext(ReactContext_1.default).theme;
|
|
435
449
|
if (!buttons)
|
|
436
450
|
return null;
|
|
437
|
-
const cols = Object.keys(utils_1.getBootstrapCols()).reduce((cols, colType) => {
|
|
451
|
+
const cols = Object.keys((0, utils_1.getBootstrapCols)()).reduce((cols, colType) => {
|
|
438
452
|
cols[colType] = (colType === "xs" || buttons.length > 3) ? 12 : 12 / buttons.length;
|
|
439
453
|
return cols;
|
|
440
454
|
}, {});
|
|
@@ -457,15 +471,15 @@ let AccordionArrayFieldTemplate = class AccordionArrayFieldTemplate extends Reac
|
|
|
457
471
|
const that = this.props.formContext.this;
|
|
458
472
|
const arrayFieldTemplateProps = this.props;
|
|
459
473
|
const activeIdx = that.state.activeIdx;
|
|
460
|
-
const { confirmDelete, closeButton, affixed } = utils_1.getUiOptions(arrayFieldTemplateProps.uiSchema);
|
|
474
|
+
const { confirmDelete, closeButton, affixed } = (0, utils_1.getUiOptions)(arrayFieldTemplateProps.uiSchema);
|
|
461
475
|
const { translations } = this.props.formContext;
|
|
462
476
|
const { disabled, readonly } = arrayFieldTemplateProps;
|
|
463
477
|
const containerRefs = {};
|
|
464
|
-
utils_1.asArray(activeIdx).forEach(idx => {
|
|
478
|
+
(0, utils_1.asArray)(activeIdx).forEach(idx => {
|
|
465
479
|
containerRefs[idx] = React.createRef();
|
|
466
480
|
});
|
|
467
481
|
const getHeader = (item, idx) => {
|
|
468
|
-
let header = React.createElement(AccordionHeader, { ref: this.setHeaderRef, that: that, idx: idx, wrapperClassName: "panel-title", className: "laji-form-panel-header laji-form-clickable-panel-header laji-form-accordion-header" }, item.hasRemove && React.createElement(components_1.DeleteButton, { id: `${that.props.idSchema.$id}_${utils_1.getFormDataIndex(idx, that.props.uiSchema)}`, disabled: disabled || readonly, ref: this.setDeleteButtonRef(idx), className: "pull-right", confirm: confirmDelete, translations: translations, onClick: that.onDelete(item) }));
|
|
482
|
+
let header = React.createElement(AccordionHeader, { ref: this.setHeaderRef, that: that, idx: idx, wrapperClassName: "panel-title", className: "laji-form-panel-header laji-form-clickable-panel-header laji-form-accordion-header" }, item.hasRemove && React.createElement(components_1.DeleteButton, { id: `${that.props.idSchema.$id}_${(0, utils_1.getFormDataIndex)(idx, that.props.uiSchema)}`, disabled: disabled || readonly, ref: this.setDeleteButtonRef(idx), className: "pull-right", confirm: confirmDelete, translations: translations, onClick: that.onDelete(item) }));
|
|
469
483
|
if (affixed && isActive(idx, activeIdx)) {
|
|
470
484
|
const offset = this.props.formContext.topOffset - (that.state.scrollHeightFixed);
|
|
471
485
|
header = (React.createElement(components_1.Affix, { containerRef: containerRefs[idx], topOffset: offset, onAffixChange: this.onHeaderAffixChange }, header));
|
|
@@ -476,7 +490,7 @@ let AccordionArrayFieldTemplate = class AccordionArrayFieldTemplate extends Reac
|
|
|
476
490
|
return (React.createElement("div", { className: "laji-form-single-active-array no-transition" },
|
|
477
491
|
React.createElement(AccordionButtonsWrapper, { props: arrayFieldTemplateProps, position: "top" }),
|
|
478
492
|
React.createElement(Accordion, { onSelect: this.onSelect, activeKey: activeIdx === undefined ? -1 : activeIdx, id: `${that.props.idSchema.$id}-accordion` },
|
|
479
|
-
arrayFieldTemplateProps.items.map((item, idx) => (React.createElement(Panel, { key: idx, ref: containerRefs[idx], id: `${this.props.idSchema.$id}_${utils_1.getFormDataIndex(idx, that.props.uiSchema)}-panel`, className: "laji-form-panel laji-form-clickable-panel", eventKey: idx, variant: utils_1.filteredErrors(that.props.errorSchema)[utils_1.getFormDataIndex(idx, that.props.uiSchema)] ? "danger" : "default" },
|
|
493
|
+
arrayFieldTemplateProps.items.map((item, idx) => (React.createElement(Panel, { key: idx, ref: containerRefs[idx], id: `${this.props.idSchema.$id}_${(0, utils_1.getFormDataIndex)(idx, that.props.uiSchema)}-panel`, className: "laji-form-panel laji-form-clickable-panel", eventKey: idx, variant: (0, utils_1.filteredErrors)(that.props.errorSchema)[(0, utils_1.getFormDataIndex)(idx, that.props.uiSchema)] ? "danger" : "default" },
|
|
480
494
|
React.createElement(Panel.Heading, null, getHeader(item, idx)),
|
|
481
495
|
isActive(idx, activeIdx) ? (React.createElement(Panel.Body, null,
|
|
482
496
|
item.children,
|
|
@@ -487,11 +501,11 @@ let AccordionArrayFieldTemplate = class AccordionArrayFieldTemplate extends Reac
|
|
|
487
501
|
React.createElement(AccordionButtonsWrapper, { props: arrayFieldTemplateProps, position: "bottom" }))));
|
|
488
502
|
}
|
|
489
503
|
};
|
|
504
|
+
exports.AccordionArrayFieldTemplate = AccordionArrayFieldTemplate;
|
|
490
505
|
AccordionArrayFieldTemplate.contextType = ReactContext_1.default;
|
|
491
|
-
AccordionArrayFieldTemplate = __decorate([
|
|
506
|
+
exports.AccordionArrayFieldTemplate = AccordionArrayFieldTemplate = __decorate([
|
|
492
507
|
handlesButtonsAndFocus
|
|
493
508
|
], AccordionArrayFieldTemplate);
|
|
494
|
-
exports.AccordionArrayFieldTemplate = AccordionArrayFieldTemplate;
|
|
495
509
|
// does not support MultiActiveArrayField
|
|
496
510
|
let PagerArrayFieldTemplate = class PagerArrayFieldTemplate extends React.Component {
|
|
497
511
|
constructor() {
|
|
@@ -513,7 +527,7 @@ let PagerArrayFieldTemplate = class PagerArrayFieldTemplate extends React.Compon
|
|
|
513
527
|
const that = this.props.formContext.this;
|
|
514
528
|
const arrayTemplateFieldProps = this.props;
|
|
515
529
|
const { translations } = that.props.formContext;
|
|
516
|
-
const { buttons, affixed, headerClassName, confirmDelete } = utils_1.getUiOptions(arrayTemplateFieldProps.uiSchema);
|
|
530
|
+
const { buttons, affixed, headerClassName, confirmDelete } = (0, utils_1.getUiOptions)(arrayTemplateFieldProps.uiSchema);
|
|
517
531
|
const activeIdx = that.state.activeIdx;
|
|
518
532
|
const { Pager } = this.context.theme;
|
|
519
533
|
let header = (React.createElement("div", { className: `laji-form-panel-header laji-form-accordion-header${headerClassName ? ` ${headerClassName}` : ""}`, ref: this.setHeaderRef },
|
|
@@ -538,10 +552,10 @@ let PagerArrayFieldTemplate = class PagerArrayFieldTemplate extends React.Compon
|
|
|
538
552
|
React.createElement(Panel, { className: "laji-form-panel" },
|
|
539
553
|
React.createElement(Panel.Heading, null, header),
|
|
540
554
|
React.createElement(Panel.Body, null,
|
|
541
|
-
React.createElement("div", { key: utils_1.getUUID(this.props.formData[activeIdx]) || activeIdx }, activeIdx !== undefined && arrayTemplateFieldProps.items && arrayTemplateFieldProps.items[activeIdx] ? arrayTemplateFieldProps.items[activeIdx].children : null))),
|
|
542
|
-
ArrayFieldTemplate_1.getButtonElems(buttons, arrayTemplateFieldProps)),
|
|
555
|
+
React.createElement("div", { key: (0, utils_1.getUUID)(this.props.formData[activeIdx]) || activeIdx }, activeIdx !== undefined && arrayTemplateFieldProps.items && arrayTemplateFieldProps.items[activeIdx] ? arrayTemplateFieldProps.items[activeIdx].children : null))),
|
|
556
|
+
(0, ArrayFieldTemplate_1.getButtonElems)(buttons, arrayTemplateFieldProps)),
|
|
543
557
|
React.createElement("div", { className: "laji-form-field-template-buttons" }, activeIdx !== undefined && arrayTemplateFieldProps.items[activeIdx].hasRemove
|
|
544
|
-
? (React.createElement(components_1.DeleteButton, { id: `${that.props.idSchema.$id}_${utils_1.getFormDataIndex(activeIdx, that.props.uiSchema)}`, ref: this.setDeleteButtonRef(activeIdx), className: "pull-right", confirm: confirmDelete, translations: translations, onClick: that.onDelete(arrayTemplateFieldProps.items[activeIdx]) }))
|
|
558
|
+
? (React.createElement(components_1.DeleteButton, { id: `${that.props.idSchema.$id}_${(0, utils_1.getFormDataIndex)(activeIdx, that.props.uiSchema)}`, ref: this.setDeleteButtonRef(activeIdx), className: "pull-right", confirm: confirmDelete, translations: translations, onClick: that.onDelete(arrayTemplateFieldProps.items[activeIdx]) }))
|
|
545
559
|
: null))));
|
|
546
560
|
}
|
|
547
561
|
};
|
|
@@ -555,14 +569,14 @@ let UncontrolledArrayFieldTemplate = class UncontrolledArrayFieldTemplate extend
|
|
|
555
569
|
const that = this.props.formContext.this;
|
|
556
570
|
const arrayTemplateFieldProps = this.props;
|
|
557
571
|
const activeIdx = that.state.activeIdx;
|
|
558
|
-
const TitleFieldTemplate = utils_3.getTemplate("TitleFieldTemplate", this.props.registry, utils_1.getUiOptions(this.props.uiSchema));
|
|
559
|
-
const DescriptionFieldTemplate = utils_3.getTemplate("DescriptionFieldTemplate", this.props.registry, utils_1.getUiOptions(this.props.uiSchema));
|
|
572
|
+
const TitleFieldTemplate = (0, utils_3.getTemplate)("TitleFieldTemplate", this.props.registry, (0, utils_1.getUiOptions)(this.props.uiSchema));
|
|
573
|
+
const DescriptionFieldTemplate = (0, utils_3.getTemplate)("DescriptionFieldTemplate", this.props.registry, (0, utils_1.getUiOptions)(this.props.uiSchema));
|
|
560
574
|
const { Label } = this.props.formContext;
|
|
561
|
-
const Title = utils_1.getUiOptions(that.props.uiSchema).renderTitleAsLabel ? Label : TitleFieldTemplate;
|
|
562
|
-
const title = utils_1.getTitle(this.props, activeIdx);
|
|
563
|
-
const titleUiSchema = Object.assign(Object.assign({}, arrayTemplateFieldProps.uiSchema), { "ui:options": Object.assign(Object.assign({}, utils_1.getUiOptions(arrayTemplateFieldProps.uiSchema)), { titleFormatters: that.props.uiSchema.titleFormatters }) });
|
|
575
|
+
const Title = (0, utils_1.getUiOptions)(that.props.uiSchema).renderTitleAsLabel ? Label : TitleFieldTemplate;
|
|
576
|
+
const title = (0, utils_1.getTitle)(this.props, activeIdx);
|
|
577
|
+
const titleUiSchema = Object.assign(Object.assign({}, arrayTemplateFieldProps.uiSchema), { "ui:options": Object.assign(Object.assign({}, (0, utils_1.getUiOptions)(arrayTemplateFieldProps.uiSchema)), { titleFormatters: that.props.uiSchema.titleFormatters }) });
|
|
564
578
|
return activeIdx !== undefined && arrayTemplateFieldProps.items && arrayTemplateFieldProps.items[activeIdx] ?
|
|
565
|
-
React.createElement("div", { key: utils_1.getUUID(this.props.formData[activeIdx]) || activeIdx },
|
|
579
|
+
React.createElement("div", { key: (0, utils_1.getUUID)(this.props.formData[activeIdx]) || activeIdx },
|
|
566
580
|
React.createElement(Title, { title: title, label: title, schema: this.props.schema, uiSchema: titleUiSchema, formData: that.props.formData, registry: this.props.registry, id: this.props.idSchema.$id }),
|
|
567
581
|
React.createElement(DescriptionFieldTemplate, { description: this.props.uiSchema["ui:description"], schema: this.props.schema }),
|
|
568
582
|
arrayTemplateFieldProps.items[activeIdx].children)
|
|
@@ -583,12 +597,12 @@ let TableArrayFieldTemplate = class TableArrayFieldTemplate extends React.Compon
|
|
|
583
597
|
// Sets state.normalRendering on if screen is too small for table layout.
|
|
584
598
|
this.updateRenderingMode = (callback) => {
|
|
585
599
|
const _callback = (updateLayout = true) => {
|
|
586
|
-
if (updateLayout && this._lastWidth && utils_1.pixelsToBsSize(this._lastWidth) !== utils_1.pixelsToBsSize(window.innerWidth)) {
|
|
600
|
+
if (updateLayout && this._lastWidth && (0, utils_1.pixelsToBsSize)(this._lastWidth) !== (0, utils_1.pixelsToBsSize)(window.innerWidth)) {
|
|
587
601
|
this.updateLayout(null, callback);
|
|
588
602
|
}
|
|
589
603
|
};
|
|
590
604
|
const that = this.props.formContext.this;
|
|
591
|
-
const { normalRenderingTreshold } = utils_1.getUiOptions(this.props.uiSchema);
|
|
605
|
+
const { normalRenderingTreshold } = (0, utils_1.getUiOptions)(this.props.uiSchema);
|
|
592
606
|
let initialized = false;
|
|
593
607
|
if (Object.keys(this.state).length === 0) {
|
|
594
608
|
initialized = true;
|
|
@@ -603,7 +617,7 @@ let TableArrayFieldTemplate = class TableArrayFieldTemplate extends React.Compon
|
|
|
603
617
|
}
|
|
604
618
|
return;
|
|
605
619
|
}
|
|
606
|
-
let treshold = utils_1.bsSizeToPixels(normalRenderingTreshold);
|
|
620
|
+
let treshold = (0, utils_1.bsSizeToPixels)(normalRenderingTreshold);
|
|
607
621
|
requestAnimationFrame(() => {
|
|
608
622
|
let normalRendering = undefined;
|
|
609
623
|
if (!this.state.normalRendering && window.innerWidth <= treshold) {
|
|
@@ -650,7 +664,7 @@ let TableArrayFieldTemplate = class TableArrayFieldTemplate extends React.Compon
|
|
|
650
664
|
this.getStyles = () => {
|
|
651
665
|
const that = this.props.formContext.this;
|
|
652
666
|
const { activeIdx } = that.state;
|
|
653
|
-
const { activeHeightOffset = 0 } = utils_1.getUiOptions(this.props.uiSchema);
|
|
667
|
+
const { activeHeightOffset = 0 } = (0, utils_1.getUiOptions)(this.props.uiSchema);
|
|
654
668
|
const rowElem = this.itemElems[activeIdx];
|
|
655
669
|
if (!rowElem || !this.activeElem)
|
|
656
670
|
return;
|
|
@@ -674,22 +688,22 @@ let TableArrayFieldTemplate = class TableArrayFieldTemplate extends React.Compon
|
|
|
674
688
|
});
|
|
675
689
|
return that.deleteButtonRefSetters[idx];
|
|
676
690
|
};
|
|
677
|
-
this.customEventSender = memoizee_1.default((eventName) => memoizee_1.default((idx) => () => {
|
|
691
|
+
this.customEventSender = (0, memoizee_1.default)((eventName) => (0, memoizee_1.default)((idx) => () => {
|
|
678
692
|
const that = this.props.formContext.this;
|
|
679
693
|
that.props.formContext.services.customEvents.send(that.props.idSchema.$id, eventName, { idx });
|
|
680
694
|
}));
|
|
681
|
-
this.onKeyDownActivate = memoizee_1.default((idx) => (e) => {
|
|
695
|
+
this.onKeyDownActivate = (0, memoizee_1.default)((idx) => (e) => {
|
|
682
696
|
if (idx !== this.state.activeIdx && (e.key === " " || e.key === "Enter")) {
|
|
683
697
|
this.getOnChangeActive(idx)();
|
|
684
698
|
e.preventDefault();
|
|
685
699
|
e.stopPropagation();
|
|
686
700
|
}
|
|
687
701
|
});
|
|
688
|
-
this.getOnChangeActive = memoizee_1.default(idx => () => {
|
|
702
|
+
this.getOnChangeActive = (0, memoizee_1.default)(idx => () => {
|
|
689
703
|
const that = this.props.formContext.this;
|
|
690
704
|
idx !== that.state.activeIdx && that.onActiveChange(idx, undefined, this.updateLayout);
|
|
691
705
|
});
|
|
692
|
-
this.getOnHeaderClick = memoizee_1.default((col, onSortToggle) => () => onSortToggle(col));
|
|
706
|
+
this.getOnHeaderClick = (0, memoizee_1.default)((col, onSortToggle) => () => onSortToggle(col));
|
|
693
707
|
this.state = {};
|
|
694
708
|
this.itemElems = [];
|
|
695
709
|
this.resizeObserver = new ResizeObserver(this.onResize);
|
|
@@ -734,12 +748,12 @@ let TableArrayFieldTemplate = class TableArrayFieldTemplate extends React.Compon
|
|
|
734
748
|
}
|
|
735
749
|
}
|
|
736
750
|
getSortableHeaderProps(col, props) {
|
|
737
|
-
const { onSortToggle, sortCols, ui, sortableColumns, sortColTooltips } = utils_1.getUiOptions(props.uiSchema);
|
|
751
|
+
const { onSortToggle, sortCols, ui, sortableColumns, sortColTooltips } = (0, utils_1.getUiOptions)(props.uiSchema);
|
|
738
752
|
if (!onSortToggle || sortableColumns && !sortableColumns.includes(col)) {
|
|
739
753
|
return {};
|
|
740
754
|
}
|
|
741
755
|
const sortCol = sortCols.find(({ name }) => name === col);
|
|
742
|
-
const className = utils_1.classNames((sortCol === null || sortCol === void 0 ? void 0 : sortCol.descending)
|
|
756
|
+
const className = (0, utils_1.classNames)((sortCol === null || sortCol === void 0 ? void 0 : sortCol.descending)
|
|
743
757
|
? "laji-form-col-desc"
|
|
744
758
|
: (sortCol === null || sortCol === void 0 ? void 0 : sortCol.descending) === false
|
|
745
759
|
? "laji-form-col-asc"
|
|
@@ -752,26 +766,26 @@ let TableArrayFieldTemplate = class TableArrayFieldTemplate extends React.Compon
|
|
|
752
766
|
return React.createElement(ArrayFieldTemplate_1.default, Object.assign({}, this.props));
|
|
753
767
|
}
|
|
754
768
|
const { schema, uiSchema = {}, formData = [], items, disabled, readonly } = this.props;
|
|
755
|
-
const TitleFieldTemplate = utils_3.getTemplate("TitleFieldTemplate", this.props.registry, utils_1.getUiOptions(uiSchema));
|
|
756
|
-
const DescriptionFieldTemplate = utils_3.getTemplate("DescriptionFieldTemplate", this.props.registry, utils_1.getUiOptions(uiSchema));
|
|
757
|
-
const { renderTitleAsLabel, formatters = {}, shownColumns = [], removable = true } = utils_1.getUiOptions(uiSchema);
|
|
769
|
+
const TitleFieldTemplate = (0, utils_3.getTemplate)("TitleFieldTemplate", this.props.registry, (0, utils_1.getUiOptions)(uiSchema));
|
|
770
|
+
const DescriptionFieldTemplate = (0, utils_3.getTemplate)("DescriptionFieldTemplate", this.props.registry, (0, utils_1.getUiOptions)(uiSchema));
|
|
771
|
+
const { renderTitleAsLabel, formatters = {}, shownColumns = [], removable = true } = (0, utils_1.getUiOptions)(uiSchema);
|
|
758
772
|
const { Label } = this.props.formContext;
|
|
759
773
|
const Title = renderTitleAsLabel ? Label : TitleFieldTemplate;
|
|
760
774
|
const foundProps = {};
|
|
761
|
-
const shownColumnsDict = utils_1.dictionarify(shownColumns);
|
|
762
|
-
const { tmpImgs = {} } = Context_1.default("IMAGE_ARRAY_FIELD");
|
|
775
|
+
const shownColumnsDict = (0, utils_1.dictionarify)(shownColumns);
|
|
776
|
+
const { tmpImgs = {} } = (0, Context_1.default)("IMAGE_ARRAY_FIELD");
|
|
763
777
|
let cols = Object.keys(schema.items.properties).reduce((_cols, prop) => {
|
|
764
778
|
if (formData.some(item => {
|
|
765
779
|
const found = shownColumnsDict[prop]
|
|
766
780
|
|| foundProps[prop]
|
|
767
781
|
|| (prop in item
|
|
768
|
-
&& !utils_1.isEmptyString(item[prop])
|
|
782
|
+
&& !(0, utils_1.isEmptyString)(item[prop])
|
|
769
783
|
&& (!Array.isArray(item[prop])
|
|
770
784
|
|| Array.isArray(item[prop]) && !item[prop].every(utils_1.isEmptyString))
|
|
771
|
-
&& !utils_1.isDefaultData(item[prop], schema.items.properties[prop])
|
|
772
|
-
&& !utils_1.isHidden(uiSchema.items || {}, prop)
|
|
773
|
-
&& !utils_1.isHidden(utils_1.getNestedTailUiSchema(uiSchema.items || {}), prop))
|
|
774
|
-
|| uiSchema.items && uiSchema.items[prop] && uiSchema.items[prop]["ui:field"] === "ImageArrayField" && utils_1.getUUID(item) && tmpImgs[utils_1.getUUID(item)];
|
|
785
|
+
&& !(0, utils_1.isDefaultData)(item[prop], schema.items.properties[prop])
|
|
786
|
+
&& !(0, utils_1.isHidden)(uiSchema.items || {}, prop)
|
|
787
|
+
&& !(0, utils_1.isHidden)((0, utils_1.getNestedTailUiSchema)(uiSchema.items || {}), prop))
|
|
788
|
+
|| uiSchema.items && uiSchema.items[prop] && uiSchema.items[prop]["ui:field"] === "ImageArrayField" && (0, utils_1.getUUID)(item) && tmpImgs[(0, utils_1.getUUID)(item)];
|
|
775
789
|
if (found)
|
|
776
790
|
foundProps[prop] = true;
|
|
777
791
|
return found;
|
|
@@ -782,18 +796,18 @@ let TableArrayFieldTemplate = class TableArrayFieldTemplate extends React.Compon
|
|
|
782
796
|
}, []);
|
|
783
797
|
const { "ui:order": order } = (uiSchema.items || {});
|
|
784
798
|
if (order)
|
|
785
|
-
cols = utils_2.orderProperties(cols, order.filter(field => field === "*" || foundProps[field]));
|
|
799
|
+
cols = (0, utils_2.orderProperties)(cols, order.filter(field => field === "*" || foundProps[field]));
|
|
786
800
|
const that = this.props.formContext.this;
|
|
787
801
|
const { errorSchema } = that.props;
|
|
788
802
|
const activeIdx = that.state.activeIdx;
|
|
789
|
-
const { confirmDelete } = utils_1.getUiOptions(uiSchema);
|
|
803
|
+
const { confirmDelete } = (0, utils_1.getUiOptions)(uiSchema);
|
|
790
804
|
const getDeleteButtonFor = (idx, item) => {
|
|
791
|
-
return removable && React.createElement(components_1.DeleteButton, { id: `${that.props.idSchema.$id}_${idx}`, disabled: disabled || readonly, ref: this.getDeleteButtonRef(idx), key: utils_1.getUUID(this.props.formData[item.index]) || item.key, confirm: confirmDelete, translations: this.props.formContext.translations, onClick: that.onDelete(item) });
|
|
805
|
+
return removable && React.createElement(components_1.DeleteButton, { id: `${that.props.idSchema.$id}_${idx}`, disabled: disabled || readonly, ref: this.getDeleteButtonRef(idx), key: (0, utils_1.getUUID)(this.props.formData[item.index]) || item.key, confirm: confirmDelete, translations: this.props.formContext.translations, onClick: that.onDelete(item) });
|
|
792
806
|
};
|
|
793
807
|
const setItemRef = idx => elem => {
|
|
794
808
|
this.itemElems[idx] = elem;
|
|
795
809
|
};
|
|
796
|
-
const title = utils_1.getTitle(this.props, that.state.activeIdx);
|
|
810
|
+
const title = (0, utils_1.getTitle)(this.props, that.state.activeIdx);
|
|
797
811
|
const onMouseEnter = this.customEventSender("startHighlight");
|
|
798
812
|
const onMouseLeave = this.customEventSender("endHighlight");
|
|
799
813
|
const { Table } = this.context.theme;
|
|
@@ -808,7 +822,7 @@ let TableArrayFieldTemplate = class TableArrayFieldTemplate extends React.Compon
|
|
|
808
822
|
cols.length ? cols.map(col => {
|
|
809
823
|
const sortableHeaderProps = this.getSortableHeaderProps(col, this.props);
|
|
810
824
|
const { ui, tooltip } = sortableHeaderProps, _sortableHeaderProps = __rest(sortableHeaderProps, ["ui", "tooltip"]);
|
|
811
|
-
const className = utils_1.classNames("darker", sortableHeaderProps.className);
|
|
825
|
+
const className = (0, utils_1.classNames)("darker", sortableHeaderProps.className);
|
|
812
826
|
return (React.createElement(components_1.TooltipComponent, { key: col, tooltip: tooltip, placement: "top", id: `${this.props.idSchema[col].$id}-header` },
|
|
813
827
|
React.createElement("th", Object.assign({ key: col }, _sortableHeaderProps, { className: className }),
|
|
814
828
|
((uiSchema.items || {})[col] || {})["ui:title"] || schema.items.properties[col].title,
|
|
@@ -819,12 +833,12 @@ let TableArrayFieldTemplate = class TableArrayFieldTemplate extends React.Compon
|
|
|
819
833
|
React.createElement("tbody", null, formData.map((_, idx) => {
|
|
820
834
|
const item = items[idx];
|
|
821
835
|
let className = "";
|
|
822
|
-
if (utils_1.filteredErrors(errorSchema)[utils_1.getFormDataIndex(idx, uiSchema)])
|
|
836
|
+
if ((0, utils_1.filteredErrors)(errorSchema)[(0, utils_1.getFormDataIndex)(idx, uiSchema)])
|
|
823
837
|
className = className ? `${className} bg-danger` : "bg-danger";
|
|
824
838
|
return [
|
|
825
|
-
React.createElement("tr", { key: utils_1.getUUID(this.props.formData[item.index]) || item.key, onClick: this.getOnChangeActive(idx), className: className, tabIndex: idx === activeIdx ? undefined : 0, role: idx === activeIdx ? undefined : "button", id: idx !== activeIdx ? `_laji-form_${ArrayField_2.ArrayFieldPatched.prototype.getIdSchema(this.props, idx).$id}` : undefined, ref: setItemRef(idx), style: idx === activeIdx ? this.state.activeTrStyle : undefined, onMouseEnter: onMouseEnter(idx), onMouseLeave: onMouseLeave(idx), onKeyDown: this.onKeyDownActivate(idx) },
|
|
826
|
-
cols.length ? cols.map(col => React.createElement("td", { key: col }, utils_1.formatValue(Object.assign(Object.assign({}, that.props), { schema: schema.items.properties[col], uiSchema: (uiSchema.items || {})[col], formData: formData[idx][col] }), formatters[col], { formData: formData[idx] }))) : React.createElement("td", null),
|
|
827
|
-
(activeIdx !== undefined && items[activeIdx] && idx === activeIdx) ? (React.createElement("td", { key: utils_1.getUUID(formData[activeIdx]) || activeIdx, className: "single-active-array-table-content-col" },
|
|
839
|
+
React.createElement("tr", { key: (0, utils_1.getUUID)(this.props.formData[item.index]) || item.key, onClick: this.getOnChangeActive(idx), className: className, tabIndex: idx === activeIdx ? undefined : 0, role: idx === activeIdx ? undefined : "button", id: idx !== activeIdx ? `_laji-form_${ArrayField_2.ArrayFieldPatched.prototype.getIdSchema(this.props, idx).$id}` : undefined, ref: setItemRef(idx), style: idx === activeIdx ? this.state.activeTrStyle : undefined, onMouseEnter: onMouseEnter(idx), onMouseLeave: onMouseLeave(idx), onKeyDown: this.onKeyDownActivate(idx) },
|
|
840
|
+
cols.length ? cols.map(col => React.createElement("td", { key: col }, (0, utils_1.formatValue)(Object.assign(Object.assign({}, that.props), { schema: schema.items.properties[col], uiSchema: (uiSchema.items || {})[col], formData: formData[idx][col] }), formatters[col], { formData: formData[idx] }))) : React.createElement("td", null),
|
|
841
|
+
(activeIdx !== undefined && items[activeIdx] && idx === activeIdx) ? (React.createElement("td", { key: (0, utils_1.getUUID)(formData[activeIdx]) || activeIdx, className: "single-active-array-table-content-col" },
|
|
828
842
|
React.createElement("div", { className: "laji-form-field-template-item keep-vertical", style: this.state.activeStyle, ref: this.setActiveRef },
|
|
829
843
|
React.createElement("div", { className: "laji-form-field-template-schema" }, items[activeIdx].children),
|
|
830
844
|
React.createElement("div", { className: "laji-form-field-template-buttons" })))) : React.createElement("td", { className: "single-active-array-table-content-col" }),
|
|
@@ -866,10 +880,10 @@ const headerFormatters = {
|
|
|
866
880
|
that.hoveredIdx = idx;
|
|
867
881
|
if (!force && isActive(idx, that.state.activeIdx))
|
|
868
882
|
return;
|
|
869
|
-
const map = Context_1.default(`${that.props.formContext.contextId}_MAP`).map;
|
|
883
|
+
const map = (0, Context_1.default)(`${that.props.formContext.contextId}_MAP`).map;
|
|
870
884
|
const gatheringGeometries = (item && item.geometry && item.geometry.geometries) ? item.geometry.geometries : [];
|
|
871
885
|
const unitGeometries = [...(item && item.units ? item.units : [])]
|
|
872
|
-
.filter(unit => unit.unitGathering && utils_1.hasData(unit.unitGathering.geometry))
|
|
886
|
+
.filter(unit => unit.unitGathering && (0, utils_1.hasData)(unit.unitGathering.geometry))
|
|
873
887
|
.map(unit => unit.unitGathering.geometry);
|
|
874
888
|
const geometries = [...gatheringGeometries, ...unitGeometries]
|
|
875
889
|
.map(geometry => {
|
|
@@ -882,7 +896,7 @@ const headerFormatters = {
|
|
|
882
896
|
});
|
|
883
897
|
},
|
|
884
898
|
onMouseLeave: (that) => {
|
|
885
|
-
const map = Context_1.default(`${that.props.formContext.contextId}_MAP`).map;
|
|
899
|
+
const map = (0, Context_1.default)(`${that.props.formContext.contextId}_MAP`).map;
|
|
886
900
|
const lastData = map.data[map.data.length - 1];
|
|
887
901
|
if (lastData && lastData.temp) {
|
|
888
902
|
map.removeData(map.data.length - 1);
|
|
@@ -920,7 +934,7 @@ const headerFormatters = {
|
|
|
920
934
|
render() {
|
|
921
935
|
const { name } = this.state;
|
|
922
936
|
const { locality } = (this.props.that.props.formData || {})[this.props.idx] || {};
|
|
923
|
-
return React.createElement("span", { className: "text-muted" }, !utils_1.isEmptyString(name) ? name : locality);
|
|
937
|
+
return React.createElement("span", { className: "text-muted" }, !(0, utils_1.isEmptyString)(name) ? name : locality);
|
|
924
938
|
}
|
|
925
939
|
}
|
|
926
940
|
},
|
|
@@ -938,10 +952,10 @@ const headerFormatters = {
|
|
|
938
952
|
},
|
|
939
953
|
lolife: {
|
|
940
954
|
onMouseEnter: (that, idx) => {
|
|
941
|
-
that.props.formContext.services.customEvents.send(that.props.idSchema.$id, "startHighlight", { id: utils_1.getUUID(that.props.formData[idx]) });
|
|
955
|
+
that.props.formContext.services.customEvents.send(that.props.idSchema.$id, "startHighlight", { id: (0, utils_1.getUUID)(that.props.formData[idx]) });
|
|
942
956
|
},
|
|
943
957
|
onMouseLeave: (that, idx) => {
|
|
944
|
-
that.props.formContext.services.customEvents.send(that.props.idSchema.$id, "endHighlight", { id: utils_1.getUUID(that.props.formData[idx]) });
|
|
958
|
+
that.props.formContext.services.customEvents.send(that.props.idSchema.$id, "endHighlight", { id: (0, utils_1.getUUID)(that.props.formData[idx]) });
|
|
945
959
|
}
|
|
946
960
|
},
|
|
947
961
|
unitTaxons: {
|
|
@@ -956,13 +970,13 @@ const headerFormatters = {
|
|
|
956
970
|
`/identifications/${idx}/author`
|
|
957
971
|
];
|
|
958
972
|
const taxonString = taxonFields.reduce((res, field) => {
|
|
959
|
-
const formattedValue = utils_1.formatValue(Object.assign(Object.assign({}, _props), { schema: utils_1.parseSchemaFromFormDataPointer(_props.schema.items, field), uiSchema: utils_1.parseUiSchemaFromFormDataPointer(_props.uiSchema.items, field), formData: utils_1.parseJSONPointer(unit, field, !!"safely") }));
|
|
960
|
-
if (!utils_1.isEmptyString(formattedValue)) {
|
|
973
|
+
const formattedValue = (0, utils_1.formatValue)(Object.assign(Object.assign({}, _props), { schema: (0, utils_1.parseSchemaFromFormDataPointer)(_props.schema.items, field), uiSchema: (0, utils_1.parseUiSchemaFromFormDataPointer)(_props.uiSchema.items, field), formData: (0, utils_1.parseJSONPointer)(unit, field, !!"safely") }));
|
|
974
|
+
if (!(0, utils_1.isEmptyString)(formattedValue)) {
|
|
961
975
|
res.push(formattedValue);
|
|
962
976
|
}
|
|
963
977
|
return res;
|
|
964
978
|
}, []).join(" ");
|
|
965
|
-
if (!utils_1.isEmptyString(taxonString)) {
|
|
979
|
+
if (!(0, utils_1.isEmptyString)(taxonString)) {
|
|
966
980
|
result.push(taxonString);
|
|
967
981
|
}
|
|
968
982
|
return result;
|
|
@@ -978,7 +992,7 @@ const headerFormatters = {
|
|
|
978
992
|
return null;
|
|
979
993
|
}
|
|
980
994
|
return React.createElement("span", { className: "text-muted" },
|
|
981
|
-
React.createElement("small", null, utils_1.getLajiUri(id)));
|
|
995
|
+
React.createElement("small", null, (0, utils_1.getLajiUri)(id)));
|
|
982
996
|
}
|
|
983
997
|
}
|
|
984
998
|
};
|
|
@@ -1009,7 +1023,7 @@ class AccordionHeader extends React.Component {
|
|
|
1009
1023
|
const { uiSchema, schema } = that.props;
|
|
1010
1024
|
const formData = (that.props.formData || {})[this.props.idx];
|
|
1011
1025
|
// try both headerFormatters & headerFormatter for backward compatibility. TODO: Remove in future.
|
|
1012
|
-
const options = utils_1.getUiOptions(uiSchema);
|
|
1026
|
+
const options = (0, utils_1.getUiOptions)(uiSchema);
|
|
1013
1027
|
let _headerFormatters = options.headerFormatters || options.headerFormatter || [];
|
|
1014
1028
|
if (_headerFormatters && !Array.isArray(_headerFormatters))
|
|
1015
1029
|
_headerFormatters = [_headerFormatters];
|
|
@@ -1022,9 +1036,9 @@ class AccordionHeader extends React.Component {
|
|
|
1022
1036
|
else
|
|
1023
1037
|
return {
|
|
1024
1038
|
component: () => {
|
|
1025
|
-
const { field, default: _default } = utils_1.isObject(formatter) ? formatter : { field: formatter };
|
|
1026
|
-
const formattedValue = utils_1.formatValue(Object.assign(Object.assign({}, that.props), { schema: utils_1.parseSchemaFromFormDataPointer(schema.items, field), uiSchema: utils_1.parseUiSchemaFromFormDataPointer(uiSchema.items, field), formData: utils_1.parseJSONPointer(formData, field, !!"safely") }));
|
|
1027
|
-
const value = utils_1.isEmptyString(formattedValue) ? _default : formattedValue;
|
|
1039
|
+
const { field, default: _default } = (0, utils_1.isObject)(formatter) ? formatter : { field: formatter };
|
|
1040
|
+
const formattedValue = (0, utils_1.formatValue)(Object.assign(Object.assign({}, that.props), { schema: (0, utils_1.parseSchemaFromFormDataPointer)(schema.items, field), uiSchema: (0, utils_1.parseUiSchemaFromFormDataPointer)(uiSchema.items, field), formData: (0, utils_1.parseJSONPointer)(formData, field, !!"safely") }));
|
|
1041
|
+
const value = (0, utils_1.isEmptyString)(formattedValue) ? _default : formattedValue;
|
|
1028
1042
|
return React.createElement("span", { className: "text-muted" }, value);
|
|
1029
1043
|
}
|
|
1030
1044
|
};
|
|
@@ -1044,7 +1058,7 @@ class AccordionHeader extends React.Component {
|
|
|
1044
1058
|
render() {
|
|
1045
1059
|
var _a;
|
|
1046
1060
|
const { that, idx } = this.props;
|
|
1047
|
-
const title = utils_1.getTitle(that.props, idx);
|
|
1061
|
+
const title = (0, utils_1.getTitle)(that.props, idx);
|
|
1048
1062
|
const popupData = (_a = that.state.popups) === null || _a === void 0 ? void 0 : _a[idx];
|
|
1049
1063
|
const { uiSchema } = that.props;
|
|
1050
1064
|
const hasHelp = uiSchema && uiSchema["ui:help"];
|
|
@@ -1066,11 +1080,11 @@ class AccordionHeader extends React.Component {
|
|
|
1066
1080
|
const { Tooltip } = this.context.theme;
|
|
1067
1081
|
const tooltip = React.createElement(Tooltip, { id: `${that.props.idSchema.$id}_${idx}-help` }, uiSchema["ui:help"]);
|
|
1068
1082
|
const headerTextComponent = hasHelp ? React.createElement(components_1.OverlayTrigger, { placement: "right", overlay: tooltip, show: this.state && this.state.focused || undefined }, headerText) : headerText;
|
|
1069
|
-
const header = (React.createElement("div", { className: this.props.className, role: "tab", id: `${that.props.idSchema.$id}_${utils_1.getFormDataIndex(idx, that.props.uiSchema)}-header`, onClick: this.onHeaderClick, onMouseEnter: this.onMouseEnter, onMouseLeave: this.onMouseLeave, onKeyDown: this.onKeyDown, tabIndex: "0" },
|
|
1083
|
+
const header = (React.createElement("div", { className: this.props.className, role: "tab", id: `${that.props.idSchema.$id}_${(0, utils_1.getFormDataIndex)(idx, that.props.uiSchema)}-header`, onClick: this.onHeaderClick, onMouseEnter: this.onMouseEnter, onMouseLeave: this.onMouseLeave, onKeyDown: this.onKeyDown, tabIndex: "0" },
|
|
1070
1084
|
React.createElement("div", { className: this.props.wrapperClassName },
|
|
1071
1085
|
headerTextComponent,
|
|
1072
1086
|
this.props.children)));
|
|
1073
|
-
return utils_1.hasData(popupData) ? (React.createElement(components_1.OverlayTrigger, { placement: "left", overlay: React.createElement(Tooltip, { id: "nav-tooltip-" + idx },
|
|
1087
|
+
return (0, utils_1.hasData)(popupData) ? (React.createElement(components_1.OverlayTrigger, { placement: "left", overlay: React.createElement(Tooltip, { id: "nav-tooltip-" + idx },
|
|
1074
1088
|
React.createElement(Popup, { data: popupData })) }, header)) : (header);
|
|
1075
1089
|
}
|
|
1076
1090
|
}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
export default class SingleItemArrayField extends React.Component<any, any, any> {
|
|
2
2
|
static propTypes: {
|
|
3
|
-
schema: PropTypes.Validator<PropTypes.InferProps<{
|
|
3
|
+
schema: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
|
|
4
4
|
type: PropTypes.Requireable<string>;
|
|
5
|
-
}
|
|
5
|
+
}>>>;
|
|
6
6
|
formData: PropTypes.Requireable<any[]>;
|
|
7
7
|
};
|
|
8
8
|
static getName(): string;
|
|
9
9
|
constructor(props: any);
|
|
10
|
+
componentDidUpdate(): void;
|
|
10
11
|
getStateFromProps(props: any): any;
|
|
11
12
|
getActiveIdx: (props: any) => any;
|
|
12
13
|
onChange: (formData: any) => void;
|