@xsolla/xui-context-menu 0.238.0 → 0.240.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/web/index.mjs
CHANGED
|
@@ -1833,20 +1833,33 @@ var ContextMenuRoot = forwardRef(
|
|
|
1833
1833
|
);
|
|
1834
1834
|
};
|
|
1835
1835
|
const renderedItems = searchable ? filterItems(items, debouncedQuery) : [...items];
|
|
1836
|
-
const
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1836
|
+
const stickyBleedHorizontal = withArrow ? 0 : panelPaddingHorizontal;
|
|
1837
|
+
const stickyBleedTop = withArrow ? 0 : panelPaddingVertical;
|
|
1838
|
+
const renderStickySearch = (node, key, isFirst = true) => {
|
|
1839
|
+
const bleedTop = isFirst ? stickyBleedTop : 0;
|
|
1840
|
+
return /* @__PURE__ */ jsx4(
|
|
1841
|
+
"div",
|
|
1842
|
+
{
|
|
1843
|
+
"data-sticky": "top",
|
|
1844
|
+
style: {
|
|
1845
|
+
position: "sticky",
|
|
1846
|
+
// Sticks to the scrollport edge, not the content edge; the
|
|
1847
|
+
// padding below keeps the panel's breathing room above the cell.
|
|
1848
|
+
top: 0,
|
|
1849
|
+
zIndex: 1,
|
|
1850
|
+
backgroundColor: surfaceColor,
|
|
1851
|
+
marginTop: -bleedTop,
|
|
1852
|
+
marginLeft: -stickyBleedHorizontal,
|
|
1853
|
+
marginRight: -stickyBleedHorizontal,
|
|
1854
|
+
paddingTop: bleedTop,
|
|
1855
|
+
paddingLeft: stickyBleedHorizontal,
|
|
1856
|
+
paddingRight: stickyBleedHorizontal
|
|
1857
|
+
},
|
|
1858
|
+
children: node
|
|
1845
1859
|
},
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
);
|
|
1860
|
+
key
|
|
1861
|
+
);
|
|
1862
|
+
};
|
|
1850
1863
|
const searchHeader = searchable ? renderStickySearch(
|
|
1851
1864
|
/* @__PURE__ */ jsx4(
|
|
1852
1865
|
ContextMenuItem,
|
|
@@ -1866,10 +1879,13 @@ var ContextMenuRoot = forwardRef(
|
|
|
1866
1879
|
if (!React5.Children.toArray(children).some(isSearchCellElement)) {
|
|
1867
1880
|
return children;
|
|
1868
1881
|
}
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1882
|
+
let renderedBefore = false;
|
|
1883
|
+
return React5.Children.map(children, (child, index2) => {
|
|
1884
|
+
const isFirst = !renderedBefore;
|
|
1885
|
+
if (child !== null && child !== void 0 && typeof child !== "boolean")
|
|
1886
|
+
renderedBefore = true;
|
|
1887
|
+
return isSearchCellElement(child) ? renderStickySearch(child, `context-menu-search-${index2}`, isFirst) : child;
|
|
1888
|
+
});
|
|
1873
1889
|
};
|
|
1874
1890
|
const renderContent = () => {
|
|
1875
1891
|
if (loading || isLoading || type === "loading") {
|