@luomus/laji-form 15.1.21 → 15.1.22

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.
@@ -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
  };
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.22",
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",