@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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xsolla/xui-context-menu",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.240.0",
|
|
4
4
|
"main": "./web/index.js",
|
|
5
5
|
"module": "./web/index.mjs",
|
|
6
6
|
"types": "./web/index.d.ts",
|
|
@@ -13,15 +13,15 @@
|
|
|
13
13
|
"test:coverage": "vitest run --coverage"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@xsolla/xui-checkbox": "0.
|
|
17
|
-
"@xsolla/xui-core": "0.
|
|
18
|
-
"@xsolla/xui-divider": "0.
|
|
19
|
-
"@xsolla/xui-icons": "0.
|
|
20
|
-
"@xsolla/xui-icons-base": "0.
|
|
21
|
-
"@xsolla/xui-primitives-core": "0.
|
|
22
|
-
"@xsolla/xui-radio": "0.
|
|
23
|
-
"@xsolla/xui-spinner": "0.
|
|
24
|
-
"@xsolla/xui-typography": "0.
|
|
16
|
+
"@xsolla/xui-checkbox": "0.240.0",
|
|
17
|
+
"@xsolla/xui-core": "0.240.0",
|
|
18
|
+
"@xsolla/xui-divider": "0.240.0",
|
|
19
|
+
"@xsolla/xui-icons": "0.240.0",
|
|
20
|
+
"@xsolla/xui-icons-base": "0.240.0",
|
|
21
|
+
"@xsolla/xui-primitives-core": "0.240.0",
|
|
22
|
+
"@xsolla/xui-radio": "0.240.0",
|
|
23
|
+
"@xsolla/xui-spinner": "0.240.0",
|
|
24
|
+
"@xsolla/xui-typography": "0.240.0"
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|
|
27
27
|
"react": ">=16.8.0",
|
package/web/index.js
CHANGED
|
@@ -1845,20 +1845,33 @@ var ContextMenuRoot = (0, import_react8.forwardRef)(
|
|
|
1845
1845
|
);
|
|
1846
1846
|
};
|
|
1847
1847
|
const renderedItems = searchable ? filterItems(items, debouncedQuery) : [...items];
|
|
1848
|
-
const
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1848
|
+
const stickyBleedHorizontal = withArrow ? 0 : panelPaddingHorizontal;
|
|
1849
|
+
const stickyBleedTop = withArrow ? 0 : panelPaddingVertical;
|
|
1850
|
+
const renderStickySearch = (node, key, isFirst = true) => {
|
|
1851
|
+
const bleedTop = isFirst ? stickyBleedTop : 0;
|
|
1852
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
1853
|
+
"div",
|
|
1854
|
+
{
|
|
1855
|
+
"data-sticky": "top",
|
|
1856
|
+
style: {
|
|
1857
|
+
position: "sticky",
|
|
1858
|
+
// Sticks to the scrollport edge, not the content edge; the
|
|
1859
|
+
// padding below keeps the panel's breathing room above the cell.
|
|
1860
|
+
top: 0,
|
|
1861
|
+
zIndex: 1,
|
|
1862
|
+
backgroundColor: surfaceColor,
|
|
1863
|
+
marginTop: -bleedTop,
|
|
1864
|
+
marginLeft: -stickyBleedHorizontal,
|
|
1865
|
+
marginRight: -stickyBleedHorizontal,
|
|
1866
|
+
paddingTop: bleedTop,
|
|
1867
|
+
paddingLeft: stickyBleedHorizontal,
|
|
1868
|
+
paddingRight: stickyBleedHorizontal
|
|
1869
|
+
},
|
|
1870
|
+
children: node
|
|
1857
1871
|
},
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
);
|
|
1872
|
+
key
|
|
1873
|
+
);
|
|
1874
|
+
};
|
|
1862
1875
|
const searchHeader = searchable ? renderStickySearch(
|
|
1863
1876
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
1864
1877
|
ContextMenuItem,
|
|
@@ -1878,10 +1891,13 @@ var ContextMenuRoot = (0, import_react8.forwardRef)(
|
|
|
1878
1891
|
if (!import_react8.default.Children.toArray(children).some(isSearchCellElement)) {
|
|
1879
1892
|
return children;
|
|
1880
1893
|
}
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1894
|
+
let renderedBefore = false;
|
|
1895
|
+
return import_react8.default.Children.map(children, (child, index2) => {
|
|
1896
|
+
const isFirst = !renderedBefore;
|
|
1897
|
+
if (child !== null && child !== void 0 && typeof child !== "boolean")
|
|
1898
|
+
renderedBefore = true;
|
|
1899
|
+
return isSearchCellElement(child) ? renderStickySearch(child, `context-menu-search-${index2}`, isFirst) : child;
|
|
1900
|
+
});
|
|
1885
1901
|
};
|
|
1886
1902
|
const renderContent = () => {
|
|
1887
1903
|
if (loading || isLoading || type === "loading") {
|