fui-material 2.7.9 → 2.7.10

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.
@@ -1,5 +1,5 @@
1
1
  import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
- import React, { forwardRef, useRef, useState, useEffect, useMemo, useCallback, useLayoutEffect, Fragment as Fragment$1, isValidElement, cloneElement, Children, useDeferredValue, createContext, useContext } from "react";
2
+ import React, { forwardRef, useRef, useState, useEffect, useMemo, useCallback, useLayoutEffect, Fragment as Fragment$1, isValidElement, cloneElement, createContext, useContext, useDeferredValue } from "react";
3
3
  import ReactDOM, { createPortal } from "react-dom";
4
4
  import JSZip from "jszip";
5
5
  import initializeModule from "allorion-exporting-html-to-docx";
@@ -3147,6 +3147,7 @@ const styles$8 = {
3147
3147
  badge,
3148
3148
  disabled
3149
3149
  };
3150
+ const MenuSearchContext = createContext("");
3150
3151
  const FMenuBlockLinks = ({
3151
3152
  children,
3152
3153
  className,
@@ -3160,14 +3161,6 @@ const FMenuBlockLinks = ({
3160
3161
  ...columns ? { "--cols": columns } : {},
3161
3162
  ...st
3162
3163
  };
3163
- const enhancedChildren = Children.map(children, (child) => {
3164
- if (isValidElement(child)) {
3165
- return cloneElement(child, {
3166
- searchTerm: searchValue
3167
- });
3168
- }
3169
- return child;
3170
- });
3171
3164
  return /* @__PURE__ */ jsxs("div", { className: `${styles$8.reportsPageContainer} ${className ?? ""}`.trim(), id, children: [
3172
3165
  withSearch && /* @__PURE__ */ jsx("div", { className: styles$8.searchBar, children: /* @__PURE__ */ jsx(
3173
3166
  "input",
@@ -3178,7 +3171,7 @@ const FMenuBlockLinks = ({
3178
3171
  onChange: (e) => setSearchValue(e.target.value)
3179
3172
  }
3180
3173
  ) }),
3181
- /* @__PURE__ */ jsx("div", { className: styles$8.reportsGrid, style: layoutStyle, children: enhancedChildren })
3174
+ /* @__PURE__ */ jsx(MenuSearchContext.Provider, { value: searchValue, children: /* @__PURE__ */ jsx("div", { className: styles$8.reportsGrid, style: layoutStyle, children }) })
3182
3175
  ] });
3183
3176
  };
3184
3177
  const getElementText = (node) => {
@@ -3194,9 +3187,9 @@ const FMenuLinks = ({
3194
3187
  id,
3195
3188
  disabled: disabled2 = [],
3196
3189
  badges = [],
3197
- title: title2,
3198
- searchTerm = ""
3190
+ title: title2
3199
3191
  }) => {
3192
+ const searchTerm = useContext(MenuSearchContext);
3200
3193
  const originalArray = React.Children.toArray(children);
3201
3194
  const filteredChildren = originalArray.filter((child) => {
3202
3195
  if (!searchTerm) return true;