@luomus/laji-form 15.1.21 → 15.1.23

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.
@@ -2,7 +2,7 @@ export default class AutoArrayField extends React.Component<any, any, any> {
2
2
  static propTypes: {
3
3
  uiSchema: PropTypes.Requireable<PropTypes.InferProps<{
4
4
  "ui:options": PropTypes.Requireable<PropTypes.InferProps<{
5
- autofocus: any;
5
+ autofocus: PropTypes.Requireable<boolean>;
6
6
  }>>;
7
7
  }>>;
8
8
  schema: PropTypes.Validator<PropTypes.InferProps<{
@@ -42,7 +42,7 @@ let AutoArrayField = class AutoArrayField extends React.Component {
42
42
  AutoArrayField.propTypes = {
43
43
  uiSchema: PropTypes.shape({
44
44
  "ui:options": PropTypes.shape({
45
- autofocus: PropTypes.boolean
45
+ autofocus: PropTypes.bool
46
46
  })
47
47
  }),
48
48
  schema: PropTypes.shape({
@@ -20,7 +20,7 @@ export default class AutosuggestField extends React.Component<any, any, any> {
20
20
  "ui:options": PropTypes.Validator<PropTypes.InferProps<{
21
21
  autosuggestField: PropTypes.Validator<string>;
22
22
  suggestionInputField: PropTypes.Validator<string>;
23
- allowNonsuggestedValue: any;
23
+ allowNonsuggestedValue: PropTypes.Requireable<boolean>;
24
24
  suggestionReceivers: PropTypes.Validator<object>;
25
25
  inputTransformer: PropTypes.Requireable<PropTypes.InferProps<{
26
26
  regexp: PropTypes.Validator<string>;
@@ -281,7 +281,7 @@ AutosuggestField.propTypes = {
281
281
  "ui:options": PropTypes.shape({
282
282
  autosuggestField: PropTypes.string.isRequired,
283
283
  suggestionInputField: PropTypes.string.isRequired,
284
- allowNonsuggestedValue: PropTypes.boolean,
284
+ allowNonsuggestedValue: PropTypes.bool,
285
285
  suggestionReceivers: PropTypes.object.isRequired,
286
286
  inputTransformer: PropTypes.shape({
287
287
  regexp: PropTypes.string.isRequired,
@@ -103,7 +103,7 @@ export default class ConditionalUiSchemaField extends React.Component<any, any,
103
103
  uiSchema: PropTypes.Validator<object>;
104
104
  }> | null | undefined)[]>;
105
105
  }> | null | undefined)[]>;
106
- cache: any;
106
+ cache: PropTypes.Requireable<boolean>;
107
107
  }>>;
108
108
  }>>;
109
109
  schema: PropTypes.Validator<PropTypes.InferProps<{
@@ -106,7 +106,7 @@ ConditionalUiSchemaField.propTypes = {
106
106
  casePropType,
107
107
  PropTypes.arrayOf(casePropType)
108
108
  ]),
109
- cache: PropTypes.boolean
109
+ cache: PropTypes.bool
110
110
  })
111
111
  }),
112
112
  schema: PropTypes.shape({
@@ -8,7 +8,7 @@ export default class ExtraLabelRowField extends React.Component<any, any, any> {
8
8
  md: PropTypes.Requireable<number | object>;
9
9
  sm: PropTypes.Requireable<number | object>;
10
10
  xs: PropTypes.Requireable<number | object>;
11
- hiddenXs: any;
11
+ hiddenXs: PropTypes.Requireable<boolean>;
12
12
  }>>;
13
13
  }>>;
14
14
  schema: PropTypes.Validator<PropTypes.InferProps<{
@@ -86,7 +86,7 @@ ExtraLabelRowField.propTypes = {
86
86
  md: PropTypes.oneOfType([PropTypes.number, PropTypes.object]),
87
87
  sm: PropTypes.oneOfType([PropTypes.number, PropTypes.object]),
88
88
  xs: PropTypes.oneOfType([PropTypes.number, PropTypes.object]),
89
- hiddenXs: PropTypes.boolean
89
+ hiddenXs: PropTypes.bool
90
90
  })
91
91
  }).isRequired,
92
92
  schema: PropTypes.shape({
@@ -48,7 +48,7 @@ export default class FilterArrayField extends React.Component<any, any, any> {
48
48
  isLast: PropTypes.Requireable<number>;
49
49
  complement: PropTypes.Requireable<boolean>;
50
50
  }> | null | undefined)[]>;
51
- cache: any;
51
+ cache: PropTypes.Requireable<boolean>;
52
52
  }>>;
53
53
  }>>;
54
54
  schema: PropTypes.Validator<PropTypes.InferProps<{
@@ -107,7 +107,7 @@ FilterArrayField.propTypes = {
107
107
  uiSchema: PropTypes.shape({
108
108
  "ui:options": PropTypes.shape({
109
109
  rules: exports.arrayRulesPropType,
110
- cache: PropTypes.boolean
110
+ cache: PropTypes.bool
111
111
  })
112
112
  }),
113
113
  schema: PropTypes.shape({
@@ -10,6 +10,7 @@ const React = require("react");
10
10
  const PropTypes = require("prop-types");
11
11
  const VirtualSchemaField_1 = require("../VirtualSchemaField");
12
12
  const utils_1 = require("../../utils");
13
+ const merge = require("deepmerge");
13
14
  let InputWithDefaultValueButtonField = class InputWithDefaultValueButtonField extends React.Component {
14
15
  constructor() {
15
16
  super(...arguments);
@@ -28,14 +29,15 @@ let InputWithDefaultValueButtonField = class InputWithDefaultValueButtonField ex
28
29
  let { schema, uiSchema } = props;
29
30
  const { buttonField, buttonLabel } = utils_1.getUiOptions(uiSchema);
30
31
  const innerUiSchema = utils_1.getInnerUiSchema(uiSchema);
31
- const _uiSchemaJSONPointer = utils_1.uiSchemaJSONPointer(schema, buttonField);
32
- uiSchema = utils_1.updateSafelyWithJSONPointer(innerUiSchema, {
32
+ const buttonFieldJSONPointer = utils_1.uiSchemaJSONPointer(schema, buttonField);
33
+ const buttonFieldUiSchema = merge(utils_1.parseJSONPointer(innerUiSchema, buttonFieldJSONPointer) || {}, {
33
34
  "ui:widget": "InputWithDefaultValueButtonWidget",
34
35
  "ui:options": {
35
36
  buttonLabel,
36
37
  onClick: this.onClick
37
- },
38
- }, _uiSchemaJSONPointer);
38
+ }
39
+ });
40
+ uiSchema = utils_1.updateSafelyWithJSONPointer(innerUiSchema, buttonFieldUiSchema, buttonFieldJSONPointer);
39
41
  return Object.assign(Object.assign({}, props), { uiSchema });
40
42
  }
41
43
  };
@@ -246,7 +246,7 @@ class LocationButton extends React.Component {
246
246
  if (!geometryRef || !geometryRef.type) {
247
247
  break;
248
248
  }
249
- that.props.onChange(utils_1.updateFormDataWithJSONPointer(that.props, utils_1.getDefaultFormState(utils_1.parseSchemaFromFormDataPointer(that.props.schema, geometryField)), geometryField));
249
+ that.props.onChange(utils_1.updateFormDataWithJSONPointer(that.props, undefined, geometryField));
250
250
  break;
251
251
  }
252
252
  case "edit": {
@@ -13,7 +13,7 @@ export default class MapField extends React.Component<any, any, any> {
13
13
  mapOptions: PropTypes.Requireable<object>;
14
14
  height: PropTypes.Requireable<number>;
15
15
  emptyHelp: PropTypes.Requireable<string>;
16
- geometryCollection: any;
16
+ geometryCollection: PropTypes.Requireable<boolean>;
17
17
  }>>;
18
18
  }>>;
19
19
  schema: PropTypes.Validator<PropTypes.InferProps<{
@@ -300,7 +300,7 @@ MapField.propTypes = {
300
300
  mapOptions: PropTypes.object,
301
301
  height: PropTypes.number,
302
302
  emptyHelp: PropTypes.string,
303
- geometryCollection: PropTypes.boolean,
303
+ geometryCollection: PropTypes.bool,
304
304
  })
305
305
  }),
306
306
  schema: PropTypes.shape({
@@ -32,7 +32,7 @@ export default class MultiArrayField extends React.Component<any, any, any> {
32
32
  type: PropTypes.Requireable<string>;
33
33
  uiSchema: PropTypes.Validator<object>;
34
34
  }> | null | undefined)[]>;
35
- cache: any;
35
+ cache: PropTypes.Requireable<boolean>;
36
36
  }>>;
37
37
  }>>;
38
38
  schema: PropTypes.Validator<PropTypes.InferProps<{
@@ -187,7 +187,7 @@ MultiArrayField.propTypes = {
187
187
  ConditionalUiSchemaField_1.operationPropType,
188
188
  PropTypes.arrayOf(ConditionalUiSchemaField_1.operationPropType)
189
189
  ]),
190
- cache: PropTypes.boolean
190
+ cache: PropTypes.bool
191
191
  })
192
192
  }),
