@homebound/beam 3.32.0 → 3.33.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.
package/dist/index.cjs CHANGED
@@ -12102,7 +12102,8 @@ function TreeOption(props) {
12102
12102
  const {
12103
12103
  item,
12104
12104
  state,
12105
- allowCollapsing = true
12105
+ allowCollapsing = true,
12106
+ disabledReason
12106
12107
  } = props;
12107
12108
  const leveledOption = item.value;
12108
12109
  if (!leveledOption) return null;
@@ -12159,43 +12160,47 @@ function TreeOption(props) {
12159
12160
  }]
12160
12161
  }
12161
12162
  };
12162
- return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("li", { ...hoverProps, onClick: (e) => {
12163
- if (!isGroup) return;
12164
- e.preventDefault();
12165
- e.stopPropagation();
12166
- toggleCollapsed();
12167
- }, ...(0, import_runtime37.trussProps)({
12168
- ...{
12169
- display: "df",
12170
- alignItems: "aic",
12171
- justifyContent: "jcsb",
12172
- gap: "gap1",
12173
- paddingLeft: ["pl_var", {
12174
- "--paddingLeft": `${16 + level * 8}px`
12175
- }],
12176
- minHeight: "mh_42px",
12177
- outline: "outline0",
12178
- cursor: "cursorPointer",
12179
- fontWeight: "fw4",
12180
- fontSize: "fz_14px",
12181
- lineHeight: "lh_20px"
12182
- },
12183
- ...listItemStyles.item,
12184
- ...isHovered && (!isDisabled || isGroup) ? listItemStyles.hover : {},
12185
- ...isFocused && !isGroup ? listItemStyles.focus : {},
12186
- ...isDisabled && !isGroup ? listItemStyles.disabled : {}
12187
- }), children: [
12188
- allowCollapsing && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "w_18px fs0 df aic", children: canCollapse && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("button", { onClick: (e) => {
12163
+ return maybeTooltip({
12164
+ title: !isGroup ? disabledReason : void 0,
12165
+ placement: "right",
12166
+ children: /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("li", { ...hoverProps, onClick: (e) => {
12167
+ if (!isGroup) return;
12189
12168
  e.preventDefault();
12190
12169
  e.stopPropagation();
12191
12170
  toggleCollapsed();
12192
- return false;
12193
- }, className: "br4 h_16px w_16px bgTransparent h_bgGray300", ...tid[`collapseToggle_${item.key}`], children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Icon, { icon: collapsedKeys.includes(item.key) ? "triangleRight" : "triangleDown", inc: 2 }) }) }),
12194
- /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("span", { className: "df aic gap1 h100 fg1 pt1 pb1 pr2", ref, ...optionProps, "data-label": item.textValue, children: [
12195
- !isGroup && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(StyledCheckbox, { isDisabled, isSelected, isIndeterminate, ...tid[item.key.toString()] }),
12196
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "pl1", children: item.rendered })
12171
+ }, ...(0, import_runtime37.trussProps)({
12172
+ ...{
12173
+ display: "df",
12174
+ alignItems: "aic",
12175
+ justifyContent: "jcsb",
12176
+ gap: "gap1",
12177
+ paddingLeft: ["pl_var", {
12178
+ "--paddingLeft": `${16 + level * 8}px`
12179
+ }],
12180
+ minHeight: "mh_42px",
12181
+ outline: "outline0",
12182
+ cursor: "cursorPointer",
12183
+ fontWeight: "fw4",
12184
+ fontSize: "fz_14px",
12185
+ lineHeight: "lh_20px"
12186
+ },
12187
+ ...listItemStyles.item,
12188
+ ...isHovered && (!isDisabled || isGroup) ? listItemStyles.hover : {},
12189
+ ...isFocused && !isGroup ? listItemStyles.focus : {},
12190
+ ...isDisabled && !isGroup ? listItemStyles.disabled : {}
12191
+ }), children: [
12192
+ allowCollapsing && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "w_18px fs0 df aic", children: canCollapse && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("button", { onClick: (e) => {
12193
+ e.preventDefault();
12194
+ e.stopPropagation();
12195
+ toggleCollapsed();
12196
+ return false;
12197
+ }, className: "br4 h_16px w_16px bgTransparent h_bgGray300", ...tid[`collapseToggle_${item.key}`], children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Icon, { icon: collapsedKeys.includes(item.key) ? "triangleRight" : "triangleDown", inc: 2 }) }) }),
12198
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("span", { className: "df aic gap1 h100 fg1 pt1 pb1 pr2", ref, ...optionProps, "data-label": item.textValue, children: [
12199
+ !isGroup && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(StyledCheckbox, { isDisabled, isSelected, isIndeterminate, ...tid[item.key.toString()] }),
12200
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "pl1", children: item.rendered })
12201
+ ] })
12197
12202
  ] })
12198
- ] });
12203
+ });
12199
12204
  }
12200
12205
  function hasSelectedChildren(childOption, state, getOptionValue) {
12201
12206
  if (childOption.children && childOption.children.length > 0) {
@@ -12293,7 +12298,8 @@ function VirtualizedOptions(props) {
12293
12298
  {
12294
12299
  item,
12295
12300
  state,
12296
- allowCollapsing
12301
+ allowCollapsing,
12302
+ disabledReason: disabledOptionsWithReasons[item.key]
12297
12303
  },
12298
12304
  item.key
12299
12305
  );
@@ -12874,7 +12880,7 @@ function TreeSelectFieldBase(props) {
12874
12880
  onClose: () => state.toggle(),
12875
12881
  isOpen: state.isOpen,
12876
12882
  minWidth: 320,
12877
- children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(ListBox, { ...listBoxProps, positionProps, state, listBoxRef, selectedOptions: fieldState.selectedChipOptions, getOptionLabel, getOptionValue: (o) => valueToKey(getOptionValue(o)), horizontalLayout: labelStyle === "left", loading: fieldState.optionsLoading, allowCollapsing: fieldState.allowCollapsing, isTree: true })
12883
+ children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(ListBox, { ...listBoxProps, positionProps, state, listBoxRef, selectedOptions: fieldState.selectedChipOptions, getOptionLabel, getOptionValue: (o) => valueToKey(getOptionValue(o)), horizontalLayout: labelStyle === "left", loading: fieldState.optionsLoading, allowCollapsing: fieldState.allowCollapsing, disabledOptionsWithReasons, isTree: true })
12878
12884
  }
12879
12885
  )
12880
12886
  ] });