@homebound/beam 3.15.0 → 3.15.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.
package/dist/index.d.cts CHANGED
@@ -6794,6 +6794,8 @@ type RadioGroupFieldProps<K extends string> = {
6794
6794
  /** The list of options. */
6795
6795
  options: RadioFieldOption<K>[];
6796
6796
  disabled?: boolean;
6797
+ /** Whether the field is required. When true, renders the required suffix (i.e. "*") next to the label. */
6798
+ required?: boolean;
6797
6799
  errorMsg?: string;
6798
6800
  helperText?: string | ReactNode;
6799
6801
  onBlur?: () => void;
package/dist/index.d.ts CHANGED
@@ -6794,6 +6794,8 @@ type RadioGroupFieldProps<K extends string> = {
6794
6794
  /** The list of options. */
6795
6795
  options: RadioFieldOption<K>[];
6796
6796
  disabled?: boolean;
6797
+ /** Whether the field is required. When true, renders the required suffix (i.e. "*") next to the label. */
6798
+ required?: boolean;
6797
6799
  errorMsg?: string;
6798
6800
  helperText?: string | ReactNode;
6799
6801
  onBlur?: () => void;
package/dist/index.js CHANGED
@@ -13085,6 +13085,7 @@ function RadioGroupField(props) {
13085
13085
  onChange,
13086
13086
  options,
13087
13087
  disabled = false,
13088
+ required,
13088
13089
  errorMsg,
13089
13090
  helperText,
13090
13091
  layout = "vertical",
@@ -13099,12 +13100,14 @@ function RadioGroupField(props) {
13099
13100
  isReadOnly: false
13100
13101
  });
13101
13102
  const tid = useTestIds(props, defaultTestId(label));
13103
+ const labelSuffix = useLabelSuffix(required, false);
13102
13104
  const {
13103
13105
  labelProps,
13104
13106
  radioGroupProps
13105
13107
  } = useRadioGroup({
13106
13108
  label,
13107
- isDisabled: disabled
13109
+ isDisabled: disabled,
13110
+ isRequired: required
13108
13111
  }, state);
13109
13112
  return (
13110
13113
  // default styling to position `<Label />` above.
@@ -13119,7 +13122,7 @@ function RadioGroupField(props) {
13119
13122
  justifyContent: "jcsb"
13120
13123
  } : {}
13121
13124
  }), children: [
13122
- /* @__PURE__ */ jsx70(Label, { label, ...labelProps, ...tid.label, hidden: labelStyle === "hidden" }),
13125
+ /* @__PURE__ */ jsx70(Label, { label, ...labelProps, ...tid.label, suffix: labelSuffix, hidden: labelStyle === "hidden" }),
13123
13126
  /* @__PURE__ */ jsxs43("div", { ...radioGroupProps, children: [
13124
13127
  /* @__PURE__ */ jsx70("div", { ...trussProps44({
13125
13128
  display: "df",
@@ -14445,17 +14448,26 @@ var ColumnStorage = class {
14445
14448
  }
14446
14449
  expandedIds;
14447
14450
  visibleIds;
14451
+ // `loadExpanded`/`loadVisible` can be called multiple times (i.e. when `props.columns`
14452
+ // change, which also changes the auto-derived storage key). Each call wires up a mobx
14453
+ // autorun/reaction that writes to its key, so we must dispose the previous one. Otherwise
14454
+ // a stale writer keeps firing against an old key and clobbers it with the current visible
14455
+ // set, e.g. a conditional column's key gets overwritten while that column isn't rendered.
14456
+ disposeExpanded;
14457
+ disposeVisible;
14448
14458
  loadExpanded(persistCollapse) {
14459
+ this.disposeExpanded?.();
14449
14460
  const key = `expandedColumn_${persistCollapse}`;
14450
14461
  this.expandedIds = loadArrayOrUndefined(key);
14451
- reaction2(
14462
+ this.disposeExpanded = reaction2(
14452
14463
  () => this.states.expandedColumns.map((cs) => cs.column.id),
14453
14464
  (columnIds) => sessionStorage.setItem(key, JSON.stringify(columnIds))
14454
14465
  );
14455
14466
  }
14456
14467
  loadVisible(storageKey) {
14468
+ this.disposeVisible?.();
14457
14469
  this.visibleIds = loadArrayOrUndefined(storageKey);
14458
- autorun2(() => {
14470
+ this.disposeVisible = autorun2(() => {
14459
14471
  const columnIds = this.states.allVisibleColumns("web").map((cs) => cs.column.id);
14460
14472
  sessionStorage.setItem(storageKey, JSON.stringify(columnIds));
14461
14473
  });
@@ -17386,6 +17398,7 @@ function BoundRadioGroupField(props) {
17386
17398
  RadioGroupField,
17387
17399
  {
17388
17400
  label,
17401
+ required: field.required,
17389
17402
  value: field.value || void 0,
17390
17403
  onChange: (value) => {
17391
17404
  onChange(value);