@rufous/ui 0.2.102 → 0.2.104
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/main.cjs +16 -7
- package/dist/main.d.cts +1 -1
- package/dist/main.d.ts +1 -1
- package/dist/main.js +16 -7
- package/package.json +1 -1
package/dist/main.cjs
CHANGED
|
@@ -1748,7 +1748,7 @@ var Checkbox = ({
|
|
|
1748
1748
|
}) => {
|
|
1749
1749
|
const sxClass = useSx(sx);
|
|
1750
1750
|
const handleChange = (e) => {
|
|
1751
|
-
if (onChange) onChange(e.target.checked);
|
|
1751
|
+
if (onChange) onChange(e, e.target.checked);
|
|
1752
1752
|
};
|
|
1753
1753
|
return /* @__PURE__ */ import_react16.default.createElement("div", { className: ["checkbox-wrapper-13", sxClass].filter(Boolean).join(" ") }, /* @__PURE__ */ import_react16.default.createElement("label", { className: `${className}`, style }, /* @__PURE__ */ import_react16.default.createElement(
|
|
1754
1754
|
"input",
|
|
@@ -3406,9 +3406,10 @@ var DateField = ({
|
|
|
3406
3406
|
(0, import_react21.useEffect)(() => {
|
|
3407
3407
|
if (!open || !containerRef.current) return;
|
|
3408
3408
|
const rect = containerRef.current.getBoundingClientRect();
|
|
3409
|
+
const PICKER_H = 420;
|
|
3409
3410
|
const spaceBelow = window.innerHeight - rect.bottom;
|
|
3410
|
-
const
|
|
3411
|
-
setDropUp(spaceBelow <
|
|
3411
|
+
const spaceAbove = rect.top;
|
|
3412
|
+
setDropUp(spaceBelow < PICKER_H && spaceAbove > spaceBelow);
|
|
3412
3413
|
}, [open]);
|
|
3413
3414
|
const commitDate = (0, import_react21.useCallback)((d, h, m, ap) => {
|
|
3414
3415
|
setSelectedDate(d);
|
|
@@ -3620,13 +3621,21 @@ var DateField = ({
|
|
|
3620
3621
|
style: (() => {
|
|
3621
3622
|
const rect = containerRef.current?.getBoundingClientRect();
|
|
3622
3623
|
if (!rect) return {};
|
|
3623
|
-
const
|
|
3624
|
-
const
|
|
3625
|
-
const
|
|
3624
|
+
const PICKER_H = 420;
|
|
3625
|
+
const GAP2 = 6;
|
|
3626
|
+
const EDGE = 4;
|
|
3627
|
+
const spaceBelow = window.innerHeight - rect.bottom - GAP2;
|
|
3628
|
+
const spaceAbove = rect.top - GAP2;
|
|
3629
|
+
const useDropUp = spaceBelow < PICKER_H && spaceAbove > spaceBelow;
|
|
3630
|
+
const rawTop = useDropUp ? rect.top - PICKER_H - GAP2 : rect.bottom + GAP2;
|
|
3631
|
+
const top = Math.min(
|
|
3632
|
+
Math.max(rawTop, EDGE),
|
|
3633
|
+
window.innerHeight - PICKER_H - EDGE
|
|
3634
|
+
);
|
|
3626
3635
|
return {
|
|
3627
3636
|
position: "fixed",
|
|
3628
3637
|
left: rect.left,
|
|
3629
|
-
|
|
3638
|
+
top,
|
|
3630
3639
|
zIndex: 99999
|
|
3631
3640
|
};
|
|
3632
3641
|
})(),
|
package/dist/main.d.cts
CHANGED
|
@@ -510,7 +510,7 @@ interface CheckboxProps {
|
|
|
510
510
|
id?: string;
|
|
511
511
|
label?: string;
|
|
512
512
|
checked: boolean;
|
|
513
|
-
onChange: (checked: boolean) => void;
|
|
513
|
+
onChange: (event: React.ChangeEvent<HTMLInputElement>, checked: boolean) => void;
|
|
514
514
|
disabled?: boolean;
|
|
515
515
|
className?: string;
|
|
516
516
|
style?: React.CSSProperties;
|
package/dist/main.d.ts
CHANGED
|
@@ -510,7 +510,7 @@ interface CheckboxProps {
|
|
|
510
510
|
id?: string;
|
|
511
511
|
label?: string;
|
|
512
512
|
checked: boolean;
|
|
513
|
-
onChange: (checked: boolean) => void;
|
|
513
|
+
onChange: (event: React.ChangeEvent<HTMLInputElement>, checked: boolean) => void;
|
|
514
514
|
disabled?: boolean;
|
|
515
515
|
className?: string;
|
|
516
516
|
style?: React.CSSProperties;
|
package/dist/main.js
CHANGED
|
@@ -1582,7 +1582,7 @@ var Checkbox = ({
|
|
|
1582
1582
|
}) => {
|
|
1583
1583
|
const sxClass = useSx(sx);
|
|
1584
1584
|
const handleChange = (e) => {
|
|
1585
|
-
if (onChange) onChange(e.target.checked);
|
|
1585
|
+
if (onChange) onChange(e, e.target.checked);
|
|
1586
1586
|
};
|
|
1587
1587
|
return /* @__PURE__ */ React67.createElement("div", { className: ["checkbox-wrapper-13", sxClass].filter(Boolean).join(" ") }, /* @__PURE__ */ React67.createElement("label", { className: `${className}`, style }, /* @__PURE__ */ React67.createElement(
|
|
1588
1588
|
"input",
|
|
@@ -3257,9 +3257,10 @@ var DateField = ({
|
|
|
3257
3257
|
useEffect7(() => {
|
|
3258
3258
|
if (!open || !containerRef.current) return;
|
|
3259
3259
|
const rect = containerRef.current.getBoundingClientRect();
|
|
3260
|
+
const PICKER_H = 420;
|
|
3260
3261
|
const spaceBelow = window.innerHeight - rect.bottom;
|
|
3261
|
-
const
|
|
3262
|
-
setDropUp(spaceBelow <
|
|
3262
|
+
const spaceAbove = rect.top;
|
|
3263
|
+
setDropUp(spaceBelow < PICKER_H && spaceAbove > spaceBelow);
|
|
3263
3264
|
}, [open]);
|
|
3264
3265
|
const commitDate = useCallback3((d, h, m, ap) => {
|
|
3265
3266
|
setSelectedDate(d);
|
|
@@ -3471,13 +3472,21 @@ var DateField = ({
|
|
|
3471
3472
|
style: (() => {
|
|
3472
3473
|
const rect = containerRef.current?.getBoundingClientRect();
|
|
3473
3474
|
if (!rect) return {};
|
|
3474
|
-
const
|
|
3475
|
-
const
|
|
3476
|
-
const
|
|
3475
|
+
const PICKER_H = 420;
|
|
3476
|
+
const GAP2 = 6;
|
|
3477
|
+
const EDGE = 4;
|
|
3478
|
+
const spaceBelow = window.innerHeight - rect.bottom - GAP2;
|
|
3479
|
+
const spaceAbove = rect.top - GAP2;
|
|
3480
|
+
const useDropUp = spaceBelow < PICKER_H && spaceAbove > spaceBelow;
|
|
3481
|
+
const rawTop = useDropUp ? rect.top - PICKER_H - GAP2 : rect.bottom + GAP2;
|
|
3482
|
+
const top = Math.min(
|
|
3483
|
+
Math.max(rawTop, EDGE),
|
|
3484
|
+
window.innerHeight - PICKER_H - EDGE
|
|
3485
|
+
);
|
|
3477
3486
|
return {
|
|
3478
3487
|
position: "fixed",
|
|
3479
3488
|
left: rect.left,
|
|
3480
|
-
|
|
3489
|
+
top,
|
|
3481
3490
|
zIndex: 99999
|
|
3482
3491
|
};
|
|
3483
3492
|
})(),
|