@luomus/laji-form 15.1.76 → 15.1.78

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/styles.css CHANGED
@@ -2029,21 +2029,7 @@ li.laji-map-layer-control-layer-item.active span {
2029
2029
  }
2030
2030
 
2031
2031
 
2032
- /* .panel-default { */
2033
- /* border-color: #ddd; */
2034
- /* } */
2035
- /* .panel-body { */
2036
- /* padding: 15px; */
2037
- /* } */
2038
- /* .panel { */
2039
- /* margin-bottom: 20px; */
2040
- /* background-color: #fff; */
2041
- /* border: 1px solid transparent; */
2042
- /* border-radius: 4px; */
2043
- /* -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, .05); */
2044
- /* box-shadow: 0 1px 1px rgba(0, 0, 0, .05); */
2045
- /* } */
2046
- .panel {
2032
+ .laji-map-dialog.panel {
2047
2033
  background: white;
2048
2034
  padding: 15px;
2049
2035
  font-size: 16px;
@@ -2051,7 +2037,7 @@ li.laji-map-layer-control-layer-item.active span {
2051
2037
  border-radius: 2px;
2052
2038
  }
2053
2039
 
2054
- button.close {
2040
+ .laji-map-dialog button.close {
2055
2041
  padding: 0;
2056
2042
  cursor: pointer;
2057
2043
  background: transparent;
@@ -2059,7 +2045,6 @@ button.close {
2059
2045
  -webkit-appearance: none;
2060
2046
  appearance: none;
2061
2047
  float: right;
2062
- font-size: 21px;
2063
2048
  font-weight: bold;
2064
2049
  line-height: 1;
2065
2050
  color: #000;
@@ -2068,7 +2053,7 @@ button.close {
2068
2053
  opacity: .2;
2069
2054
  }
2070
2055
 
2071
- .help-block {
2056
+ .laji-map-dialog .help-block {
2072
2057
  display: block;
2073
2058
  margin-top: 5px;
2074
2059
  margin-bottom: 10px;
@@ -4256,9 +4241,14 @@ body .laji-form {
4256
4241
  margin-left: -20px !important;
4257
4242
  }
4258
4243
 
4244
+ .laji-form .checkbox-container {
4245
+ display: table;
4246
+ border: 1px solid #00000038;
4247
+ border-radius: 2px;
4248
+ }
4259
4249
  .laji-form .checkbox-container label {
4260
4250
  font-weight: initial;
4261
- margin-right: 5px;
4251
+ margin: 2px 7px;
4262
4252
  }
4263
4253
  .laji-form input[type="radio"] {
4264
4254
  margin-right: 5px;
@@ -166,7 +166,7 @@ class MapField extends React.Component {
166
166
  if ((formData === null || formData === void 0 ? void 0 : formData[coordinateFields.longitude]) !== undefined && (formData === null || formData === void 0 ? void 0 : formData[coordinateFields.latitude]) !== undefined) {
167
167
  return {
168
168
  type: "Point",
169
- coordinates: [formData[coordinateFields.longitude], formData[coordinateFields.latitude]]
169
+ coordinates: [+formData[coordinateFields.longitude], +formData[coordinateFields.latitude]]
170
170
  };
171
171
  }
172
172
  else {
@@ -190,10 +190,23 @@ class MapField extends React.Component {
190
190
  const { geometryCollection = true, coordinateFields } = (0, utils_1.getUiOptions)(this.props.uiSchema);
191
191
  let formData;
192
192
  if (coordinateFields) {
193
- formData = geometry ? {
194
- [coordinateFields.longitude]: geometry.coordinates[0],
195
- [coordinateFields.latitude]: geometry.coordinates[1]
196
- } : undefined;
193
+ if (geometry) {
194
+ let longitude = geometry.coordinates[0];
195
+ let latitude = geometry.coordinates[1];
196
+ if (this.props.schema.properties[coordinateFields.longitude].type === "string") {
197
+ longitude = "" + longitude;
198
+ }
199
+ if (this.props.schema.properties[coordinateFields.latitude].type === "string") {
200
+ latitude = "" + latitude;
201
+ }
202
+ formData = {
203
+ [coordinateFields.longitude]: longitude,
204
+ [coordinateFields.latitude]: latitude
205
+ };
206
+ }
207
+ else {
208
+ formData = undefined;
209
+ }
197
210
  }
198
211
  else {
199
212
  formData = geometryCollection ? {
@@ -224,7 +224,7 @@ function TaxonAutosuggest(ComposedComponent) {
224
224
  getSuggestionFromValue(value) {
225
225
  return __awaiter(this, void 0, void 0, function* () {
226
226
  if (this.isValueSuggested(value)) {
227
- const { vernacularName, scientificName } = yield this.props.formContext.apiClient.get(`/taxa/${id}`);
227
+ const { vernacularName, scientificName } = yield this.props.formContext.apiClient.get(`/taxa/${value}`);
228
228
  if (vernacularName !== undefined) {
229
229
  return { value: vernacularName, key: value };
230
230
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luomus/laji-form",
3
- "version": "15.1.76",
3
+ "version": "15.1.78",
4
4
  "description": "React module capable of building dynamic forms from Laji form json schemas",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -40,7 +40,7 @@
40
40
  "repository": "git+https://github.com/luomus/laji-form.git",
41
41
  "license": "MIT",
42
42
  "dependencies": {
43
- "@luomus/laji-map": "^5.1.18",
43
+ "@luomus/laji-map": "^5.1.19",
44
44
  "@luomus/laji-validate": "^0.0.123",
45
45
  "@rjsf/core": "~5.1.0",
46
46
  "@rjsf/utils": "~5.1.0",