@homebound/beam 2.223.0 → 2.223.1

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.
@@ -8,7 +8,7 @@ const utils_1 = require("../utils");
8
8
  const defaultLabel_1 = require("../utils/defaultLabel");
9
9
  /** Wraps `Checkbox` and binds it to a form field. */
10
10
  function BoundCheckboxField(props) {
11
- const { field, onChange = (value) => field.set(value), label = (0, defaultLabel_1.defaultLabel)(field.key), onFocus, onBlur, ...others } = props;
11
+ const { field, onChange = (value) => field.set(value), label = (0, defaultLabel_1.defaultLabel)(field.key), onFocus, onBlur, disabled, ...others } = props;
12
12
  const testId = (0, utils_1.useTestIds)(props, field.key);
13
13
  return ((0, jsx_runtime_1.jsx)(mobx_react_1.Observer, { children: () => {
14
14
  var _a;
@@ -22,7 +22,7 @@ function BoundCheckboxField(props) {
22
22
  }, onBlur: () => {
23
23
  field.blur();
24
24
  (0, utils_1.maybeCall)(onBlur);
25
- } }, testId, others), void 0));
25
+ }, disabled: disabled || field.readOnly }, testId, others), void 0));
26
26
  } }, void 0));
27
27
  }
28
28
  exports.BoundCheckboxField = BoundCheckboxField;
@@ -8,7 +8,7 @@ const utils_1 = require("../utils");
8
8
  const defaultLabel_1 = require("../utils/defaultLabel");
9
9
  /** Wraps `TextField` and binds it to a form field. */
10
10
  function BoundDateRangeField(props) {
11
- const { field, onChange = (value) => field.set(value), label = (0, defaultLabel_1.defaultLabel)(field.key), onBlur, onFocus, onEnter, ...others } = props;
11
+ const { field, onChange = (value) => field.set(value), label = (0, defaultLabel_1.defaultLabel)(field.key), onBlur, onFocus, onEnter, readOnly, ...others } = props;
12
12
  const testId = (0, utils_1.useTestIds)(props, field.key);
13
13
  return ((0, jsx_runtime_1.jsx)(mobx_react_1.Observer, { children: () => ((0, jsx_runtime_1.jsx)(inputs_1.DateRangeField, Object.assign({ label: label, value: field.value || undefined, onChange: (value) => {
14
14
  onChange(value);
@@ -22,6 +22,6 @@ function BoundDateRangeField(props) {
22
22
  }, onEnter: () => {
23
23
  (0, utils_1.maybeCall)(onEnter);
24
24
  field.maybeAutoSave();
25
- } }, testId, others), void 0)) }, void 0));
25
+ }, readOnly: readOnly || field.readOnly }, testId, others), void 0)) }, void 0));
26
26
  }
27
27
  exports.BoundDateRangeField = BoundDateRangeField;
@@ -8,14 +8,14 @@ const utils_1 = require("../utils");
8
8
  const defaultLabel_1 = require("../utils/defaultLabel");
9
9
  /** Wraps `Switch` and binds it to a form field. */
10
10
  function BoundSwitchField(props) {
11
- const { field, onChange = (value) => field.set(value), label = (0, defaultLabel_1.defaultLabel)(field.key), labelStyle = "form", ...others } = props;
11
+ const { field, onChange = (value) => field.set(value), label = (0, defaultLabel_1.defaultLabel)(field.key), labelStyle = "form", disabled, ...others } = props;
12
12
  const testId = (0, utils_1.useTestIds)(props, field.key);
13
13
  return ((0, jsx_runtime_1.jsx)(mobx_react_1.Observer, { children: () => {
14
14
  var _a;
15
15
  return ((0, jsx_runtime_1.jsx)(inputs_1.Switch, Object.assign({ label: label, labelStyle: labelStyle, selected: (_a = field.value) !== null && _a !== void 0 ? _a : false, onChange: (selected) => {
16
16
  onChange(selected);
17
17
  field.maybeAutoSave();
18
- } }, testId, others), void 0));
18
+ }, disabled: disabled || field.readOnly }, testId, others), void 0));
19
19
  } }, void 0));
20
20
  }
21
21
  exports.BoundSwitchField = BoundSwitchField;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@homebound/beam",
3
- "version": "2.223.0",
3
+ "version": "2.223.1",
4
4
  "author": "Homebound",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",