@xsolla/xui-context-menu 0.237.0 → 0.239.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/README.md +2 -0
- package/native/index.js +33 -17
- package/native/index.js.map +1 -1
- package/native/index.mjs +33 -17
- package/native/index.mjs.map +1 -1
- package/package.json +10 -10
- package/web/index.js +33 -17
- package/web/index.js.map +1 -1
- package/web/index.mjs +33 -17
- package/web/index.mjs.map +1 -1
package/native/index.mjs
CHANGED
|
@@ -1807,20 +1807,33 @@ var ContextMenuRoot = forwardRef(
|
|
|
1807
1807
|
);
|
|
1808
1808
|
};
|
|
1809
1809
|
const renderedItems = searchable ? filterItems(items, debouncedQuery) : [...items];
|
|
1810
|
-
const
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1810
|
+
const stickyBleedHorizontal = withArrow ? 0 : panelPaddingHorizontal;
|
|
1811
|
+
const stickyBleedTop = withArrow ? 0 : panelPaddingVertical;
|
|
1812
|
+
const renderStickySearch = (node, key, isFirst = true) => {
|
|
1813
|
+
const bleedTop = isFirst ? stickyBleedTop : 0;
|
|
1814
|
+
return /* @__PURE__ */ jsx4(
|
|
1815
|
+
"div",
|
|
1816
|
+
{
|
|
1817
|
+
"data-sticky": "top",
|
|
1818
|
+
style: {
|
|
1819
|
+
position: "sticky",
|
|
1820
|
+
// Sticks to the scrollport edge, not the content edge; the
|
|
1821
|
+
// padding below keeps the panel's breathing room above the cell.
|
|
1822
|
+
top: 0,
|
|
1823
|
+
zIndex: 1,
|
|
1824
|
+
backgroundColor: surfaceColor,
|
|
1825
|
+
marginTop: -bleedTop,
|
|
1826
|
+
marginLeft: -stickyBleedHorizontal,
|
|
1827
|
+
marginRight: -stickyBleedHorizontal,
|
|
1828
|
+
paddingTop: bleedTop,
|
|
1829
|
+
paddingLeft: stickyBleedHorizontal,
|
|
1830
|
+
paddingRight: stickyBleedHorizontal
|
|
1831
|
+
},
|
|
1832
|
+
children: node
|
|
1819
1833
|
},
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
);
|
|
1834
|
+
key
|
|
1835
|
+
);
|
|
1836
|
+
};
|
|
1824
1837
|
const searchHeader = searchable ? renderStickySearch(
|
|
1825
1838
|
/* @__PURE__ */ jsx4(
|
|
1826
1839
|
ContextMenuItem,
|
|
@@ -1840,10 +1853,13 @@ var ContextMenuRoot = forwardRef(
|
|
|
1840
1853
|
if (!React3.Children.toArray(children).some(isSearchCellElement)) {
|
|
1841
1854
|
return children;
|
|
1842
1855
|
}
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1856
|
+
let renderedBefore = false;
|
|
1857
|
+
return React3.Children.map(children, (child, index) => {
|
|
1858
|
+
const isFirst = !renderedBefore;
|
|
1859
|
+
if (child !== null && child !== void 0 && typeof child !== "boolean")
|
|
1860
|
+
renderedBefore = true;
|
|
1861
|
+
return isSearchCellElement(child) ? renderStickySearch(child, `context-menu-search-${index}`, isFirst) : child;
|
|
1862
|
+
});
|
|
1847
1863
|
};
|
|
1848
1864
|
const renderContent = () => {
|
|
1849
1865
|
if (loading || isLoading || type === "loading") {
|