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.js
CHANGED
|
@@ -2619,7 +2619,6 @@ const usePosition = ({
|
|
|
2619
2619
|
if (!triggerRef.current) {
|
|
2620
2620
|
return {};
|
|
2621
2621
|
}
|
|
2622
|
-
debugger;
|
|
2623
2622
|
const inputRect = triggerRef.current?.getBoundingClientRect();
|
|
2624
2623
|
const dropdownHeight = popupRef.current?.offsetHeight || popupRef.current?.offsetHeight || 0;
|
|
2625
2624
|
const containerRect = (getPopupContainer || getScrollParent(triggerRef.current, true) || document.body).getBoundingClientRect();
|
|
@@ -2697,13 +2696,13 @@ const usePosition = ({
|
|
|
2697
2696
|
controller.abort();
|
|
2698
2697
|
};
|
|
2699
2698
|
}, [isOpen, triggerRef, getPopupContainer, dropdownPosition]);
|
|
2700
|
-
return
|
|
2699
|
+
return {
|
|
2701
2700
|
showPlacement,
|
|
2702
2701
|
dropdownPosition: {
|
|
2703
2702
|
..._dropdownPosition,
|
|
2704
2703
|
opacity: Object.keys(_dropdownPosition).length ? 1 : 0
|
|
2705
2704
|
}
|
|
2706
|
-
}
|
|
2705
|
+
};
|
|
2707
2706
|
};
|
|
2708
2707
|
|
|
2709
2708
|
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}";
|
|
@@ -5553,7 +5552,6 @@ const Popover = ({
|
|
|
5553
5552
|
const triggerRef = React.useRef(null);
|
|
5554
5553
|
const popupRef = React.useRef(null);
|
|
5555
5554
|
const [innerOpen, setInnerOpen] = React.useState(false);
|
|
5556
|
-
const [hover, setHover] = React.useState(false);
|
|
5557
5555
|
const isOpen = visible !== undefined ? visible : open !== undefined ? open : innerOpen;
|
|
5558
5556
|
const {
|
|
5559
5557
|
dropdownPosition,
|
|
@@ -5566,6 +5564,12 @@ const Popover = ({
|
|
|
5566
5564
|
triggerRef,
|
|
5567
5565
|
getPopupContainer: getPopupContainer?.(triggerRef.current)
|
|
5568
5566
|
});
|
|
5567
|
+
console.log({
|
|
5568
|
+
isOpen,
|
|
5569
|
+
popupRef,
|
|
5570
|
+
placement,
|
|
5571
|
+
triggerRef
|
|
5572
|
+
});
|
|
5569
5573
|
React.useEffect(() => {
|
|
5570
5574
|
const handleClickOutside = e => {
|
|
5571
5575
|
if (popupRef.current && !popupRef.current.contains(e.target) && triggerRef.current && !triggerRef.current.contains(e.target)) {
|
|
@@ -5584,14 +5588,12 @@ const Popover = ({
|
|
|
5584
5588
|
setInnerOpen(newState);
|
|
5585
5589
|
}, [isOpen, trigger]);
|
|
5586
5590
|
const handleOnMouseEnter = React.useCallback(() => {
|
|
5587
|
-
setHover(true);
|
|
5588
5591
|
if (trigger === "hover") {
|
|
5589
5592
|
onVisibleChange?.(true);
|
|
5590
5593
|
setInnerOpen(true);
|
|
5591
5594
|
}
|
|
5592
5595
|
}, [trigger]);
|
|
5593
5596
|
const handleOnMouseLeave = React.useCallback(() => {
|
|
5594
|
-
setHover(false);
|
|
5595
5597
|
if (trigger === "hover") {
|
|
5596
5598
|
onVisibleChange?.(false);
|
|
5597
5599
|
setInnerOpen(false);
|
|
@@ -5624,7 +5626,7 @@ const Popover = ({
|
|
|
5624
5626
|
}, childProps, {
|
|
5625
5627
|
className: clsx(prefixCls, `${prefixCls}-${placement}`, overlayClassName),
|
|
5626
5628
|
style: {
|
|
5627
|
-
zIndex:
|
|
5629
|
+
zIndex: 1000,
|
|
5628
5630
|
position: "absolute",
|
|
5629
5631
|
...overlayStyle,
|
|
5630
5632
|
...dropdownPosition
|