@luomus/laji-form 15.1.64 → 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/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 +25 -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)
|
|
@@ -110,13 +124,13 @@ class _AutosuggestWidget extends React.Component {
|
|
|
110
124
|
}
|
|
111
125
|
}
|
|
112
126
|
}
|
|
113
|
-
exports.default = _AutosuggestWidget;
|
|
114
127
|
_AutosuggestWidget.propTypes = {
|
|
115
128
|
schema: PropTypes.shape({
|
|
116
129
|
type: PropTypes.oneOf(["string"])
|
|
117
130
|
}).isRequired,
|
|
118
131
|
value: PropTypes.string
|
|
119
132
|
};
|
|
133
|
+
exports.default = _AutosuggestWidget;
|
|
120
134
|
class SimpleValueRenderer extends React.Component {
|
|
121
135
|
constructor(props) {
|
|
122
136
|
super(props);
|
|
@@ -149,7 +163,7 @@ function TaxonAutosuggest(ComposedComponent) {
|
|
|
149
163
|
};
|
|
150
164
|
this.renderChooseImages = () => {
|
|
151
165
|
const chooseImages = this.state && this.state.chooseImages || this.props.options.chooseImages;
|
|
152
|
-
const { orWriteSpeciesNameLabel } = utils_1.getUiOptions(this.props);
|
|
166
|
+
const { orWriteSpeciesNameLabel } = (0, utils_1.getUiOptions)(this.props);
|
|
153
167
|
const { or } = this.props.formContext.translations;
|
|
154
168
|
const { Row, Col } = this.context.theme;
|
|
155
169
|
return (React.createElement(Row, null,
|
|
@@ -213,7 +227,7 @@ function TaxonAutosuggest(ComposedComponent) {
|
|
|
213
227
|
}
|
|
214
228
|
}
|
|
215
229
|
isValueSuggested(value) {
|
|
216
|
-
return !utils_1.isEmptyString(value) && !!value.match(/MX\.\d+/);
|
|
230
|
+
return !(0, utils_1.isEmptyString)(value) && !!value.match(/MX\.\d+/);
|
|
217
231
|
}
|
|
218
232
|
parseInputValue(inputValue) {
|
|
219
233
|
return inputValue.replace(/ sp(\.|p)?\.?$/, "");
|
|
@@ -289,7 +303,7 @@ class FriendsAutosuggestWidget extends React.Component {
|
|
|
289
303
|
super(props);
|
|
290
304
|
this.prepareSuggestion = (suggestion) => {
|
|
291
305
|
const { isAdmin } = this.props.formContext.uiSchemaContext;
|
|
292
|
-
const { showID } = utils_1.getUiOptions(this.props);
|
|
306
|
+
const { showID } = (0, utils_1.getUiOptions)(this.props);
|
|
293
307
|
return isAdmin && showID
|
|
294
308
|
? Object.assign(Object.assign({}, suggestion), { value: `${suggestion.value} (${suggestion.key})` }) : suggestion;
|
|
295
309
|
};
|
|
@@ -304,7 +318,7 @@ class FriendsAutosuggestWidget extends React.Component {
|
|
|
304
318
|
this.isValueSuggested = this.isValueSuggested.bind(this);
|
|
305
319
|
}
|
|
306
320
|
getSuggestionFromValue(value) {
|
|
307
|
-
const { showID } = utils_1.getUiOptions(this.props);
|
|
321
|
+
const { showID } = (0, utils_1.getUiOptions)(this.props);
|
|
308
322
|
const { isAdmin } = this.props.formContext.uiSchemaContext;
|
|
309
323
|
if (this.isValueSuggested(value)) {
|
|
310
324
|
return this.props.formContext.apiClient.fetchCached(`/person/by-id/${value}`).then(({ fullName, group, id }) => {
|
|
@@ -323,7 +337,7 @@ class FriendsAutosuggestWidget extends React.Component {
|
|
|
323
337
|
}
|
|
324
338
|
}
|
|
325
339
|
isValueSuggested(value) {
|
|
326
|
-
return !utils_1.isEmptyString(value) && value.match(/MA\.\d+/);
|
|
340
|
+
return !(0, utils_1.isEmptyString)(value) && value.match(/MA\.\d+/);
|
|
327
341
|
}
|
|
328
342
|
render() {
|
|
329
343
|
const _a = this.props, { options: propsOptions } = _a, propsWithoutOptions = __rest(_a, ["options"]);
|
|
@@ -387,7 +401,7 @@ class BasicAutosuggestWidget extends React.Component {
|
|
|
387
401
|
}
|
|
388
402
|
isValueSuggested(value) {
|
|
389
403
|
const regexp = new RegExp(this.props.validValueRegexp);
|
|
390
|
-
return !utils_1.isEmptyString(value) && value.match(regexp);
|
|
404
|
+
return !(0, utils_1.isEmptyString)(value) && value.match(regexp);
|
|
391
405
|
}
|
|
392
406
|
render() {
|
|
393
407
|
const options = {
|
|
@@ -445,7 +459,7 @@ class Autosuggest extends React.Component {
|
|
|
445
459
|
};
|
|
446
460
|
this.triggerConvert = (props) => {
|
|
447
461
|
const { value, getSuggestionFromValue } = props;
|
|
448
|
-
if (utils_1.isEmptyString(value) || !getSuggestionFromValue) {
|
|
462
|
+
if ((0, utils_1.isEmptyString)(value) || !getSuggestionFromValue) {
|
|
449
463
|
if (this.state.suggestion && Object.keys(this.state.suggestion).length > 0) {
|
|
450
464
|
this.setState({ suggestion: undefined, inputValue: value, suggestionForValue: value });
|
|
451
465
|
}
|
|
@@ -496,9 +510,9 @@ class Autosuggest extends React.Component {
|
|
|
496
510
|
: afterStateChange();
|
|
497
511
|
};
|
|
498
512
|
this.selectUnsuggested = (inputValue) => {
|
|
499
|
-
if (utils_1.isEmptyString(inputValue) && utils_1.isEmptyString(this.props.value))
|
|
513
|
+
if ((0, utils_1.isEmptyString)(inputValue) && (0, utils_1.isEmptyString)(this.props.value))
|
|
500
514
|
return;
|
|
501
|
-
const value = !utils_1.isEmptyString(inputValue) ? inputValue : undefined;
|
|
515
|
+
const value = !(0, utils_1.isEmptyString)(inputValue) ? inputValue : undefined;
|
|
502
516
|
const { onUnsuggestedSelected, onChange } = this.props;
|
|
503
517
|
const afterStateChange = () => {
|
|
504
518
|
onUnsuggestedSelected ?
|
|
@@ -590,13 +604,13 @@ class Autosuggest extends React.Component {
|
|
|
590
604
|
};
|
|
591
605
|
this.onFocus = (e) => {
|
|
592
606
|
this.setState({ focused: true });
|
|
593
|
-
utils_1.triggerParentComponent("onFocus", e, this.props.inputProps);
|
|
607
|
+
(0, utils_1.triggerParentComponent)("onFocus", e, this.props.inputProps);
|
|
594
608
|
};
|
|
595
609
|
this.onBlur = (e) => {
|
|
596
610
|
this.setState({ focused: false }, () => {
|
|
597
611
|
this._valueForBlurAndFetch = this.state.inputValue;
|
|
598
612
|
this.afterBlurAndFetch(this.state.suggestions);
|
|
599
|
-
utils_1.triggerParentComponent("onBlur", e, this.props.inputProps);
|
|
613
|
+
(0, utils_1.triggerParentComponent)("onBlur", e, this.props.inputProps);
|
|
600
614
|
const overlay = this.wrapperRef.current;
|
|
601
615
|
if (overlay && overlay.overlayTriggerRef && overlay.overlayTriggerRef.hide) {
|
|
602
616
|
setTimeout(() => {
|
|
@@ -670,7 +684,7 @@ class Autosuggest extends React.Component {
|
|
|
670
684
|
const { suggestion } = this.state;
|
|
671
685
|
const { Glyphicon } = this.context.theme;
|
|
672
686
|
const isSuggested = this.isSuggested();
|
|
673
|
-
if (displayValidationState && !utils_1.isEmptyString(value) && isSuggested !== undefined) {
|
|
687
|
+
if (displayValidationState && !(0, utils_1.isEmptyString)(value) && isSuggested !== undefined) {
|
|
674
688
|
validationState = isSuggested ? "success" : "warning";
|
|
675
689
|
}
|
|
676
690
|
const getGlyphNameFromState = (state) => {
|
|
@@ -701,7 +715,7 @@ class Autosuggest extends React.Component {
|
|
|
701
715
|
? React.createElement(InformalTaxonGroupsAddon, { key: "informal", taxonGroupID: taxonGroupID, onClear: this.onInformalTaxonGroupSelected, open: this.state.informalTaxonGroupsOpen, onOpen: this.onInformalTaxonGroupsOpened, onToggle: onToggle, formContext: this.props.formContext })
|
|
702
716
|
: null;
|
|
703
717
|
const getTogglerTooltip = () => {
|
|
704
|
-
const { toggleable } = utils_1.getUiOptions(this.props.uiSchema);
|
|
718
|
+
const { toggleable } = (0, utils_1.getUiOptions)(this.props.uiSchema);
|
|
705
719
|
let tooltip = typeof toggleable.tooltip === "string"
|
|
706
720
|
? toggleable.tooltip
|
|
707
721
|
: `${translations[this.props.toggled ? "StopShorthand" : "StartShorthand"]}. ${translations.ShorthandHelp}`;
|
|
@@ -711,16 +725,16 @@ class Autosuggest extends React.Component {
|
|
|
711
725
|
const { shortcuts } = this.props.formContext.services.keyHandler;
|
|
712
726
|
Object.keys(shortcuts).some(keyCombo => {
|
|
713
727
|
if (shortcuts[keyCombo].fn == "autosuggestToggle") {
|
|
714
|
-
tooltip = `[${utils_1.stringifyKeyCombo(keyCombo)}]: ${tooltip}`;
|
|
728
|
+
tooltip = `[${(0, utils_1.stringifyKeyCombo)(keyCombo)}]: ${tooltip}`;
|
|
715
729
|
return true;
|
|
716
730
|
}
|
|
717
731
|
});
|
|
718
732
|
return tooltip;
|
|
719
733
|
};
|
|
720
734
|
const getToggleGlyph = () => {
|
|
721
|
-
const { toggleable } = utils_1.getUiOptions(this.props.uiSchema);
|
|
735
|
+
const { toggleable } = (0, utils_1.getUiOptions)(this.props.uiSchema);
|
|
722
736
|
const props = {
|
|
723
|
-
className: utils_1.classNames("autosuggest-input-addon", "power-user-addon", this.props.toggled && "active"),
|
|
737
|
+
className: (0, utils_1.classNames)("autosuggest-input-addon", "power-user-addon", this.props.toggled && "active"),
|
|
724
738
|
onMouseDown: this.onToggle,
|
|
725
739
|
onKeyDown: this.onKeyDown
|
|
726
740
|
};
|
|
@@ -736,7 +750,7 @@ class Autosuggest extends React.Component {
|
|
|
736
750
|
const input = (React.createElement(components_1.FetcherInput, Object.assign({ value: inputValue, glyph: glyph, loading: this.state.isLoading, validationState: validationState, extra: [addon, toggler] }, inputProps)));
|
|
737
751
|
let component = input;
|
|
738
752
|
if (displayValidationState && Wrapper) {
|
|
739
|
-
component = (React.createElement(Wrapper, { isSuggested: isSuggested, suggestion: suggestion, options: utils_1.getUiOptions(this.props), id: this.props.id, value: suggestion && suggestion.key, inputValue: value, ref: this.wrapperRef, formContext: this.props.formContext }, component));
|
|
753
|
+
component = (React.createElement(Wrapper, { isSuggested: isSuggested, suggestion: suggestion, options: (0, utils_1.getUiOptions)(this.props), id: this.props.id, value: suggestion && suggestion.key, inputValue: value, ref: this.wrapperRef, formContext: this.props.formContext }, component));
|
|
740
754
|
}
|
|
741
755
|
if (informalTaxonGroups) {
|
|
742
756
|
component = (React.createElement(React.Fragment, null,
|
|
@@ -790,7 +804,7 @@ class Autosuggest extends React.Component {
|
|
|
790
804
|
const { renderExtra } = props;
|
|
791
805
|
return (React.createElement(React.Fragment, null,
|
|
792
806
|
renderExtra && renderExtra(),
|
|
793
|
-
React.createElement("div", { className: utils_1.classNames("autosuggest-wrapper", props.wrapperClassName) },
|
|
807
|
+
React.createElement("div", { className: (0, utils_1.classNames)("autosuggest-wrapper", props.wrapperClassName) },
|
|
794
808
|
React.createElement(ReactAutosuggest, { id: `${this.props.id}-autosuggest`, inputProps: inputProps, renderInputComponent: this.renderInput, suggestions: suggestions, renderSuggestion: this.renderSuggestion, onSuggestionsFetchRequested: this.onSuggestionsFetchRequested, onSuggestionsClearRequested: this.onSuggestionsClearRequested, onSuggestionSelected: this.onSuggestionSelected, onUnsuggestedSelected: this.onUnsuggestedSelected, highlightFirstSuggestion: highlightFirstSuggestion, suggestionsOpenOnFocus: !this.isSuggested(), theme: cssClasses, formContext: this.props.formContext, ref: this.setRef }))));
|
|
795
809
|
}
|
|
796
810
|
}
|
|
@@ -836,7 +850,7 @@ class _TaxonWrapper extends React.Component {
|
|
|
836
850
|
if (!this.mounted)
|
|
837
851
|
return;
|
|
838
852
|
this.setState({ value, taxonRank, informalTaxonGroups, taxon: { scientificName, vernacularName, cursiveName, finnish } });
|
|
839
|
-
InformalTaxonGroupChooserWidget_1.getInformalGroups(this.props.formContext.apiClient).then(({ informalTaxonGroupsById }) => {
|
|
853
|
+
(0, InformalTaxonGroupChooserWidget_1.getInformalGroups)(this.props.formContext.apiClient).then(({ informalTaxonGroupsById }) => {
|
|
840
854
|
if (!this.mounted)
|
|
841
855
|
return;
|
|
842
856
|
this.setState({ informalTaxonGroupsById });
|
|
@@ -864,7 +878,7 @@ class _TaxonWrapper extends React.Component {
|
|
|
864
878
|
this.props.formContext.apiClient.fetchCached("/metadata/ranges/MX.taxonRankEnum").then(taxonRanks => {
|
|
865
879
|
if (!this.mounted)
|
|
866
880
|
return;
|
|
867
|
-
this.setState({ taxonRanks: utils_1.dictionarify(taxonRanks, function getKey(rank) { return rank.id; }, function getValue(rank) { return rank.value; }) });
|
|
881
|
+
this.setState({ taxonRanks: (0, utils_1.dictionarify)(taxonRanks, function getKey(rank) { return rank.id; }, function getValue(rank) { return rank.value; }) });
|
|
868
882
|
});
|
|
869
883
|
}
|
|
870
884
|
}
|
|
@@ -878,7 +892,7 @@ class _TaxonWrapper extends React.Component {
|
|
|
878
892
|
imageID = informalTaxonGroupsById[imageID].parent.id;
|
|
879
893
|
}
|
|
880
894
|
const loading = !taxonRank || !(order || family || higherThanOrder) || !taxonRanks;
|
|
881
|
-
const popover = utils_1.isEmptyString(inputValue)
|
|
895
|
+
const popover = (0, utils_1.isEmptyString)(inputValue)
|
|
882
896
|
? React.createElement(React.Fragment, null)
|
|
883
897
|
: inputValue && isSuggested === false
|
|
884
898
|
? React.createElement(Tooltip, { id: `${this.props.id}-tooltip` }, this.props.formContext.translations.UnknownName)
|
|
@@ -947,7 +961,7 @@ class InformalTaxonGroupsAddon extends React.Component {
|
|
|
947
961
|
}
|
|
948
962
|
componentDidMount() {
|
|
949
963
|
this.mounted = true;
|
|
950
|
-
InformalTaxonGroupChooserWidget_1.getInformalGroups(this.props.formContext.apiClient).then(({ informalTaxonGroupsById }) => {
|
|
964
|
+
(0, InformalTaxonGroupChooserWidget_1.getInformalGroups)(this.props.formContext.apiClient).then(({ informalTaxonGroupsById }) => {
|
|
951
965
|
if (!this.mounted)
|
|
952
966
|
return;
|
|
953
967
|
this.setState({ informalTaxonGroupsById });
|
|
@@ -1108,7 +1122,7 @@ class ReactAutosuggest extends React.Component {
|
|
|
1108
1122
|
: this.setState({ inputValue: value }, callback);
|
|
1109
1123
|
};
|
|
1110
1124
|
this.setInputRef = (elem) => {
|
|
1111
|
-
this.inputElem = react_dom_1.findDOMNode(elem);
|
|
1125
|
+
this.inputElem = (0, react_dom_1.findDOMNode)(elem);
|
|
1112
1126
|
};
|
|
1113
1127
|
this.onSuggestionMouseDown = () => {
|
|
1114
1128
|
this.suggestionMouseDownFlag = true;
|
|
@@ -1146,7 +1160,7 @@ class ReactAutosuggest extends React.Component {
|
|
|
1146
1160
|
}
|
|
1147
1161
|
onBlur(e) {
|
|
1148
1162
|
var _a, _b;
|
|
1149
|
-
if (e.relatedTarget && e.relatedTarget === react_dom_1.findDOMNode(this.listRef.current)) {
|
|
1163
|
+
if (e.relatedTarget && e.relatedTarget === (0, react_dom_1.findDOMNode)(this.listRef.current)) {
|
|
1150
1164
|
return;
|
|
1151
1165
|
}
|
|
1152
1166
|
const suggestion = (this.props.suggestions || [])[this.state.focusedIdx];
|
|
@@ -1169,8 +1183,8 @@ class ReactAutosuggest extends React.Component {
|
|
|
1169
1183
|
return null;
|
|
1170
1184
|
}
|
|
1171
1185
|
const { suggestion, suggestionsList, suggestionsContainer, suggestionsContainerOpen, suggestionHighlighted } = this.props.theme || {};
|
|
1172
|
-
return (React.createElement("div", { className: utils_1.classNames(suggestionsContainer, suggestionsContainerOpen) },
|
|
1173
|
-
React.createElement("ul", { className: suggestionsList, tabIndex: -1, ref: this.listRef, onBlur: this.onListBlur }, this.props.suggestions.map((s, i) => React.createElement("li", { key: i, className: utils_1.classNames(suggestion, this.state.focusedIdx === i && suggestionHighlighted), onMouseDown: this.onSuggestionMouseDown, onMouseUp: this.onSuggestionMouseUp, "data-idx": i }, this.props.renderSuggestion(s))))));
|
|
1186
|
+
return (React.createElement("div", { className: (0, utils_1.classNames)(suggestionsContainer, suggestionsContainerOpen) },
|
|
1187
|
+
React.createElement("ul", { className: suggestionsList, tabIndex: -1, ref: this.listRef, onBlur: this.onListBlur }, this.props.suggestions.map((s, i) => React.createElement("li", { key: i, className: (0, utils_1.classNames)(suggestion, this.state.focusedIdx === i && suggestionHighlighted), onMouseDown: this.onSuggestionMouseDown, onMouseUp: this.onSuggestionMouseUp, "data-idx": i }, this.props.renderSuggestion(s))))));
|
|
1174
1188
|
}
|
|
1175
1189
|
onSuggestionSelected(suggestion) {
|
|
1176
1190
|
this.setState({ inputValue: suggestion.value, hideSuggestions: true });
|
|
@@ -21,10 +21,13 @@ export default class CheckboxWidget extends React.Component<any, any, any> {
|
|
|
21
21
|
falseRef: React.RefObject<any>;
|
|
22
22
|
undefinedRef: React.RefObject<any>;
|
|
23
23
|
groupRef: React.RefObject<any>;
|
|
24
|
+
componentDidMount(): void;
|
|
25
|
+
componentDidUpdate(): void;
|
|
24
26
|
rmInputTabIndices: () => void;
|
|
25
27
|
onChange: (value: any) => void;
|
|
26
28
|
onButtonGroupChange: (value: any) => void;
|
|
27
29
|
getOptions: (props: any) => any;
|
|
30
|
+
render(): JSX.Element;
|
|
28
31
|
getToggleMode: (props: any) => boolean;
|
|
29
32
|
onGroupKeyDown: any;
|
|
30
33
|
onTrueKeyDown: any;
|
|
@@ -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,13 +15,23 @@ 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
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
22
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
23
37
|
};
|
|
@@ -32,7 +46,7 @@ class CheckboxWidget extends React.Component {
|
|
|
32
46
|
super(props);
|
|
33
47
|
this.rmInputTabIndices = () => {
|
|
34
48
|
[this.trueRef, this.falseRef, this.undefinedRef].forEach(node => {
|
|
35
|
-
const domNode = react_dom_1.findDOMNode(node.current);
|
|
49
|
+
const domNode = (0, react_dom_1.findDOMNode)(node.current);
|
|
36
50
|
if (!domNode) {
|
|
37
51
|
return;
|
|
38
52
|
}
|
|
@@ -57,7 +71,7 @@ class CheckboxWidget extends React.Component {
|
|
|
57
71
|
};
|
|
58
72
|
this.getOptions = (props) => {
|
|
59
73
|
const { Yes, No, Unknown } = props.registry.formContext.translations;
|
|
60
|
-
return Object.assign({ allowUndefined: true, showUndefined: true, invert: false, trueLabel: Yes, falseLabel: No, unknownLabel: Unknown, required: this.props.required }, utils_1.getUiOptions(props));
|
|
74
|
+
return Object.assign({ allowUndefined: true, showUndefined: true, invert: false, trueLabel: Yes, falseLabel: No, unknownLabel: Unknown, required: this.props.required }, (0, utils_1.getUiOptions)(props));
|
|
61
75
|
};
|
|
62
76
|
this.getToggleMode = (props) => {
|
|
63
77
|
const { allowUndefined, showUndefined } = this.getOptions(props);
|
|
@@ -86,7 +100,7 @@ class CheckboxWidget extends React.Component {
|
|
|
86
100
|
if (this.props.disabled || this.props.readonly) {
|
|
87
101
|
return;
|
|
88
102
|
}
|
|
89
|
-
const nodes = [this.trueRef, this.falseRef, this.groupRef].map(r => react_dom_1.findDOMNode(r.current));
|
|
103
|
+
const nodes = [this.trueRef, this.falseRef, this.groupRef].map(r => (0, react_dom_1.findDOMNode)(r.current));
|
|
90
104
|
if (!nodes.includes(e.target)) {
|
|
91
105
|
return;
|
|
92
106
|
}
|
|
@@ -108,7 +122,7 @@ class CheckboxWidget extends React.Component {
|
|
|
108
122
|
const { value, disabled, readonly, label, id } = this.props;
|
|
109
123
|
const options = this.getOptions(this.props);
|
|
110
124
|
const { allowUndefined, showUndefined, invert, trueLabel, falseLabel, unknownLabel, required, label: uiOptionsLabel } = options;
|
|
111
|
-
const hasLabel = !utils_1.isEmptyString(label) && uiOptionsLabel !== false;
|
|
125
|
+
const hasLabel = !(0, utils_1.isEmptyString)(label) && uiOptionsLabel !== false;
|
|
112
126
|
// "undefined" for silencing ToggleButton warning.
|
|
113
127
|
const _value = value === undefined
|
|
114
128
|
? "undefined"
|
|
@@ -126,16 +140,16 @@ class CheckboxWidget extends React.Component {
|
|
|
126
140
|
const tabTargetClass = "laji-form-checkbox-widget-tab-target";
|
|
127
141
|
const selectedValueGlyph = React.createElement("span", { className: "laji-form-checkbox-selected-value-glyph" });
|
|
128
142
|
const unselectedValueGlyph = React.createElement("span", { className: "laji-form-checkbox-unselected-value-glyph" });
|
|
129
|
-
const checkbox = (React.createElement(ButtonToolbar, { className: utils_1.classNames("laji-form-checkbox-buttons", toggleMode && "desktop-layout") },
|
|
130
|
-
React.createElement(ToggleButtonGroup, Object.assign({ ref: this.groupRef, type: "radio", value: [_value], name: this.props.id, onChange: this.onButtonGroupChange, onKeyDown: this.onGroupKeyDown, className: utils_1.classNames(toggleMode && tabTargetClass) }, commonProps, { tabIndex: (toggleMode && !_disabled) ? 0 : undefined }),
|
|
131
|
-
React.createElement(ToggleButton, Object.assign({ id: `${id}-true`, ref: this.trueRef, value: true, onClick: toggleMode ? this.toggle : undefined, className: utils_1.classNames(_value === true && tabTargetClass), onKeyDown: this.onTrueKeyDown }, commonProps),
|
|
143
|
+
const checkbox = (React.createElement(ButtonToolbar, { className: (0, utils_1.classNames)("laji-form-checkbox-buttons", toggleMode && "desktop-layout") },
|
|
144
|
+
React.createElement(ToggleButtonGroup, Object.assign({ ref: this.groupRef, type: "radio", value: [_value], name: this.props.id, onChange: this.onButtonGroupChange, onKeyDown: this.onGroupKeyDown, className: (0, utils_1.classNames)(toggleMode && tabTargetClass) }, commonProps, { tabIndex: (toggleMode && !_disabled) ? 0 : undefined }),
|
|
145
|
+
React.createElement(ToggleButton, Object.assign({ id: `${id}-true`, ref: this.trueRef, value: true, onClick: toggleMode ? this.toggle : undefined, className: (0, utils_1.classNames)(_value === true && tabTargetClass), onKeyDown: this.onTrueKeyDown }, commonProps),
|
|
132
146
|
_value === true ? selectedValueGlyph : unselectedValueGlyph,
|
|
133
147
|
trueLabel),
|
|
134
|
-
React.createElement(ToggleButton, Object.assign({ id: `${id}-false`, ref: this.falseRef, value: false, onClick: toggleMode ? this.toggle : undefined, className: utils_1.classNames(_value === false && tabTargetClass), onKeyDown: this.onFalseKeyDown }, commonProps),
|
|
148
|
+
React.createElement(ToggleButton, Object.assign({ id: `${id}-false`, ref: this.falseRef, value: false, onClick: toggleMode ? this.toggle : undefined, className: (0, utils_1.classNames)(_value === false && tabTargetClass), onKeyDown: this.onFalseKeyDown }, commonProps),
|
|
135
149
|
_value === false ? selectedValueGlyph : unselectedValueGlyph,
|
|
136
150
|
falseLabel),
|
|
137
151
|
(displayUndefined ?
|
|
138
|
-
React.createElement(ToggleButton, Object.assign({ id: `${id}-undefined`, ref: this.undefinedRef, value: "undefined", className: utils_1.classNames(value === undefined && tabTargetClass) }, commonProps, { onKeyDown: this.onUndefinedKeyDown }),
|
|
152
|
+
React.createElement(ToggleButton, Object.assign({ id: `${id}-undefined`, ref: this.undefinedRef, value: "undefined", className: (0, utils_1.classNames)(value === undefined && tabTargetClass) }, commonProps, { onKeyDown: this.onUndefinedKeyDown }),
|
|
139
153
|
_value === "undefined" ? selectedValueGlyph : unselectedValueGlyph,
|
|
140
154
|
unknownLabel) : null))));
|
|
141
155
|
const { Label } = this.props.formContext;
|
|
@@ -151,7 +165,6 @@ class CheckboxWidget extends React.Component {
|
|
|
151
165
|
: props.formContext.translations.No;
|
|
152
166
|
}
|
|
153
167
|
}
|
|
154
|
-
exports.default = CheckboxWidget;
|
|
155
168
|
CheckboxWidget.contextType = ReactContext_1.default;
|
|
156
169
|
CheckboxWidget.propTypes = {
|
|
157
170
|
uiSchema: PropTypes.shape({
|
|
@@ -169,3 +182,4 @@ CheckboxWidget.propTypes = {
|
|
|
169
182
|
}),
|
|
170
183
|
value: PropTypes.bool
|
|
171
184
|
};
|
|
185
|
+
exports.default = CheckboxWidget;
|
|
@@ -1,25 +1,28 @@
|
|
|
1
1
|
export const YEAR_MATCH: RegExp;
|
|
2
|
+
export const YEAR_MONTH_MATCH: RegExp;
|
|
2
3
|
export default class DateTimeWidget extends React.Component<any, any, any> {
|
|
3
4
|
static contextType: React.Context<import("../../ReactContext").ContextProps>;
|
|
4
5
|
static propTypes: {
|
|
5
6
|
uiSchema: PropTypes.Requireable<PropTypes.InferProps<{
|
|
6
7
|
"ui:options": PropTypes.Requireable<PropTypes.InferProps<{
|
|
7
|
-
showButtons: PropTypes.Requireable<boolean | PropTypes.InferProps<{
|
|
8
|
+
showButtons: PropTypes.Requireable<NonNullable<boolean | PropTypes.InferProps<{
|
|
8
9
|
today: PropTypes.Requireable<boolean>;
|
|
9
10
|
yesterday: PropTypes.Requireable<boolean>;
|
|
10
|
-
same: PropTypes.Requireable<boolean | PropTypes.InferProps<{
|
|
11
|
+
same: PropTypes.Requireable<NonNullable<boolean | PropTypes.InferProps<{
|
|
11
12
|
path: PropTypes.Requireable<string>;
|
|
12
|
-
}>>;
|
|
13
|
-
plusSixMonths: PropTypes.Requireable<boolean | PropTypes.InferProps<{
|
|
13
|
+
}> | null | undefined>>;
|
|
14
|
+
plusSixMonths: PropTypes.Requireable<NonNullable<boolean | PropTypes.InferProps<{
|
|
14
15
|
path: PropTypes.Requireable<string>;
|
|
15
|
-
}>>;
|
|
16
|
-
plusSixYear: PropTypes.Requireable<boolean | PropTypes.InferProps<{
|
|
16
|
+
}> | null | undefined>>;
|
|
17
|
+
plusSixYear: PropTypes.Requireable<NonNullable<boolean | PropTypes.InferProps<{
|
|
17
18
|
path: PropTypes.Requireable<string>;
|
|
18
|
-
}>>;
|
|
19
|
-
}>>;
|
|
19
|
+
}> | null | undefined>>;
|
|
20
|
+
}> | null | undefined>>;
|
|
20
21
|
showTimeList: PropTypes.Requireable<boolean>;
|
|
21
22
|
allowOnlyYear: PropTypes.Requireable<boolean>;
|
|
23
|
+
allowOnlyYearAndMonth: PropTypes.Requireable<boolean>;
|
|
22
24
|
dateFormat: PropTypes.Requireable<string>;
|
|
25
|
+
yearAndMonthDateFormat: PropTypes.Requireable<string>;
|
|
23
26
|
}>>;
|
|
24
27
|
}>>;
|
|
25
28
|
schema: PropTypes.Requireable<PropTypes.InferProps<{
|
|
@@ -36,10 +39,13 @@ export default class DateTimeWidget extends React.Component<any, any, any> {
|
|
|
36
39
|
time: boolean;
|
|
37
40
|
};
|
|
38
41
|
constructor(props: any);
|
|
42
|
+
componentDidMount(): void;
|
|
43
|
+
componentWillUnmount(): void;
|
|
39
44
|
focus: () => void;
|
|
40
45
|
getStateFromProps(props: any): {
|
|
41
46
|
dateFormat: any;
|
|
42
47
|
timeFormat: string;
|
|
48
|
+
yearAndMonthDateFormat: any;
|
|
43
49
|
format: string;
|
|
44
50
|
inputFormat: any;
|
|
45
51
|
placeholder: string;
|
|
@@ -47,6 +53,7 @@ export default class DateTimeWidget extends React.Component<any, any, any> {
|
|
|
47
53
|
parse: (value: any) => any;
|
|
48
54
|
timeWritten: any;
|
|
49
55
|
onlyYearWritten: any;
|
|
56
|
+
onlyYearAndMonthWritten: boolean | undefined;
|
|
50
57
|
onChange: (value: any) => void;
|
|
51
58
|
onToggle: (p: any) => void;
|
|
52
59
|
toggle: any;
|
|
@@ -57,6 +64,7 @@ export default class DateTimeWidget extends React.Component<any, any, any> {
|
|
|
57
64
|
onTextWidgetFocus: () => void;
|
|
58
65
|
onBlur: () => void;
|
|
59
66
|
onDateTimePickerChange: (value: any) => void;
|
|
67
|
+
render(): JSX.Element;
|
|
60
68
|
renderButtons(showButtons: any): JSX.Element[];
|
|
61
69
|
getDateWithCurrentTime: (date: any) => any;
|
|
62
70
|
setToday: () => void;
|