@luomus/laji-form 14.3.6
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/CHANGELOG.md +215 -0
- package/LICENSE +21 -0
- package/README.md +180 -0
- package/cypress/fixtures/example.json +5 -0
- closes suggestion list (failed).png +0 -0
- is marked as suggested (failed).png +0 -0
- package/dist/images/finnish-flag.png +0 -0
- package/dist/images/handled.png +0 -0
- package/dist/images/heard.png +0 -0
- package/dist/images/indirect.png +0 -0
- package/dist/images/media.png +0 -0
- package/dist/images/seen.png +0 -0
- package/dist/images/specimen.png +0 -0
- package/dist/laji-form.js +2 -0
- package/dist/laji-form.js.LICENSE.txt +92 -0
- package/dist/styles.css +3771 -0
- package/lib/ApiClient.d.ts +46 -0
- package/lib/ApiClient.js +93 -0
- package/lib/Context.d.ts +8 -0
- package/lib/Context.js +18 -0
- package/lib/ReactContext.d.ts +7 -0
- package/lib/ReactContext.js +5 -0
- package/lib/components/BaseComponent.d.ts +9 -0
- package/lib/components/BaseComponent.js +29 -0
- package/lib/components/LajiForm.d.ts +221 -0
- package/lib/components/LajiForm.js +614 -0
- package/lib/components/VirtualSchemaField.d.ts +42 -0
- package/lib/components/VirtualSchemaField.js +74 -0
- package/lib/components/components.d.ts +119 -0
- package/lib/components/components.js +606 -0
- package/lib/components/fields/AnnotationField.d.ts +34 -0
- package/lib/components/fields/AnnotationField.js +242 -0
- package/lib/components/fields/AnyToBooleanField.d.ts +18 -0
- package/lib/components/fields/AnyToBooleanField.js +20 -0
- package/lib/components/fields/ArrayBulkField.d.ts +23 -0
- package/lib/components/fields/ArrayBulkField.js +82 -0
- package/lib/components/fields/ArrayCombinerField.d.ts +36 -0
- package/lib/components/fields/ArrayCombinerField.js +138 -0
- package/lib/components/fields/ArrayField.d.ts +39 -0
- package/lib/components/fields/ArrayField.js +148 -0
- package/lib/components/fields/AudioArrayField.d.ts +22 -0
- package/lib/components/fields/AudioArrayField.js +100 -0
- package/lib/components/fields/AutoArrayField.d.ts +24 -0
- package/lib/components/fields/AutoArrayField.js +56 -0
- package/lib/components/fields/AutosuggestField.d.ts +69 -0
- package/lib/components/fields/AutosuggestField.js +299 -0
- package/lib/components/fields/CombinedValueDisplayField.d.ts +41 -0
- package/lib/components/fields/CombinedValueDisplayField.js +100 -0
- package/lib/components/fields/ConditionalOnChangeField.d.ts +42 -0
- package/lib/components/fields/ConditionalOnChangeField.js +107 -0
- package/lib/components/fields/ConditionalUiSchemaField.d.ts +123 -0
- package/lib/components/fields/ConditionalUiSchemaField.js +143 -0
- package/lib/components/fields/ContextInjectionField.d.ts +24 -0
- package/lib/components/fields/ContextInjectionField.js +68 -0
- package/lib/components/fields/DataLeakerField.d.ts +40 -0
- package/lib/components/fields/DataLeakerField.js +68 -0
- package/lib/components/fields/DefaultValueArrayField.d.ts +34 -0
- package/lib/components/fields/DefaultValueArrayField.js +59 -0
- package/lib/components/fields/DependentBooleanField.d.ts +38 -0
- package/lib/components/fields/DependentBooleanField.js +87 -0
- package/lib/components/fields/DependentDisableField.d.ts +35 -0
- package/lib/components/fields/DependentDisableField.js +71 -0
- package/lib/components/fields/EnumRangeArrayField.d.ts +27 -0
- package/lib/components/fields/EnumRangeArrayField.js +115 -0
- package/lib/components/fields/ExtraLabelRowField.d.ts +38 -0
- package/lib/components/fields/ExtraLabelRowField.js +100 -0
- package/lib/components/fields/FakePropertyField.d.ts +18 -0
- package/lib/components/fields/FakePropertyField.js +48 -0
- package/lib/components/fields/FilterArrayField.d.ts +73 -0
- package/lib/components/fields/FilterArrayField.js +121 -0
- package/lib/components/fields/FlatField.d.ts +29 -0
- package/lib/components/fields/FlatField.js +171 -0
- package/lib/components/fields/GeocoderField.d.ts +47 -0
- package/lib/components/fields/GeocoderField.js +372 -0
- package/lib/components/fields/GridLayoutField.d.ts +18 -0
- package/lib/components/fields/GridLayoutField.js +32 -0
- package/lib/components/fields/HiddenField.d.ts +10 -0
- package/lib/components/fields/HiddenField.js +11 -0
- package/lib/components/fields/ImageArrayField.d.ts +153 -0
- package/lib/components/fields/ImageArrayField.js +696 -0
- package/lib/components/fields/ImageDisplayField.d.ts +18 -0
- package/lib/components/fields/ImageDisplayField.js +44 -0
- package/lib/components/fields/InitiallyHiddenField.d.ts +21 -0
- package/lib/components/fields/InitiallyHiddenField.js +58 -0
- package/lib/components/fields/InjectDefaultValueField.d.ts +37 -0
- package/lib/components/fields/InjectDefaultValueField.js +68 -0
- package/lib/components/fields/InjectField.d.ts +46 -0
- package/lib/components/fields/InjectField.js +88 -0
- package/lib/components/fields/InputWithDefaultValueButtonField.d.ts +25 -0
- package/lib/components/fields/InputWithDefaultValueButtonField.js +61 -0
- package/lib/components/fields/LocalityField.d.ts +22 -0
- package/lib/components/fields/LocalityField.js +94 -0
- package/lib/components/fields/LocationChooserField.d.ts +27 -0
- package/lib/components/fields/LocationChooserField.js +440 -0
- package/lib/components/fields/MapArrayField.d.ts +78 -0
- package/lib/components/fields/MapArrayField.js +1783 -0
- package/lib/components/fields/MapField.d.ts +48 -0
- package/lib/components/fields/MapField.js +434 -0
- package/lib/components/fields/MultiAnyToBooleanField.d.ts +25 -0
- package/lib/components/fields/MultiAnyToBooleanField.js +100 -0
- package/lib/components/fields/MultiArrayField.d.ts +53 -0
- package/lib/components/fields/MultiArrayField.js +224 -0
- package/lib/components/fields/MultiLanguageField.d.ts +13 -0
- package/lib/components/fields/MultiLanguageField.js +52 -0
- package/lib/components/fields/MultiTagArrayField.d.ts +36 -0
- package/lib/components/fields/MultiTagArrayField.js +142 -0
- package/lib/components/fields/NamedPlaceChooserField.d.ts +29 -0
- package/lib/components/fields/NamedPlaceChooserField.js +380 -0
- package/lib/components/fields/NamedPlaceSaverField.d.ts +29 -0
- package/lib/components/fields/NamedPlaceSaverField.js +237 -0
- package/lib/components/fields/NestField.d.ts +148 -0
- package/lib/components/fields/NestField.js +289 -0
- package/lib/components/fields/ObjectField.d.ts +2 -0
- package/lib/components/fields/ObjectField.js +119 -0
- package/lib/components/fields/PrefillingArrayField.d.ts +22 -0
- package/lib/components/fields/PrefillingArrayField.js +65 -0
- package/lib/components/fields/SchemaField.d.ts +7 -0
- package/lib/components/fields/SchemaField.js +109 -0
- package/lib/components/fields/ScopeField.d.ts +85 -0
- package/lib/components/fields/ScopeField.js +521 -0
- package/lib/components/fields/SectionArrayField.d.ts +38 -0
- package/lib/components/fields/SectionArrayField.js +614 -0
- package/lib/components/fields/SelectTreeField.d.ts +39 -0
- package/lib/components/fields/SelectTreeField.js +143 -0
- package/lib/components/fields/SingleActiveArrayField.d.ts +49 -0
- package/lib/components/fields/SingleActiveArrayField.js +974 -0
- package/lib/components/fields/SingleItemArrayField.d.ts +15 -0
- package/lib/components/fields/SingleItemArrayField.js +60 -0
- package/lib/components/fields/SortArrayField.d.ts +73 -0
- package/lib/components/fields/SortArrayField.js +351 -0
- package/lib/components/fields/SplitField.d.ts +28 -0
- package/lib/components/fields/SplitField.js +65 -0
- package/lib/components/fields/StringToArrayField.d.ts +24 -0
- package/lib/components/fields/StringToArrayField.js +48 -0
- package/lib/components/fields/SumField.d.ts +35 -0
- package/lib/components/fields/SumField.js +83 -0
- package/lib/components/fields/TableField.d.ts +18 -0
- package/lib/components/fields/TableField.js +136 -0
- package/lib/components/fields/TagArrayField.d.ts +38 -0
- package/lib/components/fields/TagArrayField.js +128 -0
- package/lib/components/fields/ToggleAdditionalArrayFieldsField.d.ts +26 -0
- package/lib/components/fields/ToggleAdditionalArrayFieldsField.js +81 -0
- package/lib/components/fields/UiFieldApplierField.d.ts +30 -0
- package/lib/components/fields/UiFieldApplierField.js +106 -0
- package/lib/components/fields/UiFieldMapperArrayField.d.ts +42 -0
- package/lib/components/fields/UiFieldMapperArrayField.js +121 -0
- package/lib/components/fields/UnitCountShorthandField.d.ts +22 -0
- package/lib/components/fields/UnitCountShorthandField.js +149 -0
- package/lib/components/fields/UnitListShorthandArrayField.d.ts +26 -0
- package/lib/components/fields/UnitListShorthandArrayField.js +108 -0
- package/lib/components/fields/UnitShorthandField.d.ts +32 -0
- package/lib/components/fields/UnitShorthandField.js +220 -0
- package/lib/components/templates/ArrayFieldTemplate.d.ts +85 -0
- package/lib/components/templates/ArrayFieldTemplate.js +416 -0
- package/lib/components/templates/BaseInputTemplate.d.ts +11 -0
- package/lib/components/templates/BaseInputTemplate.js +80 -0
- package/lib/components/templates/DescriptionField.d.ts +1 -0
- package/lib/components/templates/DescriptionField.js +37 -0
- package/lib/components/templates/ErrorListTemplate.d.ts +9 -0
- package/lib/components/templates/ErrorListTemplate.js +95 -0
- package/lib/components/templates/FieldTemplate.d.ts +6 -0
- package/lib/components/templates/FieldTemplate.js +112 -0
- package/lib/components/templates/ObjectFieldTemplate.d.ts +7 -0
- package/lib/components/templates/ObjectFieldTemplate.js +66 -0
- package/lib/components/templates/TitleField.d.ts +9 -0
- package/lib/components/templates/TitleField.js +51 -0
- package/lib/components/widgets/AnyToBooleanWidget.d.ts +20 -0
- package/lib/components/widgets/AnyToBooleanWidget.js +49 -0
- package/lib/components/widgets/AutosuggestWidget.d.ts +66 -0
- package/lib/components/widgets/AutosuggestWidget.js +1127 -0
- package/lib/components/widgets/CheckboxWidget.d.ts +37 -0
- package/lib/components/widgets/CheckboxWidget.js +139 -0
- package/lib/components/widgets/DateTimeWidget.d.ts +62 -0
- package/lib/components/widgets/DateTimeWidget.js +251 -0
- package/lib/components/widgets/DateWidget.d.ts +23 -0
- package/lib/components/widgets/DateWidget.js +41 -0
- package/lib/components/widgets/HiddenWidget.d.ts +15 -0
- package/lib/components/widgets/HiddenWidget.js +19 -0
- package/lib/components/widgets/ImageSelectWidget.d.ts +14 -0
- package/lib/components/widgets/ImageSelectWidget.js +57 -0
- package/lib/components/widgets/InformalTaxonGroupChooserWidget.d.ts +43 -0
- package/lib/components/widgets/InformalTaxonGroupChooserWidget.js +237 -0
- package/lib/components/widgets/InputGroupWidget.d.ts +21 -0
- package/lib/components/widgets/InputGroupWidget.js +36 -0
- package/lib/components/widgets/InputWithDefaultValueButtonWidget.d.ts +21 -0
- package/lib/components/widgets/InputWithDefaultValueButtonWidget.js +47 -0
- package/lib/components/widgets/NumberWidget.d.ts +13 -0
- package/lib/components/widgets/NumberWidget.js +21 -0
- package/lib/components/widgets/PlainTextWidget.d.ts +12 -0
- package/lib/components/widgets/PlainTextWidget.js +24 -0
- package/lib/components/widgets/SelectWidget.d.ts +52 -0
- package/lib/components/widgets/SelectWidget.js +158 -0
- package/lib/components/widgets/SeparatedDateTimeWidget.d.ts +19 -0
- package/lib/components/widgets/SeparatedDateTimeWidget.js +59 -0
- package/lib/components/widgets/TaxonImageWidget.d.ts +13 -0
- package/lib/components/widgets/TaxonImageWidget.js +30 -0
- package/lib/components/widgets/TextSelectWidget.d.ts +25 -0
- package/lib/components/widgets/TextSelectWidget.js +94 -0
- package/lib/components/widgets/TextareaWidget.d.ts +32 -0
- package/lib/components/widgets/TextareaWidget.js +87 -0
- package/lib/components/widgets/TimeWidget.d.ts +11 -0
- package/lib/components/widgets/TimeWidget.js +19 -0
- package/lib/components/widgets/URLWidget.d.ts +14 -0
- package/lib/components/widgets/URLWidget.js +12 -0
- package/lib/components/widgets/UpperCaseWidget.d.ts +13 -0
- package/lib/components/widgets/UpperCaseWidget.js +21 -0
- package/lib/index.d.ts +20 -0
- package/lib/index.js +50 -0
- package/lib/services/blocker-service.d.ts +11 -0
- package/lib/services/blocker-service.js +55 -0
- package/lib/services/custom-event-service.d.ts +17 -0
- package/lib/services/custom-event-service.js +35 -0
- package/lib/services/dom-id-service.d.ts +8 -0
- package/lib/services/dom-id-service.js +30 -0
- package/lib/services/focus-service.d.ts +13 -0
- package/lib/services/focus-service.js +60 -0
- package/lib/services/id-service.d.ts +22 -0
- package/lib/services/id-service.js +130 -0
- package/lib/services/key-handler-service.d.ts +56 -0
- package/lib/services/key-handler-service.js +184 -0
- package/lib/services/root-instance-service.d.ts +25 -0
- package/lib/services/root-instance-service.js +49 -0
- package/lib/services/settings-service.d.ts +34 -0
- package/lib/services/settings-service.js +154 -0
- package/lib/services/singleton-map-service.d.ts +23 -0
- package/lib/services/singleton-map-service.js +44 -0
- package/lib/services/submit-hook-service.d.ts +24 -0
- package/lib/services/submit-hook-service.js +73 -0
- package/lib/styles.d.ts +1 -0
- package/lib/styles.js +4 -0
- package/lib/themes/bs3.d.ts +3 -0
- package/lib/themes/bs3.js +133 -0
- package/lib/themes/bs5.d.ts +3 -0
- package/lib/themes/bs5.js +111 -0
- package/lib/themes/glyphicon-fa-mapping.d.ts +3 -0
- package/lib/themes/glyphicon-fa-mapping.js +271 -0
- package/lib/themes/stub.d.ts +3 -0
- package/lib/themes/stub.js +82 -0
- package/lib/themes/theme.d.ts +233 -0
- package/lib/themes/theme.js +2 -0
- package/lib/translations.json +842 -0
- package/lib/utils.d.ts +167 -0
- package/lib/utils.js +1191 -0
- package/lib/validation.d.ts +7 -0
- package/lib/validation.js +141 -0
- package/llol +10 -0
- package/llol.pdf +10 -0
- package/package.json +99 -0
- package/q +196 -0
- package/test-export/array-spec.d.ts +1 -0
- package/test-export/array-spec.js +204 -0
- package/test-export/bird-point-count-spec.d.ts +1 -0
- package/test-export/bird-point-count-spec.js +62 -0
- package/test-export/collection-contest-form-spec.d.ts +1 -0
- package/test-export/collection-contest-form-spec.js +38 -0
- package/test-export/dataset-form-spec.d.ts +1 -0
- package/test-export/dataset-form-spec.js +50 -0
- package/test-export/date-time-widget-spec.d.ts +1 -0
- package/test-export/date-time-widget-spec.js +188 -0
- package/test-export/geocoder-spec.d.ts +1 -0
- package/test-export/geocoder-spec.js +135 -0
- package/test-export/image-array-spec.d.ts +1 -0
- package/test-export/image-array-spec.js +94 -0
- package/test-export/inject-field-spec.d.ts +1 -0
- package/test-export/inject-field-spec.js +148 -0
- package/test-export/internal-uuids-spec.d.ts +1 -0
- package/test-export/internal-uuids-spec.js +157 -0
- package/test-export/invasive-species-eradication-np-spec.d.ts +1 -0
- package/test-export/invasive-species-eradication-np-spec.js +18 -0
- package/test-export/invasive-species-eradication-spec.d.ts +1 -0
- package/test-export/invasive-species-eradication-spec.js +25 -0
- package/test-export/line-transect-spec.d.ts +1 -0
- package/test-export/line-transect-spec.js +121 -0
- package/test-export/mobile-form-spec.d.ts +1 -0
- package/test-export/mobile-form-spec.js +84 -0
- package/test-export/nafi-spec.d.ts +1 -0
- package/test-export/nafi-spec.js +85 -0
- package/test-export/select-widget-spec.d.ts +1 -0
- package/test-export/select-widget-spec.js +68 -0
- package/test-export/single-item-array-field-spec.d.ts +1 -0
- package/test-export/single-item-array-field-spec.js +92 -0
- package/test-export/syke-butterfly-spec.d.ts +1 -0
- package/test-export/syke-butterfly-spec.js +163 -0
- package/test-export/test-utils.d.ts +184 -0
- package/test-export/test-utils.js +354 -0
- package/test-export/transaction-form-spec.d.ts +1 -0
- package/test-export/transaction-form-spec.js +63 -0
- package/test-export/trip-report-autosuggest-spec.d.ts +1 -0
- package/test-export/trip-report-autosuggest-spec.js +272 -0
- package/test-export/trip-report-spec.d.ts +1 -0
- package/test-export/trip-report-spec.js +456 -0
- package/test-export/unit-list-shorthand-array-field-spec.d.ts +1 -0
- package/test-export/unit-list-shorthand-array-field-spec.js +71 -0
- package/test-export/validation-spec.d.ts +1 -0
- package/test-export/validation-spec.js +336 -0
- package/test-export/water-bird-spec.d.ts +1 -0
- package/test-export/water-bird-spec.js +30 -0
- package/test-export/wbc-spec.d.ts +1 -0
- package/test-export/wbc-spec.js +82 -0
- package/tsconfig.json +25 -0
- package/tsconfig.lib.json +11 -0
- package/tsconfig.test.json +10 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
## 14.3.2
|
|
2
|
+
* `SortArrayField`: add `multisort` option (defaults to `false`)
|
|
3
|
+
|
|
4
|
+
## 14.3.1
|
|
5
|
+
* `SortArrayField`: add `columns[*].tooltip` & `excludeSortableColumns` options
|
|
6
|
+
|
|
7
|
+
## 14.1.0
|
|
8
|
+
* Add bootstrap 5 theme
|
|
9
|
+
|
|
10
|
+
## 14.0.0
|
|
11
|
+
### BREAKING CHANGES:
|
|
12
|
+
* `react-jsonschema-form` updated to version `5`. Read more: https://react-jsonschema-form.readthedocs.io/en/latest/5.x%20upgrade%20guide/
|
|
13
|
+
|
|
14
|
+
## 13.0.0
|
|
15
|
+
### BREAKING CHANGES:
|
|
16
|
+
* Support for JSON Schema `enum` & `enumNames` properties dropped since they aren't JSON Schema. Instead, enums should be in format `{const: string, title: string}[]`.
|
|
17
|
+
|
|
18
|
+
## 12.5.0
|
|
19
|
+
* add `lajiGeoServerAddress` option
|
|
20
|
+
|
|
21
|
+
## 12.4.0
|
|
22
|
+
* Add `showButtons.same` option for `DateTimeWidget`
|
|
23
|
+
|
|
24
|
+
## 12.3.0
|
|
25
|
+
* Parameterize `AutosuggestField` `toggleable` default `toggle` status, `tooltip` and `placeholder`
|
|
26
|
+
|
|
27
|
+
## 12.2.0
|
|
28
|
+
* Add `jsonPointer` operator to `computeUiSchema` (used by e.g. `MultiArrayField`, `ConditionalUiSchemaField`)
|
|
29
|
+
|
|
30
|
+
## 12.1.0
|
|
31
|
+
* MultiArrayField can persist by parent id
|
|
32
|
+
* ConditionalUiSchemaField rules "isEdit" and "isAdmin" can be given as {"rule": "isEdit"}, so that it can leverage e.g. {"complement": true}
|
|
33
|
+
* SelectWidget selects focused with tab
|
|
34
|
+
* AutosuggestWidget toggler moved to left side of input
|
|
35
|
+
|
|
36
|
+
## 12.0.4
|
|
37
|
+
* Checkbox widget hides label of nonactive button if has no custom labels. If a button for undefined isn't shown, click either button toggles the value.
|
|
38
|
+
|
|
39
|
+
## 12.0.0
|
|
40
|
+
### BREAKING CHANGES:
|
|
41
|
+
* Buttons don't use `primary` variant by default & not strong text.
|
|
42
|
+
|
|
43
|
+
## 11.0.0
|
|
44
|
+
* TS declarations files included in `lib`
|
|
45
|
+
|
|
46
|
+
### BREAKING CHANGES:
|
|
47
|
+
* `lib/app` moved to `lib/index`
|
|
48
|
+
|
|
49
|
+
## 10.0.0
|
|
50
|
+
* Style framework agnostic, bootstrap 3 dependency is optional. More in README.
|
|
51
|
+
* Improved app wrapper
|
|
52
|
+
|
|
53
|
+
### BREAKING CHANGES:
|
|
54
|
+
* `react-bootstrap@0.33.1` must be installed separately
|
|
55
|
+
* LajiForm component can't be accessed anymore through `LajiForm.app.refs.lajiform`. Use `LajiForm.lajiForm` instead.
|
|
56
|
+
|
|
57
|
+
## 9.0.1
|
|
58
|
+
* Add `allowOnlyYear` option for `DateTimeWidget` & `DateWidget`
|
|
59
|
+
|
|
60
|
+
## 9.0.0
|
|
61
|
+
### BREAKING CHANGES:
|
|
62
|
+
* Revert "Buttons don't use `primary` bs role by default & not strong text"
|
|
63
|
+
|
|
64
|
+
## 8.1.0
|
|
65
|
+
* Replace boolean switches with radio buttons
|
|
66
|
+
|
|
67
|
+
## 8.0.0
|
|
68
|
+
* add `activeHeightOffset` to `SingleActiveArrayField` table
|
|
69
|
+
|
|
70
|
+
### BREAKING CHANGES:
|
|
71
|
+
* Buttons don't use `primary` bs role by default & not strong text
|
|
72
|
+
|
|
73
|
+
## 7.2.0
|
|
74
|
+
* Add `submitOnlySchemaValidations`
|
|
75
|
+
|
|
76
|
+
## 7.1.0
|
|
77
|
+
* Add `mediaMetadata` prop, which replaces `defaultImageMetadata` in settings (breaking change! Accidentally released as feature release)
|
|
78
|
+
|
|
79
|
+
## 7.0.0
|
|
80
|
+
* Globally interpreted `[test].injections` moved to `ui:injections`
|
|
81
|
+
|
|
82
|
+
## 6.1.0
|
|
83
|
+
* Add `tag` option to `PlainTextWidget`
|
|
84
|
+
|
|
85
|
+
## 6.0.0
|
|
86
|
+
* Exclude TypeScript declarations in `lib`
|
|
87
|
+
* Export tests to npm package
|
|
88
|
+
|
|
89
|
+
### BREAKING CHANGES:
|
|
90
|
+
* Doesn't include typescript declarations anymore
|
|
91
|
+
|
|
92
|
+
## 5.8.0
|
|
93
|
+
* Include TypeScript declarations in `lib`
|
|
94
|
+
|
|
95
|
+
## 5.7.3
|
|
96
|
+
* `InjectField` `fields` must begin with "/" if they are to be handled as JSON pointers properly
|
|
97
|
+
|
|
98
|
+
## 5.7.0
|
|
99
|
+
* `FakePropertyField`: add `skipIfEmpty` to field options
|
|
100
|
+
* `URLWidget`: add `template` option
|
|
101
|
+
|
|
102
|
+
## 5.6.0
|
|
103
|
+
* add `NumberWidget`
|
|
104
|
+
|
|
105
|
+
## 5.5.0
|
|
106
|
+
* `AutosuggestField`: added `suggestionValueParse` & `suggestionReceivers` support fallback field to use
|
|
107
|
+
|
|
108
|
+
## 5.4.0
|
|
109
|
+
* remove `getTaxonAutocompleteHTMLString` method from ApiClient
|
|
110
|
+
|
|
111
|
+
## 5.3.0
|
|
112
|
+
* add `getTaxonAutocompleteHTMLString` method for ApiClient
|
|
113
|
+
|
|
114
|
+
## 5.2.0
|
|
115
|
+
* Add named place removal
|
|
116
|
+
|
|
117
|
+
## 5.1.2
|
|
118
|
+
* Use upstream react-jsonschema-form instead of private fork
|
|
119
|
+
|
|
120
|
+
## 5.1.0
|
|
121
|
+
* Add `onValidationError` prop
|
|
122
|
+
|
|
123
|
+
## 5.0.0
|
|
124
|
+
### BREAKING CHANGES:
|
|
125
|
+
* Remove `ConditionalAdditionalItemsArrayField` (can be implemented with `MultiArrayField`).
|
|
126
|
+
* Remove `SingleActiveArrayField` `split` renderer (can be implemented with `MultiArrayField`).
|
|
127
|
+
|
|
128
|
+
## 4.9.0
|
|
129
|
+
* Add `ToggleAdditionalArrayFieldsField`
|
|
130
|
+
|
|
131
|
+
## 4.8.0
|
|
132
|
+
* Add `InjectTaxonCensusFilterField`
|
|
133
|
+
* Add `MultiAnyToBooleanField`
|
|
134
|
+
|
|
135
|
+
## 4.7.0
|
|
136
|
+
* `ScopeField` doesn't remove props from `schema`, but hides them with `uiSchema`
|
|
137
|
+
* `LocationChooserField` allows JSON pointer for `geometryField`
|
|
138
|
+
|
|
139
|
+
## 4.6.0
|
|
140
|
+
* Add `FilterArrayField`
|
|
141
|
+
* uiSchema option `rules` allows `complement` option
|
|
142
|
+
|
|
143
|
+
## 4.5.0
|
|
144
|
+
* Add `FilterArrayField`
|
|
145
|
+
* uiSchema components that use `rules` allow `complement` option, which complements the rule result
|
|
146
|
+
|
|
147
|
+
## 4.4.0
|
|
148
|
+
* Add `AudioArrayField`
|
|
149
|
+
|
|
150
|
+
## 4.3.0
|
|
151
|
+
* add `autoFocus` root uiSchema option
|
|
152
|
+
|
|
153
|
+
## 4.2.0
|
|
154
|
+
* Add SectionArrayField & MultiArrayField
|
|
155
|
+
|
|
156
|
+
## 4.1.0
|
|
157
|
+
* Add `FakePropertyField`
|
|
158
|
+
* add `data` option to `MapField`
|
|
159
|
+
* InjectField works with proper JSON pointers
|
|
160
|
+
|
|
161
|
+
## 4.0.0
|
|
162
|
+
### BREAKING CHANGES:
|
|
163
|
+
* `src/validation.js` default export function doesn't take in `liveErrors` or `liveWarnings` parameters any more
|
|
164
|
+
|
|
165
|
+
## 3.0.1
|
|
166
|
+
* add deprecation warning about utils `getUpdateObjectFromJSONPath` and `updateSafelyWithJSONPath` (renamed to 'JSONPointer')
|
|
167
|
+
|
|
168
|
+
## 3.0.0
|
|
169
|
+
### BREAKING CHANGES:
|
|
170
|
+
* `validate()` signature has changed
|
|
171
|
+
* `onSubmit()` signature has changed, uses `formData` from `state`
|
|
172
|
+
* `submit()` signature has changed
|
|
173
|
+
|
|
174
|
+
## 2.2.0
|
|
175
|
+
* Label can be overridden through `fields` prop
|
|
176
|
+
|
|
177
|
+
## 2.1.2
|
|
178
|
+
* Upgrade RJSF to 2.0.0-alpha (got rid of private fork finally!), fixes computing array defaults etc
|
|
179
|
+
|
|
180
|
+
## 2.1.1
|
|
181
|
+
* Schema of type `number` or `integer` aren't rendered as number inputs
|
|
182
|
+
|
|
183
|
+
## 2.1.0
|
|
184
|
+
* Add showID option for person AutosuggestWidget (for admin only)
|
|
185
|
+
* Pass `formContext` from props to RJSF
|
|
186
|
+
|
|
187
|
+
## 2.0.9
|
|
188
|
+
* Add `sideEffects` options for ImageArrayField
|
|
189
|
+
|
|
190
|
+
## 2.0.5
|
|
191
|
+
* Pass `fields` and `widgets` from props to RJSF
|
|
192
|
+
* don't `src` in npm package
|
|
193
|
+
|
|
194
|
+
## 2.0.0
|
|
195
|
+
### BREAKING CHANGES:
|
|
196
|
+
* Remove `TemplateArrayField`
|
|
197
|
+
|
|
198
|
+
## 1.2.6
|
|
199
|
+
* `lib` keeps src folder structure & doesn't include styles
|
|
200
|
+
|
|
201
|
+
## 1.2.5
|
|
202
|
+
* include `src` in npm package
|
|
203
|
+
|
|
204
|
+
## 1.2.4
|
|
205
|
+
* Fix 'main' in package.json
|
|
206
|
+
|
|
207
|
+
## 1.2.0
|
|
208
|
+
* Background jobs can be retried
|
|
209
|
+
* ImageArrayField sends DELETE request to API when image is removed
|
|
210
|
+
|
|
211
|
+
## 1.1.0
|
|
212
|
+
* Listen to keyboard events on HTML document level
|
|
213
|
+
|
|
214
|
+
## 1.0.0
|
|
215
|
+
* Started using semver
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2014 Dan Abramov
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
# README
|
|
2
|
+
|
|
3
|
+
LajiForm is a dynamic form built on React. It can be used as a standalone library or as a React component. LajiForm is a wrapper for [react-jsonschema-form](https://github.com/mozilla-services/react-jsonschema-form).
|
|
4
|
+
|
|
5
|
+
# Installing
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
npm install @luomus/laji-form --save
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
If you are going to use the bootstrap 3 theme, you need to install also `react-bootstrap`:
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
npm install react-bootstrap@0.33.1 --save
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
# Usage as a library
|
|
18
|
+
|
|
19
|
+
LajiForm passes all its properties to react-jsonschema-form. Read the documentation for react-jsonschema-form.
|
|
20
|
+
|
|
21
|
+
## Usage as a standalone library
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
import LajiForm from "laji-form";
|
|
25
|
+
|
|
26
|
+
new LajiForm({
|
|
27
|
+
schema: schema,
|
|
28
|
+
uiSchema: uiSchema, formData: formData,
|
|
29
|
+
rootElem: document.getElementById("app")
|
|
30
|
+
});
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
You can update the properties with ```setState(props)```. You need to pass only the properties that you are changing, since it just calls the React component's ```setState(props)```.
|
|
34
|
+
|
|
35
|
+
You can unmount the component with ```unmount()```.
|
|
36
|
+
|
|
37
|
+
## Usage as a React component
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
import React from "react";
|
|
41
|
+
import { render } from "react-dom";
|
|
42
|
+
import LajiForm from "laji-form/lib/components/LajiForm";
|
|
43
|
+
|
|
44
|
+
render(<LajiForm
|
|
45
|
+
schema={...}
|
|
46
|
+
uiSchema={...}
|
|
47
|
+
formData={...} />,
|
|
48
|
+
document.getElementById("app"));
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## API Client
|
|
52
|
+
|
|
53
|
+
In addition to properties you would pass to <Form />, you must pass an api client implementation, if you need to use fields that use lajitest.api.fi. The api client implementation must have ```fetch()``` -method, which **returns a Promise**.
|
|
54
|
+
|
|
55
|
+
```fetch(path, query, options)``` parameters are as follows:
|
|
56
|
+
|
|
57
|
+
* **path:** URL path for GET.
|
|
58
|
+
* **query:** Object, where keys are param names and values are param values.
|
|
59
|
+
* **options:** Object containing options for request.
|
|
60
|
+
|
|
61
|
+
See the example implementation in [src/playground/ApiClientImplementation.js](https://bitbucket.org/luomus/laji-form.js/src/HEAD/playground/ApiClientImplementation.js).
|
|
62
|
+
|
|
63
|
+
Pass the implementation to LajiForm like so:
|
|
64
|
+
|
|
65
|
+
```
|
|
66
|
+
<LajiForm apiClient={new ApiClientImplementation()} ... />
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Themes
|
|
70
|
+
|
|
71
|
+
### Bootstrap 3
|
|
72
|
+
LajiForm provides bootstrap 3 theme. To use it, you need to install `react-bootstrap@0.33.1` and provide the built-in bootstrap 3 theme it as a prop:
|
|
73
|
+
|
|
74
|
+
```
|
|
75
|
+
import bs3 from "laji-form/lib/themes/bs3";
|
|
76
|
+
|
|
77
|
+
<LajiForm theme={bs3} ... />
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### Bootstrap 5
|
|
81
|
+
|
|
82
|
+
To use bootstrap 5 theme, you need to install following packages:
|
|
83
|
+
```
|
|
84
|
+
npm install --save react-bootstrap-5@npm:react-bootstrap@2.5.0
|
|
85
|
+
mpn install --save @fortawesome/fontawesome-svg-core@6.2.0
|
|
86
|
+
npm install --save @fortawesome/free-solid-svg-icons@6.2.0
|
|
87
|
+
npm install --save @fortawesome/react-fontawesome@0.2.0
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Then it can be used by providing the theme to the form:
|
|
91
|
+
|
|
92
|
+
```
|
|
93
|
+
import bs5 from "laji-form/lib/themes/bs5";
|
|
94
|
+
|
|
95
|
+
<LajiForm theme={bs5} ... />
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
You can also use a custom theme and provide it the same way. There is a theme interface `themes/theme.ts` which the theme must implement.
|
|
99
|
+
|
|
100
|
+
## Notifications
|
|
101
|
+
|
|
102
|
+
LajiForm expects a notification implementation as a paratemer `notifier`. The `notifier` object must implement the interface below:
|
|
103
|
+
|
|
104
|
+
```
|
|
105
|
+
{
|
|
106
|
+
success: message => (),
|
|
107
|
+
warning: message => (),
|
|
108
|
+
info: message => (),
|
|
109
|
+
error: message => (),
|
|
110
|
+
}
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
## Styles
|
|
114
|
+
|
|
115
|
+
Styles can be found at ```dist/styles.css```.
|
|
116
|
+
|
|
117
|
+
# Development
|
|
118
|
+
|
|
119
|
+
Run `npm ci` to install the dependencies and `npm start` to start the app.
|
|
120
|
+
|
|
121
|
+
Before running, you'll need to configure your personal apitest.laji.fi access token. Get the key to your email:
|
|
122
|
+
|
|
123
|
+
```
|
|
124
|
+
curl -X POST --header "Content-Type: application/json" --header "Accept: application/json" -d "{\
|
|
125
|
+
\"email\": \"<YOUR EMAIL ADDRESS>\"\
|
|
126
|
+
}" "http://apitest.laji.fi/v0/api-token"
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
Copy settings template file:
|
|
130
|
+
|
|
131
|
+
```
|
|
132
|
+
cp properties.json.example properties.json
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
Then put the API access token you got in your email to ```properties.json```. Put also your user access token & user ID there. Google API key is needed only for using the reverse geo location for foreign locations.
|
|
136
|
+
|
|
137
|
+
Try to keep the code style consistent - ```npm run lint``` should pass without errors.
|
|
138
|
+
|
|
139
|
+
## Developing different forms
|
|
140
|
+
|
|
141
|
+
Start the server and navigate to the local playground http://localhost:8083?id={form_id}
|
|
142
|
+
|
|
143
|
+
### Playground query parameters
|
|
144
|
+
|
|
145
|
+
Option | Default | Description
|
|
146
|
+
--------------|---------|-----------------------------------------------------------------------------------------------
|
|
147
|
+
id | - | Form id to use. If empty, `playground/schemas.json` will be used for form schemas.
|
|
148
|
+
local | `false` | Use local schemas under `forms/` instead of fetching from apitest.laji.fi.
|
|
149
|
+
localFormData | `false` | Use local formData under `forms/${id}.formData.json` instead of form's `prepopulatedDocument`.
|
|
150
|
+
settings | `true` | Use local settings defined in `playground/schemas`.
|
|
151
|
+
lang | `fi` | Language of the form. Doesn't affect local forms.
|
|
152
|
+
readonly | `false` | Sets the form readonly.
|
|
153
|
+
|
|
154
|
+
### Examples
|
|
155
|
+
|
|
156
|
+
http://localhost:8083?id=JX.519 Trip report form with empty `formData`.
|
|
157
|
+
|
|
158
|
+
http://localhost:8083?id=MHL.1&localFormData=true Line transect form with local `formData`.
|
|
159
|
+
|
|
160
|
+
## Tests
|
|
161
|
+
|
|
162
|
+
You need to update the webdriver before testing:
|
|
163
|
+
|
|
164
|
+
```
|
|
165
|
+
webdriver-manager update
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
The playground server must be running before running the tests.
|
|
169
|
+
|
|
170
|
+
Run the tests with `npm test`.
|
|
171
|
+
|
|
172
|
+
### Test parameters
|
|
173
|
+
|
|
174
|
+
Parameters are given as envirnment variables, i.e. `TEST_BROWSER=chrome npm test`
|
|
175
|
+
|
|
176
|
+
Option | Default | Description
|
|
177
|
+
---------------|---------|-----------------------------------------------------------------------------------------------
|
|
178
|
+
TEST_BROWSER | - | `chrome` or `firefox`. Tests are run for both by default.
|
|
179
|
+
HEADLESS | `true` | Run the tests in a visible browser window if `true`.
|
|
180
|
+
THREADS | 4 | How many browser instances to use for parallel testing.
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|