@homebound/beam 2.324.0 → 2.324.2

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.
@@ -11,8 +11,6 @@ function SelectToggle({ id, disabled }) {
11
11
  const { tableState } = (0, react_1.useContext)(TableState_1.TableStateContext);
12
12
  const state = (0, hooks_1.useComputed)(() => tableState.getSelected(id), [tableState]);
13
13
  const selected = state === "checked" ? true : state === "unchecked" ? false : "indeterminate";
14
- return ((0, jsx_runtime_1.jsx)(inputs_1.Checkbox, { checkboxOnly: true, disabled: disabled, label: "Select", onChange: (selected) => {
15
- tableState.selectRow(id, selected);
16
- }, selected: selected }));
14
+ return ((0, jsx_runtime_1.jsx)(inputs_1.Checkbox, { checkboxOnly: true, disabled: disabled, label: "Select", onChange: (selected) => tableState.selectRow(id, selected), selected: selected }));
17
15
  }
18
16
  exports.SelectToggle = SelectToggle;
@@ -107,7 +107,7 @@ class RowState {
107
107
  // client-side filter changes, a child reappears, and we need to transition to partial-ness.
108
108
  if (this.isParent) {
109
109
  // Use visibleChildren b/c if filters are hiding some of our children, we still want to show fully selected
110
- const children = this.visibleChildren;
110
+ const children = this.visibleChildren.filter((c) => c.row.selectable !== false);
111
111
  const allChecked = children.every((child) => child.selectedState === "checked");
112
112
  const allUnchecked = children.every((child) => child.selectedState === "unchecked");
113
113
  return children.length === 0 ? "unchecked" : allChecked ? "checked" : allUnchecked ? "unchecked" : "partial";
@@ -122,7 +122,7 @@ class RowState {
122
122
  */
123
123
  get selectedStateForHeader() {
124
124
  if (this.children) {
125
- const children = this.visibleChildren;
125
+ const children = this.visibleChildren.filter((c) => c.row.selectable !== false || c.isParent);
126
126
  const allChecked = children.every((child) => child.selectedStateForHeader === "checked");
127
127
  const allUnchecked = children.every((child) => child.selectedStateForHeader === "unchecked");
128
128
  // For the header purposes, if this is a selectable-row (i.e. not inferSelectedState) make sure
@@ -264,7 +264,8 @@ class RowState {
264
264
  * they want the row to be selectable.
265
265
  */
266
266
  get isParent() {
267
- return !!this.children && this.children.length > 0 && this.inferSelectedState;
267
+ // Check for KEPT_GROUP b/c it has `this.children = []` but we synthesize its children in `visibleChildren`
268
+ return !!this.children && (this.children.length > 0 || this.row.id === utils_1.KEPT_GROUP) && this.inferSelectedState;
268
269
  }
269
270
  get isPinned() {
270
271
  return typeof this.row.pin === "string" || (!!this.row.pin && this.row.pin.filter !== true);
@@ -22,7 +22,7 @@ function CheckboxBase(props) {
22
22
  .maxw((0, Css_1.px)(320))
23
23
  .if(description !== undefined)
24
24
  .maxw((0, Css_1.px)(344))
25
- .if(isDisabled).cursorNotAllowed.$, "aria-label": label, children: [(0, jsx_runtime_1.jsx)(react_aria_1.VisuallyHidden, { children: (0, jsx_runtime_1.jsx)("input", { ref: ref, ...(0, react_aria_1.mergeProps)(inputProps, focusProps), ...tid, "data-indeterminate": isIndeterminate }) }), (0, jsx_runtime_1.jsx)(StyledCheckbox, { ...props, isFocusVisible: isFocusVisible }), !checkboxOnly && (
25
+ .if(isDisabled).cursorNotAllowed.$, "aria-label": label, children: [(0, jsx_runtime_1.jsx)(react_aria_1.VisuallyHidden, { children: (0, jsx_runtime_1.jsx)("input", { ref: ref, ...(0, react_aria_1.mergeProps)(inputProps, focusProps), ...tid, "data-indeterminate": isIndeterminate }) }), (0, jsx_runtime_1.jsx)(StyledCheckbox, { ...props, isFocusVisible: isFocusVisible, ...tid }), !checkboxOnly && (
26
26
  // Use a mtPx(-2) to better align the label with the checkbox.
27
27
  // Not using align-items: center as the checkbox would align with all content below, where we really want it to stay only aligned with the label
28
28
  (0, jsx_runtime_1.jsxs)("div", { css: Css_1.Css.ml1.mtPx(-2).$, children: [label && (0, jsx_runtime_1.jsx)("div", { css: { ...labelStyles, ...(isDisabled && disabledColor) }, children: label }), description && (0, jsx_runtime_1.jsx)("div", { css: { ...descStyles, ...(isDisabled && disabledColor) }, children: description }), errorMsg && (0, jsx_runtime_1.jsx)(ErrorMessage_1.ErrorMessage, { errorMsg: errorMsg, ...tid.errorMsg }), helperText && (0, jsx_runtime_1.jsx)(HelperText_1.HelperText, { helperText: helperText, ...tid.helperText })] }))] }));
package/dist/utils/rtl.js CHANGED
@@ -188,6 +188,9 @@ function selectOption(select, optionValue) {
188
188
  if (!optionToSelect) {
189
189
  throw new Error(`Could not find option with value or text content of ${optionValue}`);
190
190
  }
191
+ if (optionToSelect.getAttribute("aria-disabled")) {
192
+ throw new Error(`Cannot select disabled option ${optionValue}`);
193
+ }
191
194
  (0, rtl_utils_1.click)(optionToSelect);
192
195
  }
193
196
  function getSelected(select) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@homebound/beam",
3
- "version": "2.324.0",
3
+ "version": "2.324.2",
4
4
  "author": "Homebound",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -118,8 +118,8 @@
118
118
  "jest-watch-typeahead": "^2.2.2",
119
119
  "mobx": "^6.10.2",
120
120
  "mobx-react": "^9.0.1",
121
- "prettier": "^2.8.4",
122
- "prettier-plugin-organize-imports": "^3.2.2",
121
+ "prettier": "^3.0.3",
122
+ "prettier-plugin-organize-imports": "^3.2.3",
123
123
  "react": "^18.2.0",
124
124
  "react-dom": "^18.2.0",
125
125
  "semantic-release": "^20.1.0",