193
193
  schema: PropTypes.shape({
@@ -35,7 +35,7 @@ export default class ScopeField extends React.Component<any, any, any> {
35
35
  static propTypes: {
36
36
  uiSchema: PropTypes.Validator<PropTypes.InferProps<{
37
37
  "ui:options": PropTypes.Validator<PropTypes.InferProps<{
38
- includeAdditionalFieldsChooserButton: any;
38
+ includeAdditionalFieldsChooserButton: PropTypes.Requireable<boolean>;
39
39
  additionalsGroupingPath: PropTypes.Requireable<string>;
40
40
  additionalsGroupsTranslator: PropTypes.Requireable<string>;
41
41
  additionalsPersistenceKey: PropTypes.Requireable<string>;
@@ -453,7 +453,7 @@ ScopeField.contextType = ReactContext_1.default;
453
453
  ScopeField.propTypes = {
454
454
  uiSchema: PropTypes.shape({
455
455
  "ui:options": PropTypes.shape({
456
- includeAdditionalFieldsChooserButton: PropTypes.boolean,
456
+ includeAdditionalFieldsChooserButton: PropTypes.bool,
457
457
  additionalsGroupingPath: PropTypes.string,
458
458
  additionalsGroupsTranslator: PropTypes.oneOf(Object.keys(scopeFieldSettings)),
459
459
  additionalsPersistenceKey: PropTypes.string,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luomus/laji-form",
3
- "version": "15.1.21",
3
+ "version": "15.1.23",
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",