@homebound/beam 2.374.0 → 2.376.0

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,6 +8,7 @@ const mobx_utils_1 = require("mobx-utils");
8
8
  const react_1 = require("react");
9
9
  const index_1 = require("../index");
10
10
  const TableState_1 = require("./utils/TableState");
11
+ const utils_1 = require("../../utils");
11
12
  /**
12
13
  * Creates an `api` handle to drive a `GridTable`.
13
14
  *
@@ -152,7 +153,7 @@ class GridTableApiImpl {
152
153
  if (!(0, index_1.isJSX)(content))
153
154
  return content;
154
155
  // Otherwise use the value/sortValue values
155
- return cell.value ? maybeApply(cell.value) : cell.sortValue ? maybeApply(cell.sortValue) : "-";
156
+ return (0, utils_1.isDefined)(cell.value) ? maybeApply(cell.value) : cell.sortValue ? maybeApply(cell.sortValue) : "-"; // Do we need the "-" handling unclear if we use it ever
156
157
  }
157
158
  else {
158
159
  // ReactNode
@@ -1,14 +1,10 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  exports.addNewOption = exports.unsetOption = void 0;
7
4
  exports.ComboBoxBase = ComboBoxBase;
8
5
  exports.initializeOptions = initializeOptions;
9
6
  exports.disabledOptionToKeyedTuple = disabledOptionToKeyedTuple;
10
7
  const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
11
- const fast_deep_equal_1 = __importDefault(require("fast-deep-equal"));
12
8
  const react_1 = require("react");
13
9
  const react_aria_1 = require("react-aria");
14
10
  const react_stately_1 = require("react-stately");
@@ -68,18 +64,7 @@ function ComboBoxBase(props) {
68
64
  : [propOptions.current, propOptions.options, unsetLabel, onAddNew]);
69
65
  const values = (0, react_1.useMemo)(() => propValues !== null && propValues !== void 0 ? propValues : [], [propValues]);
70
66
  const inputStylePalette = (0, react_1.useMemo)(() => propsInputStylePalette, [propsInputStylePalette]);
71
- const selectedOptionsRef = (0, react_1.useRef)(options.filter((o) => values.includes(getOptionValue(o))));
72
- const selectedOptions = (0, react_1.useMemo)(() => {
73
- // `selectedOptions` should only ever update if the `values` prop actually change.
74
- // Assuming `values` is a state variable, then it should hold its identity until it _really_ changes.
75
- // Though, it is possible that the `options` prop has changed, which is a dependency on this `useMemo`.
76
- // That could trigger an unnecessary new reference for `selectedOptions`, and cause additional renders or unexpected state changes.
77
- // We should avoid updating `selectedOptions` unless `values` has actually changed.
78
- if (!(0, fast_deep_equal_1.default)([...values].sort(), selectedOptionsRef.current.map(getOptionValue).sort())) {
79
- selectedOptionsRef.current = options.filter((o) => values.includes(getOptionValue(o)));
80
- }
81
- return selectedOptionsRef.current;
82
- }, [options, values, getOptionValue]);
67
+ const selectedOptions = (0, react_1.useMemo)(() => options.filter((o) => values.includes(getOptionValue(o))), [options, values, getOptionValue]);
83
68
  const { contains } = (0, react_aria_1.useFilter)({ sensitivity: "base" });
84
69
  const isDisabled = !!disabled;
85
70
  const isReadOnly = !!readOnly;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@homebound/beam",
3
- "version": "2.374.0",
3
+ "version": "2.376.0",
4
4
  "author": "Homebound",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",