@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
package/lib/themes/bs5.js
CHANGED
|
@@ -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 __rest = (this && this.__rest) || function (s, e) {
|
|
22
36
|
var t = {};
|
|
23
37
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -104,7 +118,7 @@ const theme = {
|
|
|
104
118
|
Col: React.forwardRef((props, ref) => React.createElement(react_bootstrap_5_1.Col, Object.assign({}, props, { ref: ref }))),
|
|
105
119
|
FormGroup: React.forwardRef((_a, ref) => {
|
|
106
120
|
var { validationState, className } = _a, props = __rest(_a, ["validationState", "className"]);
|
|
107
|
-
return React.createElement(react_bootstrap_5_1.FormGroup, Object.assign({}, props, { className: utils_1.classNames(className, mapValidationStateToClass(validationState)), ref: ref }));
|
|
121
|
+
return React.createElement(react_bootstrap_5_1.FormGroup, Object.assign({}, props, { className: (0, utils_1.classNames)(className, mapValidationStateToClass(validationState)), ref: ref }));
|
|
108
122
|
}),
|
|
109
123
|
InputGroup: _InputGroup,
|
|
110
124
|
FormControl: React.forwardRef((props, ref) => React.createElement(react_bootstrap_5_1.FormControl, Object.assign({}, props, { ref: ref }))),
|
package/lib/themes/stub.js
CHANGED
|
@@ -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 __rest = (this && this.__rest) || function (s, e) {
|
|
22
36
|
var t = {};
|
|
23
37
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
package/lib/themes/theme.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { HasMaybeChildren, HasMaybeClassName } from "../types";
|
|
3
|
-
export
|
|
4
|
-
export
|
|
3
|
+
export type Variant = "default" | "primary" | "success" | "info" | "warning" | "danger" | "outline-danger" | string;
|
|
4
|
+
export type ButtonVariant = Variant | "link";
|
|
5
5
|
interface HasMaybeRef {
|
|
6
6
|
ref?: React.Ref<any> | React.LegacyRef<any>;
|
|
7
7
|
}
|
|
@@ -15,7 +15,7 @@ export interface PanelProps extends HasMaybeRef, HasMaybeClassName, HasMaybeStyl
|
|
|
15
15
|
eventKey?: number;
|
|
16
16
|
variant?: Variant;
|
|
17
17
|
}
|
|
18
|
-
export
|
|
18
|
+
export type Panel = React.ComponentType<PanelProps> & {
|
|
19
19
|
Body: React.ComponentType;
|
|
20
20
|
Heading: React.ComponentType;
|
|
21
21
|
Collapse: React.ComponentType;
|
|
@@ -39,7 +39,7 @@ export interface ButtonProps extends JSX.IntrinsicAttributes, HasMaybeChildren,
|
|
|
39
39
|
small?: boolean;
|
|
40
40
|
onKeyDown?: (e: React.KeyboardEvent<any>) => void;
|
|
41
41
|
}
|
|
42
|
-
export
|
|
42
|
+
export type ButtonGroupProps = JSX.IntrinsicAttributes & HasMaybeChildren;
|
|
43
43
|
export interface ButtonToolbarProps extends JSX.IntrinsicAttributes, HasMaybeChildren, HasMaybeClassName {
|
|
44
44
|
}
|
|
45
45
|
export interface OverlayProps extends JSX.IntrinsicAttributes {
|
|
@@ -62,7 +62,7 @@ export interface PopoverProps extends JSX.IntrinsicAttributes, HasMaybeChildren
|
|
|
62
62
|
export interface TooltipProps extends JSX.IntrinsicAttributes, HasMaybeChildren, HasMaybeClassName {
|
|
63
63
|
id?: string;
|
|
64
64
|
}
|
|
65
|
-
export
|
|
65
|
+
export type Glyph = "ok" | "refresh" | "warning-sign" | "plus" | "camera" | "headphones" | "user" | "flash" | "menu-hamburger" | "chevron-up" | "chevron-down" | "new-window" | string;
|
|
66
66
|
export interface GlyphiconProps extends JSX.IntrinsicAttributes, HasMaybeStyle, HasMaybeClassName {
|
|
67
67
|
glyph: Glyph | string;
|
|
68
68
|
}
|
|
@@ -77,7 +77,7 @@ export interface ModalProps {
|
|
|
77
77
|
export interface ModalHeader extends React.HTMLProps<any> {
|
|
78
78
|
closeButton?: boolean;
|
|
79
79
|
}
|
|
80
|
-
export
|
|
80
|
+
export type Modal = React.ComponentType<ModalProps> & {
|
|
81
81
|
Body: React.ComponentType;
|
|
82
82
|
Header: React.ComponentType<ModalHeader>;
|
|
83
83
|
Title: React.ComponentType;
|
|
@@ -90,13 +90,13 @@ export interface ColProps extends JSX.IntrinsicAttributes, HasMaybeRef, HasMaybe
|
|
|
90
90
|
lg?: number;
|
|
91
91
|
xsOffset?: number;
|
|
92
92
|
}
|
|
93
|
-
export
|
|
93
|
+
export type ValidationState = "success" | "warning" | "error";
|
|
94
94
|
export interface FormGroupProps extends JSX.IntrinsicAttributes, HasMaybeClassName {
|
|
95
95
|
validationState?: ValidationState | null;
|
|
96
96
|
onMouseOver?: React.MouseEventHandler<any>;
|
|
97
97
|
onMouseOut?: React.MouseEventHandler<any>;
|
|
98
98
|
}
|
|
99
|
-
export
|
|
99
|
+
export type InputGroup = React.ComponentType<any> & {
|
|
100
100
|
Addon: React.ComponentType<InputGroupAddon>;
|
|
101
101
|
Button: React.ComponentType<InputGroupButton>;
|
|
102
102
|
};
|
|
@@ -105,7 +105,7 @@ export interface InputGroupAddon extends JSX.IntrinsicAttributes, HasMaybeChildr
|
|
|
105
105
|
onClick?: React.MouseEventHandler<any>;
|
|
106
106
|
onMouseDown?: React.MouseEventHandler<any>;
|
|
107
107
|
}
|
|
108
|
-
export
|
|
108
|
+
export type InputGroupButton = JSX.IntrinsicAttributes & HasMaybeChildren & HasMaybeClassName;
|
|
109
109
|
export interface FormControlProps extends React.HTMLProps<any>, HasMaybeRef {
|
|
110
110
|
type?: HTMLInputElement["type"];
|
|
111
111
|
readonly?: boolean;
|
|
@@ -122,7 +122,7 @@ export interface ListGroupItemProps extends JSX.IntrinsicAttributes, HasMaybeCla
|
|
|
122
122
|
active?: boolean;
|
|
123
123
|
tabIndex?: number;
|
|
124
124
|
}
|
|
125
|
-
export
|
|
125
|
+
export type Breadcrumb = React.ComponentType<any> & {
|
|
126
126
|
Item: React.ComponentType<BreadcrumbItem>;
|
|
127
127
|
};
|
|
128
128
|
export interface BreadcrumbItem extends JSX.IntrinsicAttributes {
|
|
@@ -145,7 +145,7 @@ export interface PagerItemProps {
|
|
|
145
145
|
disabled?: boolean;
|
|
146
146
|
href?: string;
|
|
147
147
|
}
|
|
148
|
-
export
|
|
148
|
+
export type Pager = React.ComponentType<JSX.IntrinsicAttributes> & {
|
|
149
149
|
Item: React.ComponentType<PagerItemProps>;
|
|
150
150
|
};
|
|
151
151
|
export interface AccordionProps extends JSX.IntrinsicAttributes {
|
|
@@ -156,17 +156,17 @@ export interface AccordionProps extends JSX.IntrinsicAttributes {
|
|
|
156
156
|
export interface CollapseProps extends JSX.IntrinsicAttributes {
|
|
157
157
|
in?: boolean;
|
|
158
158
|
}
|
|
159
|
-
export
|
|
159
|
+
export type DropdownProps = JSX.IntrinsicAttributes & HasMaybeChildren & HasMaybeClassName & {
|
|
160
160
|
id: string;
|
|
161
161
|
pullRight?: boolean;
|
|
162
162
|
open?: boolean;
|
|
163
163
|
onToggle?: React.EventHandler<any>;
|
|
164
164
|
onClick?: React.MouseEventHandler<any>;
|
|
165
165
|
};
|
|
166
|
-
export
|
|
166
|
+
export type DropdownMenuProps = JSX.IntrinsicAttributes & HasMaybeChildren & HasMaybeRef & {
|
|
167
167
|
onSelect?: React.EventHandler<any>;
|
|
168
168
|
};
|
|
169
|
-
export
|
|
169
|
+
export type Dropdown = React.ComponentType<DropdownProps> & {
|
|
170
170
|
Menu: React.ComponentType<DropdownMenuProps>;
|
|
171
171
|
Toggle: React.ComponentType<DropdownToggleProps>;
|
|
172
172
|
};
|
|
@@ -179,7 +179,7 @@ export interface FormProps extends JSX.IntrinsicAttributes, HasMaybeChildren {
|
|
|
179
179
|
inline?: boolean;
|
|
180
180
|
onSubmit?: React.EventHandler<any>;
|
|
181
181
|
}
|
|
182
|
-
export
|
|
182
|
+
export type ControlLabelProps = JSX.IntrinsicAttributes & HasMaybeChildren;
|
|
183
183
|
export interface CheckboxProps extends JSX.IntrinsicAttributes {
|
|
184
184
|
title?: string;
|
|
185
185
|
checked?: boolean;
|
package/lib/translations.json
CHANGED
|
@@ -883,5 +883,10 @@
|
|
|
883
883
|
"fi": "Lisää kenttä",
|
|
884
884
|
"en": "Add field",
|
|
885
885
|
"sv": "Lägg till fält"
|
|
886
|
+
},
|
|
887
|
+
"uniqueItems": {
|
|
888
|
+
"fi": "Samaa arvoa ei saa käyttää useammin kuin kerran",
|
|
889
|
+
"en": "The same value may not be used more than once",
|
|
890
|
+
"sv": "Samma värde får inte användas mer än en gång"
|
|
886
891
|
}
|
|
887
892
|
}
|
package/lib/types.d.ts
CHANGED
|
@@ -1,57 +1,56 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { FieldProps as RJSFFieldProps, WidgetProps as RJSFWidgetProps, UiSchema as RJSFUiSchema } from "@rjsf/utils";
|
|
3
2
|
import { FormContext } from "./components/LajiForm";
|
|
4
|
-
export
|
|
5
|
-
export
|
|
3
|
+
export type JSON = string | number | boolean | JSONObject | JSON[] | null;
|
|
4
|
+
export type JSONObject = {
|
|
6
5
|
[prop: string]: JSON;
|
|
7
6
|
};
|
|
8
|
-
export
|
|
9
|
-
|
|
7
|
+
export type JSONSchema<T = any> = JSONSchemaObject | JSONSchemaArray<T> | JSONSchemaNumber | JSONSchemaInteger | JSONSchemaBoolean | JSONSchemaString | JSONSchemaEnum;
|
|
8
|
+
type JSONShemaTypeCommon<T, D> = {
|
|
10
9
|
type: T;
|
|
11
10
|
default?: D;
|
|
12
11
|
title?: string;
|
|
13
12
|
};
|
|
14
|
-
export
|
|
13
|
+
export type JSONSchemaObject = JSONShemaTypeCommon<"object", Record<string, JSONObject>> & {
|
|
15
14
|
properties: Record<string, JSONSchema>;
|
|
16
15
|
required?: string[];
|
|
17
16
|
};
|
|
18
17
|
export declare function isJSONSchemaObject(schema: JSONSchema): schema is JSONSchemaObject;
|
|
19
|
-
export
|
|
18
|
+
export type JSONSchemaArray<T = JSONSchema, D = never> = JSONShemaTypeCommon<"array", D[]> & {
|
|
20
19
|
items: T;
|
|
21
20
|
uniqueItems?: boolean;
|
|
22
21
|
maxItems?: number;
|
|
23
22
|
};
|
|
24
23
|
export declare function isJSONSchemaArray(schema: JSONSchema): schema is JSONSchemaArray;
|
|
25
|
-
export
|
|
26
|
-
export
|
|
27
|
-
export
|
|
28
|
-
export
|
|
29
|
-
export
|
|
24
|
+
export type JSONSchemaNumber = JSONShemaTypeCommon<"number", number>;
|
|
25
|
+
export type JSONSchemaInteger = JSONShemaTypeCommon<"integer", number>;
|
|
26
|
+
export type JSONSchemaBoolean = JSONShemaTypeCommon<"boolean", boolean>;
|
|
27
|
+
export type JSONSchemaString = JSONShemaTypeCommon<"string", string>;
|
|
28
|
+
export type JSONSchemaEnumOneOf = {
|
|
30
29
|
const: string;
|
|
31
30
|
title: string;
|
|
32
31
|
};
|
|
33
|
-
export
|
|
32
|
+
export type JSONSchemaEnum = JSONSchemaString & {
|
|
34
33
|
oneOf: JSONSchemaEnumOneOf[];
|
|
35
34
|
};
|
|
36
35
|
export declare function isJSONSchemaEnum(jsonSchema: JSONSchema): jsonSchema is JSONSchemaEnum;
|
|
37
|
-
export
|
|
38
|
-
export
|
|
36
|
+
export type Lang = "fi" | "en" | "sv";
|
|
37
|
+
export type WithNonNullableKeys<T, K extends keyof T> = Omit<T, K> & {
|
|
39
38
|
[P in K]-?: NonNullable<T[P]>;
|
|
40
39
|
};
|
|
41
|
-
export
|
|
40
|
+
export type FieldProps<T = any, S extends JSONSchemaObject | JSONSchemaArray = JSONSchemaObject> = WithNonNullableKeys<RJSFFieldProps<T, S, FormContext>, "errorSchema" | "formContext"> & {
|
|
42
41
|
registry: RJSFFieldProps<any, JSONSchema, FormContext>["registry"];
|
|
43
42
|
};
|
|
44
|
-
export
|
|
43
|
+
export type WidgetProps<T = any, S extends JSONSchema = JSONSchema> = WithNonNullableKeys<RJSFWidgetProps<T, S, FormContext>, "errorSchema" | "formContext"> & {
|
|
45
44
|
registry: RJSFFieldProps<any, JSONSchema, FormContext>["registry"];
|
|
46
45
|
};
|
|
47
|
-
export
|
|
46
|
+
export type UiSchema<S extends JSONSchema = JSONSchemaObject> = RJSFUiSchema<any, S, FormContext>;
|
|
48
47
|
export interface HasMaybeChildren {
|
|
49
48
|
children?: React.ReactNode;
|
|
50
49
|
}
|
|
51
50
|
export interface HasMaybeClassName {
|
|
52
51
|
className?: string;
|
|
53
52
|
}
|
|
54
|
-
export
|
|
53
|
+
export type Optional<T, K extends keyof T> = Omit<T, K> & Partial<{
|
|
55
54
|
[K: string]: T[K];
|
|
56
55
|
}>;
|
|
57
56
|
export {};
|
package/lib/types.js
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.isJSONSchemaObject = isJSONSchemaObject;
|
|
4
|
+
exports.isJSONSchemaArray = isJSONSchemaArray;
|
|
5
|
+
exports.isJSONSchemaEnum = isJSONSchemaEnum;
|
|
4
6
|
function isJSONSchemaObject(schema) {
|
|
5
7
|
return schema.type === "object";
|
|
6
8
|
}
|
|
7
|
-
exports.isJSONSchemaObject = isJSONSchemaObject;
|
|
8
9
|
function isJSONSchemaArray(schema) {
|
|
9
10
|
return schema.type === "array";
|
|
10
11
|
}
|
|
11
|
-
exports.isJSONSchemaArray = isJSONSchemaArray;
|
|
12
12
|
function isJSONSchemaEnum(jsonSchema) {
|
|
13
13
|
return !!jsonSchema.oneOf;
|
|
14
14
|
}
|
|
15
|
-
exports.isJSONSchemaEnum = isJSONSchemaEnum;
|
package/lib/utils.d.ts
CHANGED
|
@@ -54,8 +54,8 @@ export declare const getNextInput: (formContext: FormContext) => (inputElem: HTM
|
|
|
54
54
|
export declare const focusNextInput: (formContext: FormContext) => (reverseDirection?: boolean) => boolean;
|
|
55
55
|
export declare const findNearestParentSchemaElemId: (elem: HTMLElement) => string | undefined;
|
|
56
56
|
export declare const getSchemaElementById: (id: string) => HTMLElement | null;
|
|
57
|
-
export declare const focusById: (context: FormContext, id: string, focus?: boolean
|
|
58
|
-
export declare const focusAndScroll: (context: FormContext, idToFocus?: string
|
|
57
|
+
export declare const focusById: (context: FormContext, id: string, focus?: boolean) => boolean;
|
|
58
|
+
export declare const focusAndScroll: (context: FormContext, idToFocus?: string, idToScroll?: string, focus?: boolean) => boolean | undefined;
|
|
59
59
|
export declare const shouldSyncScroll: (context: FormContext) => boolean;
|
|
60
60
|
export declare const _syncScroll: (context: FormContext) => (force?: boolean) => void;
|
|
61
61
|
export declare const syncScroll: (context: FormContext, force: boolean) => void;
|
|
@@ -65,10 +65,10 @@ export declare const filterItemIdsDeeply: (item: any, context: FormContext, idSc
|
|
|
65
65
|
export declare const formDataIsEmpty: (props: FieldProps, context: FormContext) => any;
|
|
66
66
|
export declare const formDataEquals: (f1: any, f2: any, context: FormContext, id: string) => any;
|
|
67
67
|
export declare const keyboardClick: (fn: (e: KeyboardEvent | React.KeyboardEvent) => void, context: FormContext) => (e: KeyboardEvent | React.KeyboardEvent) => void;
|
|
68
|
-
export declare function getNestedTailUiSchema(uiSchema: UiSchema): UiSchema
|
|
69
|
-
export declare function updateTailUiSchema(uiSchema: UiSchema, updateObject: UpdateObject<any, any>): UiSchema
|
|
68
|
+
export declare function getNestedTailUiSchema(uiSchema: UiSchema): UiSchema;
|
|
69
|
+
export declare function updateTailUiSchema(uiSchema: UiSchema, updateObject: UpdateObject<any, any>): UiSchema;
|
|
70
70
|
export declare function getNestedUiFieldsList(uiSchema: UiSchema): any[];
|
|
71
|
-
|
|
71
|
+
type BootstrapColumns = {
|
|
72
72
|
lg: number;
|
|
73
73
|
md: number;
|
|
74
74
|
sm: number;
|
|
@@ -81,7 +81,7 @@ export declare function capitalizeFirstLetter(string: string): string;
|
|
|
81
81
|
export declare function decapitalizeFirstLetter(string: string): string;
|
|
82
82
|
export declare function stringifyKeyCombo(keyCombo?: string): string;
|
|
83
83
|
export declare function canAdd(props: any): any;
|
|
84
|
-
export declare function bsSizeToPixels(bsSize: keyof BootstrapColumns):
|
|
84
|
+
export declare function bsSizeToPixels(bsSize: keyof BootstrapColumns): 768 | 1200 | 992 | 576;
|
|
85
85
|
export declare function pixelsToBsSize(pixels: number): "" | "lg" | "md" | "sm" | "xs";
|
|
86
86
|
export declare function applyFunction(props: FieldProps): any;
|
|
87
87
|
export declare function getWindowScrolled(): number;
|
|
@@ -121,14 +121,14 @@ export declare function schemaJSONPointer(schema: RJSFSchema, JSONPointer: strin
|
|
|
121
121
|
export declare function uiSchemaJSONPointer(schema: RJSFSchema, JSONPointer: string): string | undefined;
|
|
122
122
|
export declare function updateFormDataWithJSONPointer(schemaProps: Pick<FieldProps, "formData" | "registry" | "schema">, value: any, path: string): any;
|
|
123
123
|
export declare const assignUUID: (item: any, immutably?: boolean) => any;
|
|
124
|
-
export declare const getUUID: (item?: any) => number;
|
|
124
|
+
export declare const getUUID: (item?: any) => number | string | undefined;
|
|
125
125
|
/**
|
|
126
126
|
* Return item UUID or the parent UUID
|
|
127
127
|
**/
|
|
128
128
|
export declare const getFieldUUID: (props: {
|
|
129
129
|
formData?: any;
|
|
130
130
|
formContext: FormContext;
|
|
131
|
-
}) =>
|
|
131
|
+
}) => string | number;
|
|
132
132
|
export declare function addLajiFormIds(_formData: any, tree: any, immutably?: boolean): [any, {
|
|
133
133
|
[id: string]: true;
|
|
134
134
|
}];
|
|
@@ -136,7 +136,7 @@ export declare function getAllLajiFormIdsDeeply(_formData: any, tree: any): {
|
|
|
136
136
|
[id: string]: true;
|
|
137
137
|
};
|
|
138
138
|
export declare function removeLajiFormIds(formData: any, tree: any): any;
|
|
139
|
-
export declare function findPointerForLajiFormId(tmpIdTree: any, formData: any, lajiFormId: any): string | undefined;
|
|
139
|
+
export declare function findPointerForLajiFormId(tmpIdTree: any | undefined, formData: any, lajiFormId: any): string | undefined;
|
|
140
140
|
export declare function highlightElem(elem?: Element): void;
|
|
141
141
|
export declare function filteredErrors(errorSchema: any): any;
|
|
142
142
|
export declare function constructTranslations(translations: {
|