x-ui-design 0.8.21 → 0.8.23
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
CHANGED
|
@@ -2617,7 +2617,6 @@ const usePosition = ({
|
|
|
2617
2617
|
if (!triggerRef.current) {
|
|
2618
2618
|
return {};
|
|
2619
2619
|
}
|
|
2620
|
-
debugger;
|
|
2621
2620
|
const inputRect = triggerRef.current?.getBoundingClientRect();
|
|
2622
2621
|
const dropdownHeight = popupRef.current?.offsetHeight || popupRef.current?.offsetHeight || 0;
|
|
2623
2622
|
const containerRect = (getPopupContainer || getScrollParent(triggerRef.current, true) || document.body).getBoundingClientRect();
|
|
@@ -2695,13 +2694,13 @@ const usePosition = ({
|
|
|
2695
2694
|
controller.abort();
|
|
2696
2695
|
};
|
|
2697
2696
|
}, [isOpen, triggerRef, getPopupContainer, dropdownPosition]);
|
|
2698
|
-
return
|
|
2697
|
+
return {
|
|
2699
2698
|
showPlacement,
|
|
2700
2699
|
dropdownPosition: {
|
|
2701
2700
|
..._dropdownPosition,
|
|
2702
2701
|
opacity: Object.keys(_dropdownPosition).length ? 1 : 0
|
|
2703
2702
|
}
|
|
2704
|
-
}
|
|
2703
|
+
};
|
|
2705
2704
|
};
|
|
2706
2705
|
|
|
2707
2706
|
var css_248z$j = ".xUi-datepicker-container{font-family:Arial,sans-serif;height:max-content;position:relative}.xUi-datepicker-input{align-items:center;background-color:transparent;border:1px solid var(--xui-border-color);border-radius:6px;color:var(--xui-text-color);cursor:pointer;display:flex;gap:8px;justify-content:space-between;padding:3px 7px;transition:all .3s}.xUi-datepicker-input.noBordered{border:none!important}.xUi-datepicker-input input{border:none;color:var(--xui-text-color);font-size:var(--xui-font-size-sm);outline:none;padding:0}.xUi-datepicker-input:placeholder-shown{text-overflow:ellipsis}.xUi-datepicker-input:hover{border-color:var(--xui-primary-color)}.xUi-datepicker-icon{color:var(--xui-text-color);cursor:pointer;height:16px;opacity:.6;transition:.3s ease;width:16px}.xUi-datepicker-icon:hover{color:var(--xui-primary-color);opacity:1}.xUi-datepicker-selected-date{border:none;color:var(--xui-text-color);font-size:var(--xui-font-size-md);letter-spacing:.8px;outline:none}.xUi-datepicker-disabled{background-color:var(--xui-color-disabled);border-color:var(--xui-border-color)!important;cursor:not-allowed;opacity:.5}.xUi-datepicker-disabled .xUi-datepicker-selected-date{cursor:not-allowed;opacity:.6}.xUi-datepicker-disabled .xUi-datepicker-icon{cursor:not-allowed}.xUi-datepicker-icon{align-items:center;color:#8c8c8c;display:flex;font-size:16px;gap:6px}.xUi-datepicker-error{border-color:var(--xui-error-color)}.xUi-datepicker-error .error-svg-icon,.xUi-datepicker-error .xUi-datepicker-icon,.xUi-datepicker-icon .error-svg-icon{color:var(--xui-error-color)}.xUi-datepicker-input.sm{font-size:var(--xui-font-size-sm);padding:4px 8px}.xUi-datepicker-input.md{font-size:var(--xui-font-size-md);padding:8px 12px}.xUi-datepicker-input.lg{font-size:var(--xui-font-size-lg);padding:10px 16px}.xUi-datepicker-dropdown-wrapper{position:absolute;transition:opacity .3s ease,transform .01s ease;z-index:1000}.xUi-datepicker-dropdown-wrapper.bottomLeft{left:0;margin-top:4px;top:100%}.xUi-datepicker-dropdown-wrapper.bottomRight{margin-top:4px;right:0;top:100%}.xUi-datepicker-dropdown-wrapper.topLeft{bottom:100%;left:0;margin-bottom:4px}.xUi-datepicker-dropdown-wrapper.topRight{bottom:100%;margin-bottom:4px;right:0}.xUi-datepicker-dropdown{background:var(--xui-background-color);border:1px solid var(--xui-border-color);border-radius:4px;box-shadow:0 2px 8px rgba(0,0,0,.15);min-width:250px;padding:12px}.xUi-datepicker-header{align-items:center;border-bottom:1px solid var(--xui-border-color);display:flex;gap:8px;justify-content:space-between;margin-bottom:8px;padding-bottom:12px}.xUi-datepicker-day-footer{align-items:center;border-top:1px solid var(--xui-border-color);display:flex;justify-content:center;margin-top:8px;padding-top:12px;width:100%}.xUi-datepicker-nav-buttons{display:flex;gap:4px}.xUi-datepicker-nav-buttons button{background:none;border:none;border-radius:4px;color:var(--xui-text-color);cursor:pointer;font-size:20px;opacity:.7;padding:2px 6px;transition:all .3s}.xUi-datepicker-nav-buttons button:not(:disabled):hover{color:var(--xui-primary-color)}.xUi-datepicker-dropdown-selects{align-items:center;display:flex;gap:6px}.xUi-datepicker-dropdown-selects button,.xUi-datepicker-select{background:var(--xui-background-color);border:none;border-radius:4px;color:var(--xui-text-color);cursor:pointer;font-weight:600;padding:4px 8px;transition:all .3s}.xUi-datepicker-dropdown-selects button:hover,.xUi-datepicker-select:not(:disabled):hover{color:var(--xui-primary-color)}.xUi-datepicker-grid{display:grid;gap:2px;grid-template-columns:repeat(3,1fr);text-align:center}.xUi-datepicker-grid.day{grid-template-columns:repeat(7,1fr)}.xUi-datepicker-day-header{color:var(--xui-text-color);font-size:14px;margin:4px 0;user-select:none}.xUi-datepicker-day,.xUi-datepicker-month,.xUi-datepicker-year{background:none;border:none;border-radius:4px;color:var(--xui-text-color);cursor:pointer;height:30px;line-height:30px;min-width:30px;text-align:center;transition:all .2s}.xUi-datepicker-month,.xUi-datepicker-year{margin:7px}.xUi-datepicker-day:disabled,.xUi-datepicker-month:disabled,.xUi-datepicker-select:disabled,.xUi-datepicker-year:disabled{background-color:var(--xui-color-disabled);cursor:not-allowed;opacity:.5}.xUi-datepicker-day:not(:disabled):hover,.xUi-datepicker-month:not(:disabled):hover,.xUi-datepicker-year:not(:disabled):hover{background:var(--xui-primary-color-light);color:#fff}.xUi-datepicker-selected{background:var(--xui-primary-color)!important;color:#fff!important;font-weight:700}.xUi-datepicker-other-month{color:var(--xui-text-color);opacity:.4}.xUi-datepicker-other-month:not(:disabled):hover{background-color:var(--xui-color-hover);color:var(--xui-text-color);user-select:none}.xUi-datepicker-footer{margin-top:12px;text-align:right}.xUi-datepicker-footer-today-btn{background:none;border:1px solid var(--xui-border-color);border-radius:4px;color:var(--xui-primary-color);cursor:pointer;font-size:13px;padding:4px 8px;transition:all .3s}.xUi-datepicker-footer-today-btn:not(:disabled):hover{background-color:var(--xui-primary-color-light);color:#fff}.xUi-datepicker-large .xUi-datepicker-selected-date{font-size:16px}.xUi-datepicker-large .xUi-datepicker-input{padding:11px}.xUi-datepicker-middle .xUi-datepicker-input{padding:6px 11px}";
|
|
@@ -5551,7 +5550,6 @@ const Popover = ({
|
|
|
5551
5550
|
const triggerRef = useRef(null);
|
|
5552
5551
|
const popupRef = useRef(null);
|
|
5553
5552
|
const [innerOpen, setInnerOpen] = useState(false);
|
|
5554
|
-
const [hover, setHover] = useState(false);
|
|
5555
5553
|
const isOpen = visible !== undefined ? visible : open !== undefined ? open : innerOpen;
|
|
5556
5554
|
const {
|
|
5557
5555
|
dropdownPosition,
|
|
@@ -5564,6 +5562,12 @@ const Popover = ({
|
|
|
5564
5562
|
triggerRef,
|
|
5565
5563
|
getPopupContainer: getPopupContainer?.(triggerRef.current)
|
|
5566
5564
|
});
|
|
5565
|
+
console.log({
|
|
5566
|
+
isOpen,
|
|
5567
|
+
popupRef,
|
|
5568
|
+
placement,
|
|
5569
|
+
triggerRef
|
|
5570
|
+
});
|
|
5567
5571
|
useEffect(() => {
|
|
5568
5572
|
const handleClickOutside = e => {
|
|
5569
5573
|
if (popupRef.current && !popupRef.current.contains(e.target) && triggerRef.current && !triggerRef.current.contains(e.target)) {
|
|
@@ -5582,14 +5586,12 @@ const Popover = ({
|
|
|
5582
5586
|
setInnerOpen(newState);
|
|
5583
5587
|
}, [isOpen, trigger]);
|
|
5584
5588
|
const handleOnMouseEnter = useCallback(() => {
|
|
5585
|
-
setHover(true);
|
|
5586
5589
|
if (trigger === "hover") {
|
|
5587
5590
|
onVisibleChange?.(true);
|
|
5588
5591
|
setInnerOpen(true);
|
|
5589
5592
|
}
|
|
5590
5593
|
}, [trigger]);
|
|
5591
5594
|
const handleOnMouseLeave = useCallback(() => {
|
|
5592
|
-
setHover(false);
|
|
5593
5595
|
if (trigger === "hover") {
|
|
5594
5596
|
onVisibleChange?.(false);
|
|
5595
5597
|
setInnerOpen(false);
|
|
@@ -5622,7 +5624,7 @@ const Popover = ({
|
|
|
5622
5624
|
}, childProps, {
|
|
5623
5625
|
className: clsx(prefixCls, `${prefixCls}-${placement}`, overlayClassName),
|
|
5624
5626
|
style: {
|
|
5625
|
-
zIndex:
|
|
5627
|
+
zIndex: 1000,
|
|
5626
5628
|
position: "absolute",
|
|
5627
5629
|
...overlayStyle,
|
|
5628
5630
|
...dropdownPosition
|