@luomus/laji-form 15.1.77 → 15.1.79

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
@@ -4241,9 +4241,14 @@ body .laji-form {
4241
4241
  margin-left: -20px !important;
4242
4242
  }
4243
4243
 
4244
+ .laji-form .checkbox-container {
4245
+ display: table;
4246
+ outline: 1px solid #00000038;
4247
+ border-radius: 1px;
4248
+ }
4244
4249
  .laji-form .checkbox-container label {
4245
4250
  font-weight: initial;
4246
- margin-right: 5px;
4251
+ margin: 2px 7px;
4247
4252
  }
4248
4253
  .laji-form input[type="radio"] {
4249
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.77",
3
+ "version": "15.1.79",
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",