x-ui-design 0.9.59 → 0.9.61
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.esm.js +21 -12
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +21 -12
- package/dist/index.js.map +1 -1
- package/lib/components/Menu/Menu.tsx +13 -6
- package/lib/components/Menu/index.css +1 -0
- package/lib/hooks/usePopupPosition.ts +1 -1
- package/package.json +1 -1
- package/src/app/page.tsx +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -2662,7 +2662,7 @@ const usePopupPosition = ({
|
|
|
2662
2662
|
}
|
|
2663
2663
|
const popupRect = popupRef.current?.getBoundingClientRect();
|
|
2664
2664
|
if (popupRect) {
|
|
2665
|
-
if (
|
|
2665
|
+
if (popupRect?.width < OFFSET) {
|
|
2666
2666
|
setOpen(false);
|
|
2667
2667
|
setPopupPosition({});
|
|
2668
2668
|
const timeout = setTimeout(() => {
|
|
@@ -5291,7 +5291,7 @@ var SubMenu$1 = /*#__PURE__*/Object.freeze({
|
|
|
5291
5291
|
default: SubMenu
|
|
5292
5292
|
});
|
|
5293
5293
|
|
|
5294
|
-
var css_248z$3 = ".xUi-menu{box-shadow:0 0 4px rgba(0,0,0,.15);font-size:14px;user-select:none}.xUi-menu,.xUi-menu-sub-list{border-radius:4px;display:flex;flex-direction:column;gap:4px;list-style:none;margin:0;padding:4px}.xUi-menu-sub-list{background:var(--xui-background-color);height:max-content}.xUi-menu-item-group{padding:0 24px!important}.xUi-menu-vertical .xUi-menu-sub-list{background-color:#fff;box-shadow:0 0 4px rgba(0,0,0,.15);left:100%;position:absolute;right:-100%;top:0;width:-webkit-fill-available;z-index:1}.xUi-menu-horizontal{display:flex;flex-direction:row}.xUi-menu-item{align-items:center;border-radius:4px;color:var(--xui-text-color);cursor:pointer;display:flex;height:40px;min-height:40px;padding:0 12px;transition:background .3s}.xUi-menu-item:hover{background:rgba(0,0,0,.04)}.xUi-menu-item-icon{margin-right:8px}.xUi-menu-sub{border-radius:6px;position:relative}.xUi-menu-sub-title{align-items:center;cursor:pointer;display:flex;height:40px;padding:0 12px;&:hover{background-color:var(--xui-color-hover);border-radius:6px}}.xUi-menu-sub-label{flex:1}.xUi-menu-sub-arrow{margin-left:8px;transition:transform .2s}.xUi-menu-vertical .xUi-menu-sub-arrow{transform:rotate(-90deg)}.xUi-menu-group{list-style:none;margin:0;padding:0}.xUi-menu-group-title{color:rgba(0,0,0,.45);font-size:12px;padding:8px 12px}.xUi-menu-group-list{list-style:none;margin:0;padding:0}.xUi-menu-divider{border-bottom:1px solid var(--xui-color-disabled);display:block;margin:0 auto;width:calc(100% - 16px)}.xUi-menu-item.xUi-menu-item-disabled{cursor:auto;opacity:.6;&:hover{background-color:unset}}.xUi-menu-inline .xUi-menu-sub-list{background-color:var(--xui-background-color)}.xUi-menu-inline .xUi-menu-item{padding:0 24px}.xUi-menu-inline .xUi-menu-sub-title{padding:0 20px}.xUi-menu-inline .xUi-menu-sub-list-sub .xUi-menu-item{padding:0 30px}";
|
|
5294
|
+
var css_248z$3 = ".xUi-menu{box-shadow:0 0 4px rgba(0,0,0,.15);font-size:14px;user-select:none}.xUi-menu,.xUi-menu-sub-list{border-radius:4px;display:flex;flex-direction:column;gap:4px;list-style:none;margin:0;padding:4px}.xUi-menu-sub-list{background:var(--xui-background-color);height:max-content}.xUi-menu-item-group{padding:0 24px!important}.xUi-menu-vertical .xUi-menu-sub-list{background-color:#fff;box-shadow:0 0 4px rgba(0,0,0,.15);left:100%;position:absolute;right:-100%;top:0;width:-webkit-fill-available;z-index:1}.xUi-menu-horizontal{display:flex;flex-direction:row}.xUi-menu-item{align-items:center;border-radius:4px;color:var(--xui-text-color);cursor:pointer;display:flex;height:40px;min-height:40px;padding:0 12px;transition:background .3s}.xUi-menu-item-selected,.xUi-menu-item:hover{background:rgba(0,0,0,.04)}.xUi-menu-item-icon{margin-right:8px}.xUi-menu-sub{border-radius:6px;position:relative}.xUi-menu-sub-title{align-items:center;cursor:pointer;display:flex;height:40px;padding:0 12px;&:hover{background-color:var(--xui-color-hover);border-radius:6px}}.xUi-menu-sub-label{flex:1}.xUi-menu-sub-arrow{margin-left:8px;transition:transform .2s}.xUi-menu-vertical .xUi-menu-sub-arrow{transform:rotate(-90deg)}.xUi-menu-group{list-style:none;margin:0;padding:0}.xUi-menu-group-title{color:rgba(0,0,0,.45);font-size:12px;padding:8px 12px}.xUi-menu-group-list{list-style:none;margin:0;padding:0}.xUi-menu-divider{border-bottom:1px solid var(--xui-color-disabled);display:block;margin:0 auto;width:calc(100% - 16px)}.xUi-menu-item.xUi-menu-item-disabled{cursor:auto;opacity:.6;&:hover{background-color:unset}}.xUi-menu-inline .xUi-menu-sub-list{background-color:var(--xui-background-color)}.xUi-menu-inline .xUi-menu-item{padding:0 24px}.xUi-menu-inline .xUi-menu-sub-title{padding:0 20px}.xUi-menu-inline .xUi-menu-sub-list-sub .xUi-menu-item{padding:0 30px}";
|
|
5295
5295
|
styleInject(css_248z$3);
|
|
5296
5296
|
|
|
5297
5297
|
const MenuContext = /*#__PURE__*/createContext(null);
|
|
@@ -5399,14 +5399,18 @@ const Menu = ({
|
|
|
5399
5399
|
itemKey: it.key,
|
|
5400
5400
|
label: it.label,
|
|
5401
5401
|
icon: it.icon,
|
|
5402
|
+
selected: selectedKeys.includes(it.key),
|
|
5402
5403
|
className: `${prefixCls}-item-disabled`
|
|
5403
|
-
}), (it.children || []).map((c, i) =>
|
|
5404
|
-
|
|
5405
|
-
|
|
5406
|
-
|
|
5407
|
-
|
|
5408
|
-
|
|
5409
|
-
|
|
5404
|
+
}), (it.children || []).map((c, i) => {
|
|
5405
|
+
return /*#__PURE__*/React.createElement(MenuItem, {
|
|
5406
|
+
key: `${c.key}_${i}_menu-item`,
|
|
5407
|
+
itemKey: c.key,
|
|
5408
|
+
label: c.label,
|
|
5409
|
+
icon: c.icon,
|
|
5410
|
+
selected: selectedKeys.includes(c.key),
|
|
5411
|
+
className: `${prefixCls}-item-group`
|
|
5412
|
+
});
|
|
5413
|
+
}));
|
|
5410
5414
|
}
|
|
5411
5415
|
return it.children ? /*#__PURE__*/React.createElement(SubMenu, {
|
|
5412
5416
|
key: `${it.key}_${it.label}_${index}_sub_menu`,
|
|
@@ -5423,12 +5427,14 @@ const Menu = ({
|
|
|
5423
5427
|
itemKey: c.key,
|
|
5424
5428
|
label: c.label,
|
|
5425
5429
|
icon: c.icon,
|
|
5430
|
+
selected: selectedKeys.includes(c.key),
|
|
5426
5431
|
className: `${prefixCls}-item-disabled`
|
|
5427
5432
|
}), (c.children || []).map((c, _i) => /*#__PURE__*/React.createElement(MenuItem, {
|
|
5428
5433
|
key: `${c.key}_${_i}_menu-item`,
|
|
5429
5434
|
itemKey: c.key,
|
|
5430
5435
|
label: c.label,
|
|
5431
5436
|
icon: c.icon,
|
|
5437
|
+
selected: selectedKeys.includes(c.key),
|
|
5432
5438
|
className: `${prefixCls}-item-group`
|
|
5433
5439
|
})));
|
|
5434
5440
|
}
|
|
@@ -5443,18 +5449,21 @@ const Menu = ({
|
|
|
5443
5449
|
key: `${c.key}_${_idx}_${c.label}_menu-item`,
|
|
5444
5450
|
itemKey: c.key,
|
|
5445
5451
|
label: c.label,
|
|
5446
|
-
icon: c.icon
|
|
5452
|
+
icon: c.icon,
|
|
5453
|
+
selected: selectedKeys.includes(c.key)
|
|
5447
5454
|
}))) : /*#__PURE__*/React.createElement(MenuItem, {
|
|
5448
5455
|
key: `${index}_${c.key}_${c.label}_menu-item`,
|
|
5449
5456
|
itemKey: c.key,
|
|
5450
5457
|
label: c.label,
|
|
5451
|
-
icon: c.icon
|
|
5458
|
+
icon: c.icon,
|
|
5459
|
+
selected: selectedKeys.includes(c.key)
|
|
5452
5460
|
});
|
|
5453
5461
|
})) : /*#__PURE__*/React.createElement(MenuItem, {
|
|
5454
5462
|
key: `${index}_${it.key}_menu-item`,
|
|
5455
5463
|
itemKey: it.key,
|
|
5456
5464
|
label: it.label,
|
|
5457
|
-
icon: it.icon
|
|
5465
|
+
icon: it.icon,
|
|
5466
|
+
selected: selectedKeys.includes(it.key)
|
|
5458
5467
|
});
|
|
5459
5468
|
}) : children));
|
|
5460
5469
|
};
|