@rufous/ui 0.2.67 → 0.2.69
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 +153 -104
- package/dist/main.css +12 -11
- package/dist/main.js +134 -85
- package/package.json +1 -1
package/dist/main.cjs
CHANGED
|
@@ -1526,6 +1526,7 @@ IconButton.displayName = "IconButton";
|
|
|
1526
1526
|
// lib/Dialogs/BaseDialog.tsx
|
|
1527
1527
|
var React65 = __toESM(require("react"), 1);
|
|
1528
1528
|
var import_react14 = require("react");
|
|
1529
|
+
var import_react_dom = __toESM(require("react-dom"), 1);
|
|
1529
1530
|
var import_lucide_react = require("lucide-react");
|
|
1530
1531
|
var BaseDialog = ({
|
|
1531
1532
|
open = false,
|
|
@@ -1629,20 +1630,26 @@ var BaseDialog = ({
|
|
|
1629
1630
|
dialogInner
|
|
1630
1631
|
) : /* @__PURE__ */ React65.createElement("div", { className: containerClass, style: containerStyle }, dialogInner);
|
|
1631
1632
|
if (TransitionComponent) {
|
|
1632
|
-
return
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1633
|
+
return import_react_dom.default.createPortal(
|
|
1634
|
+
/* @__PURE__ */ React65.createElement(
|
|
1635
|
+
TransitionComponent,
|
|
1636
|
+
{
|
|
1637
|
+
in: open,
|
|
1638
|
+
unmountOnExit: true,
|
|
1639
|
+
...TransitionProps,
|
|
1640
|
+
onExited: () => {
|
|
1641
|
+
TransitionProps?.onExited?.();
|
|
1642
|
+
}
|
|
1643
|
+
},
|
|
1644
|
+
/* @__PURE__ */ React65.createElement("div", { className: `dialog-overlay ${size === "fullScreen" ? "overlay-fullscreen" : ""}` }, dialogContent)
|
|
1645
|
+
),
|
|
1646
|
+
document.body
|
|
1643
1647
|
);
|
|
1644
1648
|
}
|
|
1645
|
-
return
|
|
1649
|
+
return import_react_dom.default.createPortal(
|
|
1650
|
+
/* @__PURE__ */ React65.createElement("div", { className: `dialog-overlay ${size === "fullScreen" ? "overlay-fullscreen" : ""}` }, dialogContent),
|
|
1651
|
+
document.body
|
|
1652
|
+
);
|
|
1646
1653
|
};
|
|
1647
1654
|
var BaseDialog_default = BaseDialog;
|
|
1648
1655
|
|
|
@@ -2148,7 +2155,7 @@ var AddressLookup_default = AddressLookup;
|
|
|
2148
2155
|
|
|
2149
2156
|
// lib/TextFields/DateField.tsx
|
|
2150
2157
|
var import_react19 = __toESM(require("react"), 1);
|
|
2151
|
-
var
|
|
2158
|
+
var import_react_dom2 = require("react-dom");
|
|
2152
2159
|
var WEEKDAYS = ["SU", "MO", "TU", "WE", "TH", "FR", "SA"];
|
|
2153
2160
|
var MONTHS = [
|
|
2154
2161
|
"January",
|
|
@@ -2794,7 +2801,7 @@ var DateField = ({
|
|
|
2794
2801
|
)),
|
|
2795
2802
|
label && /* @__PURE__ */ import_react19.default.createElement("label", { htmlFor: inputId, className: "rf-text-field__label" }, label, " ", required && /* @__PURE__ */ import_react19.default.createElement("span", { className: "rf-text-field__asterisk" }, "*")),
|
|
2796
2803
|
variant === "outlined" && /* @__PURE__ */ import_react19.default.createElement("fieldset", { className: "rf-text-field__notch" }, label && /* @__PURE__ */ import_react19.default.createElement("legend", { className: "rf-text-field__legend" }, /* @__PURE__ */ import_react19.default.createElement("span", null, label, required ? " *" : "")))
|
|
2797
|
-
), open && !disabled && (0,
|
|
2804
|
+
), open && !disabled && (0, import_react_dom2.createPortal)(
|
|
2798
2805
|
/* @__PURE__ */ import_react19.default.createElement(
|
|
2799
2806
|
"div",
|
|
2800
2807
|
{
|
|
@@ -3540,6 +3547,7 @@ DateRangeField.displayName = "DateRangeField";
|
|
|
3540
3547
|
|
|
3541
3548
|
// lib/TextFields/Autocomplete.tsx
|
|
3542
3549
|
var import_react21 = __toESM(require("react"), 1);
|
|
3550
|
+
var import_react_dom3 = __toESM(require("react-dom"), 1);
|
|
3543
3551
|
var ChevronDownIcon = () => /* @__PURE__ */ import_react21.default.createElement("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ import_react21.default.createElement("polyline", { points: "6 9 12 15 18 9" }));
|
|
3544
3552
|
var CloseSmIcon = ({ size = 16 }) => /* @__PURE__ */ import_react21.default.createElement("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round" }, /* @__PURE__ */ import_react21.default.createElement("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), /* @__PURE__ */ import_react21.default.createElement("line", { x1: "6", y1: "6", x2: "18", y2: "18" }));
|
|
3545
3553
|
var CheckIcon = () => /* @__PURE__ */ import_react21.default.createElement("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ import_react21.default.createElement("polyline", { points: "20 6 9 17 4 12" }));
|
|
@@ -3593,11 +3601,21 @@ function AutocompleteInner(props, _ref) {
|
|
|
3593
3601
|
const [open, setOpen] = (0, import_react21.useState)(false);
|
|
3594
3602
|
const [inputStr, setInputStr] = (0, import_react21.useState)("");
|
|
3595
3603
|
const [focusedIdx, setFocusedIdx] = (0, import_react21.useState)(-1);
|
|
3604
|
+
const [popupStyle, setPopupStyle] = (0, import_react21.useState)({});
|
|
3596
3605
|
const containerRef = (0, import_react21.useRef)(null);
|
|
3597
3606
|
const inputRef = (0, import_react21.useRef)(null);
|
|
3598
3607
|
const listRef = (0, import_react21.useRef)(null);
|
|
3599
3608
|
const inputId = (0, import_react21.useRef)(`rf-ac-${Math.random().toString(36).slice(2, 9)}`).current;
|
|
3600
3609
|
const sxClass = useSx(sx);
|
|
3610
|
+
const calcPopupStyle = (0, import_react21.useCallback)(() => {
|
|
3611
|
+
if (!containerRef.current) return;
|
|
3612
|
+
const rect = containerRef.current.getBoundingClientRect();
|
|
3613
|
+
setPopupStyle({
|
|
3614
|
+
top: rect.bottom + 4,
|
|
3615
|
+
left: rect.left,
|
|
3616
|
+
width: rect.width
|
|
3617
|
+
});
|
|
3618
|
+
}, []);
|
|
3601
3619
|
const activeInput = controlledInput !== void 0 ? controlledInput : inputStr;
|
|
3602
3620
|
const selectedValues = multiple ? Array.isArray(value) ? value : [] : value != null ? [value] : [];
|
|
3603
3621
|
const isEqual = (0, import_react21.useCallback)(
|
|
@@ -3631,12 +3649,13 @@ function AutocompleteInner(props, _ref) {
|
|
|
3631
3649
|
filtered.forEach((opt, i) => flatEntries.push({ kind: "option", option: opt, flatIdx: i }));
|
|
3632
3650
|
}
|
|
3633
3651
|
const selectableOptions = flatEntries.filter((e) => e.kind === "option");
|
|
3634
|
-
const openPopup = () => {
|
|
3652
|
+
const openPopup = (0, import_react21.useCallback)(() => {
|
|
3635
3653
|
if (disabled) return;
|
|
3654
|
+
calcPopupStyle();
|
|
3636
3655
|
setOpen(true);
|
|
3637
3656
|
setFocusedIdx(-1);
|
|
3638
3657
|
onOpen?.();
|
|
3639
|
-
};
|
|
3658
|
+
}, [disabled, calcPopupStyle, onOpen]);
|
|
3640
3659
|
const closePopup = (0, import_react21.useCallback)(() => {
|
|
3641
3660
|
setOpen(false);
|
|
3642
3661
|
setFocusedIdx(-1);
|
|
@@ -3648,14 +3667,20 @@ function AutocompleteInner(props, _ref) {
|
|
|
3648
3667
|
}, [freeSolo, multiple, value, onInputChange, onClose]);
|
|
3649
3668
|
(0, import_react21.useEffect)(() => {
|
|
3650
3669
|
if (!open) return;
|
|
3651
|
-
const
|
|
3670
|
+
const handleOutside = (e) => {
|
|
3652
3671
|
if (containerRef.current && !containerRef.current.contains(e.target)) {
|
|
3653
3672
|
closePopup();
|
|
3654
3673
|
}
|
|
3655
3674
|
};
|
|
3656
|
-
document.addEventListener("mousedown",
|
|
3657
|
-
|
|
3658
|
-
|
|
3675
|
+
document.addEventListener("mousedown", handleOutside);
|
|
3676
|
+
window.addEventListener("scroll", calcPopupStyle, true);
|
|
3677
|
+
window.addEventListener("resize", calcPopupStyle);
|
|
3678
|
+
return () => {
|
|
3679
|
+
document.removeEventListener("mousedown", handleOutside);
|
|
3680
|
+
window.removeEventListener("scroll", calcPopupStyle, true);
|
|
3681
|
+
window.removeEventListener("resize", calcPopupStyle);
|
|
3682
|
+
};
|
|
3683
|
+
}, [open, closePopup, calcPopupStyle]);
|
|
3659
3684
|
(0, import_react21.useEffect)(() => {
|
|
3660
3685
|
if (controlledInput !== void 0) return;
|
|
3661
3686
|
if (!multiple) {
|
|
@@ -3840,34 +3865,37 @@ function AutocompleteInner(props, _ref) {
|
|
|
3840
3865
|
},
|
|
3841
3866
|
/* @__PURE__ */ import_react21.default.createElement(ChevronDownIcon, null)
|
|
3842
3867
|
))
|
|
3843
|
-
), helperText && /* @__PURE__ */ import_react21.default.createElement("div", { className: `rf-text-field__helper-text${error ? " rf-text-field__helper-text--error" : ""}` }, helperText), open && !disabled &&
|
|
3844
|
-
|
|
3845
|
-
|
|
3846
|
-
|
|
3847
|
-
|
|
3848
|
-
|
|
3849
|
-
|
|
3850
|
-
|
|
3851
|
-
if (
|
|
3868
|
+
), helperText && /* @__PURE__ */ import_react21.default.createElement("div", { className: `rf-text-field__helper-text${error ? " rf-text-field__helper-text--error" : ""}` }, helperText), open && !disabled && import_react_dom3.default.createPortal(
|
|
3869
|
+
/* @__PURE__ */ import_react21.default.createElement("div", { className: "rf-autocomplete__popup", role: "presentation", style: popupStyle }, loading ? /* @__PURE__ */ import_react21.default.createElement("div", { className: "rf-autocomplete__loading" }, /* @__PURE__ */ import_react21.default.createElement("span", { className: "rf-ac-spinner" }), loadingText) : flatEntries.length === 0 ? /* @__PURE__ */ import_react21.default.createElement("div", { className: "rf-autocomplete__no-options" }, noOptionsText) : /* @__PURE__ */ import_react21.default.createElement("ul", { ref: listRef, className: "rf-autocomplete__listbox", role: "listbox" }, groupBy ? (
|
|
3870
|
+
// Grouped render
|
|
3871
|
+
(() => {
|
|
3872
|
+
const rendered = [];
|
|
3873
|
+
let groupItems = [];
|
|
3874
|
+
let currentGroup = "";
|
|
3875
|
+
flatEntries.forEach((entry, ei) => {
|
|
3876
|
+
if (entry.kind === "group") {
|
|
3877
|
+
if (groupItems.length > 0) {
|
|
3878
|
+
rendered.push(
|
|
3879
|
+
/* @__PURE__ */ import_react21.default.createElement("li", { key: `g-${currentGroup}`, role: "presentation" }, /* @__PURE__ */ import_react21.default.createElement("div", { className: "rf-autocomplete__group-header" }, currentGroup), /* @__PURE__ */ import_react21.default.createElement("ul", { className: "rf-autocomplete__group-items", role: "group" }, groupItems))
|
|
3880
|
+
);
|
|
3881
|
+
groupItems = [];
|
|
3882
|
+
}
|
|
3883
|
+
currentGroup = entry.label;
|
|
3884
|
+
} else {
|
|
3885
|
+
const { option, flatIdx } = entry;
|
|
3886
|
+
groupItems.push(renderOptionItem(option, flatIdx));
|
|
3887
|
+
}
|
|
3888
|
+
if (ei === flatEntries.length - 1 && groupItems.length > 0) {
|
|
3852
3889
|
rendered.push(
|
|
3853
3890
|
/* @__PURE__ */ import_react21.default.createElement("li", { key: `g-${currentGroup}`, role: "presentation" }, /* @__PURE__ */ import_react21.default.createElement("div", { className: "rf-autocomplete__group-header" }, currentGroup), /* @__PURE__ */ import_react21.default.createElement("ul", { className: "rf-autocomplete__group-items", role: "group" }, groupItems))
|
|
3854
3891
|
);
|
|
3855
|
-
groupItems = [];
|
|
3856
3892
|
}
|
|
3857
|
-
|
|
3858
|
-
|
|
3859
|
-
|
|
3860
|
-
|
|
3861
|
-
|
|
3862
|
-
|
|
3863
|
-
rendered.push(
|
|
3864
|
-
/* @__PURE__ */ import_react21.default.createElement("li", { key: `g-${currentGroup}`, role: "presentation" }, /* @__PURE__ */ import_react21.default.createElement("div", { className: "rf-autocomplete__group-header" }, currentGroup), /* @__PURE__ */ import_react21.default.createElement("ul", { className: "rf-autocomplete__group-items", role: "group" }, groupItems))
|
|
3865
|
-
);
|
|
3866
|
-
}
|
|
3867
|
-
});
|
|
3868
|
-
return rendered;
|
|
3869
|
-
})()
|
|
3870
|
-
) : selectableOptions.map(({ option, flatIdx }) => renderOptionItem(option, flatIdx)))));
|
|
3893
|
+
});
|
|
3894
|
+
return rendered;
|
|
3895
|
+
})()
|
|
3896
|
+
) : selectableOptions.map(({ option, flatIdx }) => renderOptionItem(option, flatIdx)))),
|
|
3897
|
+
document.body
|
|
3898
|
+
));
|
|
3871
3899
|
function renderOptionItem(option, flatIdx) {
|
|
3872
3900
|
const selected = isSelected(option);
|
|
3873
3901
|
const focused = focusedIdx === flatIdx;
|
|
@@ -4558,6 +4586,7 @@ function DataGrid({
|
|
|
4558
4586
|
|
|
4559
4587
|
// lib/Select/Select.tsx
|
|
4560
4588
|
var import_react23 = __toESM(require("react"), 1);
|
|
4589
|
+
var import_react_dom4 = __toESM(require("react-dom"), 1);
|
|
4561
4590
|
var ChevronDownIcon2 = () => /* @__PURE__ */ import_react23.default.createElement("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ import_react23.default.createElement("polyline", { points: "6 9 12 15 18 9" }));
|
|
4562
4591
|
var CheckIcon2 = () => /* @__PURE__ */ import_react23.default.createElement("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ import_react23.default.createElement("polyline", { points: "20 6 9 17 4 12" }));
|
|
4563
4592
|
function normaliseOptions(options) {
|
|
@@ -4584,10 +4613,20 @@ var Select = import_react23.default.forwardRef(function Select2(props, ref) {
|
|
|
4584
4613
|
} = props;
|
|
4585
4614
|
const [open, setOpen] = (0, import_react23.useState)(false);
|
|
4586
4615
|
const [focusedIdx, setFocusedIdx] = (0, import_react23.useState)(-1);
|
|
4616
|
+
const [popupStyle, setPopupStyle] = (0, import_react23.useState)({});
|
|
4587
4617
|
const containerRef = (0, import_react23.useRef)(null);
|
|
4588
4618
|
const listRef = (0, import_react23.useRef)(null);
|
|
4589
4619
|
const inputId = (0, import_react23.useRef)(`rf-sel-${Math.random().toString(36).slice(2, 9)}`).current;
|
|
4590
4620
|
const sxClass = useSx(sx);
|
|
4621
|
+
const calcPopupStyle = (0, import_react23.useCallback)(() => {
|
|
4622
|
+
if (!containerRef.current) return;
|
|
4623
|
+
const rect = containerRef.current.getBoundingClientRect();
|
|
4624
|
+
setPopupStyle({
|
|
4625
|
+
top: rect.bottom + 4,
|
|
4626
|
+
left: rect.left,
|
|
4627
|
+
width: rect.width
|
|
4628
|
+
});
|
|
4629
|
+
}, []);
|
|
4591
4630
|
const options = normaliseOptions(rawOptions);
|
|
4592
4631
|
const selectedValues = multiple ? Array.isArray(value) ? value : value != null ? [value] : [] : value != null ? [value] : [];
|
|
4593
4632
|
const isSelected = (0, import_react23.useCallback)(
|
|
@@ -4599,9 +4638,10 @@ var Select = import_react23.default.forwardRef(function Select2(props, ref) {
|
|
|
4599
4638
|
const isFloating = Boolean(open || hasValue);
|
|
4600
4639
|
const openPopup = (0, import_react23.useCallback)(() => {
|
|
4601
4640
|
if (disabled) return;
|
|
4641
|
+
calcPopupStyle();
|
|
4602
4642
|
setOpen(true);
|
|
4603
4643
|
setFocusedIdx(-1);
|
|
4604
|
-
}, [disabled]);
|
|
4644
|
+
}, [disabled, calcPopupStyle]);
|
|
4605
4645
|
const closePopup = (0, import_react23.useCallback)(() => {
|
|
4606
4646
|
setOpen(false);
|
|
4607
4647
|
setFocusedIdx(-1);
|
|
@@ -4612,14 +4652,20 @@ var Select = import_react23.default.forwardRef(function Select2(props, ref) {
|
|
|
4612
4652
|
}, [open, openPopup, closePopup]);
|
|
4613
4653
|
(0, import_react23.useEffect)(() => {
|
|
4614
4654
|
if (!open) return;
|
|
4615
|
-
const
|
|
4655
|
+
const handleOutside = (e) => {
|
|
4616
4656
|
if (containerRef.current && !containerRef.current.contains(e.target)) {
|
|
4617
4657
|
closePopup();
|
|
4618
4658
|
}
|
|
4619
4659
|
};
|
|
4620
|
-
document.addEventListener("mousedown",
|
|
4621
|
-
|
|
4622
|
-
|
|
4660
|
+
document.addEventListener("mousedown", handleOutside);
|
|
4661
|
+
window.addEventListener("scroll", calcPopupStyle, true);
|
|
4662
|
+
window.addEventListener("resize", calcPopupStyle);
|
|
4663
|
+
return () => {
|
|
4664
|
+
document.removeEventListener("mousedown", handleOutside);
|
|
4665
|
+
window.removeEventListener("scroll", calcPopupStyle, true);
|
|
4666
|
+
window.removeEventListener("resize", calcPopupStyle);
|
|
4667
|
+
};
|
|
4668
|
+
}, [open, closePopup, calcPopupStyle]);
|
|
4623
4669
|
const selectOption = (0, import_react23.useCallback)((opt) => {
|
|
4624
4670
|
if (opt.disabled) return;
|
|
4625
4671
|
if (multiple) {
|
|
@@ -4738,32 +4784,35 @@ var Select = import_react23.default.forwardRef(function Select2(props, ref) {
|
|
|
4738
4784
|
/* @__PURE__ */ import_react23.default.createElement("div", { className: "rf-select__arrow", "aria-hidden": "true" }, /* @__PURE__ */ import_react23.default.createElement(ChevronDownIcon2, null))
|
|
4739
4785
|
),
|
|
4740
4786
|
helperText && /* @__PURE__ */ import_react23.default.createElement("div", { className: `rf-text-field__helper-text${error ? " rf-text-field__helper-text--error" : ""}` }, helperText),
|
|
4741
|
-
open && !disabled &&
|
|
4742
|
-
|
|
4743
|
-
|
|
4744
|
-
|
|
4745
|
-
|
|
4746
|
-
|
|
4747
|
-
|
|
4748
|
-
|
|
4749
|
-
|
|
4750
|
-
|
|
4751
|
-
|
|
4752
|
-
|
|
4753
|
-
|
|
4754
|
-
|
|
4755
|
-
|
|
4756
|
-
|
|
4757
|
-
|
|
4758
|
-
|
|
4759
|
-
|
|
4760
|
-
|
|
4761
|
-
|
|
4762
|
-
|
|
4763
|
-
|
|
4764
|
-
|
|
4765
|
-
|
|
4766
|
-
|
|
4787
|
+
open && !disabled && import_react_dom4.default.createPortal(
|
|
4788
|
+
/* @__PURE__ */ import_react23.default.createElement("div", { className: "rf-select__popup", role: "presentation", style: popupStyle }, /* @__PURE__ */ import_react23.default.createElement("ul", { ref: listRef, className: "rf-select__listbox", role: "listbox", "aria-multiselectable": multiple }, options.map((opt, idx) => {
|
|
4789
|
+
const selected = isSelected(opt.value);
|
|
4790
|
+
const focused = focusedIdx === idx;
|
|
4791
|
+
return /* @__PURE__ */ import_react23.default.createElement(
|
|
4792
|
+
"li",
|
|
4793
|
+
{
|
|
4794
|
+
key: opt.value,
|
|
4795
|
+
"data-idx": idx,
|
|
4796
|
+
role: "option",
|
|
4797
|
+
"aria-selected": selected,
|
|
4798
|
+
"aria-disabled": opt.disabled,
|
|
4799
|
+
className: [
|
|
4800
|
+
"rf-select__option",
|
|
4801
|
+
selected ? "rf-select__option--selected" : "",
|
|
4802
|
+
focused ? "rf-select__option--focused" : "",
|
|
4803
|
+
opt.disabled ? "rf-select__option--disabled" : ""
|
|
4804
|
+
].filter(Boolean).join(" "),
|
|
4805
|
+
onMouseEnter: () => setFocusedIdx(idx),
|
|
4806
|
+
onMouseLeave: () => setFocusedIdx(-1),
|
|
4807
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
4808
|
+
onClick: () => selectOption(opt)
|
|
4809
|
+
},
|
|
4810
|
+
/* @__PURE__ */ import_react23.default.createElement("span", { className: "rf-select__option-label" }, opt.label),
|
|
4811
|
+
/* @__PURE__ */ import_react23.default.createElement("span", { className: "rf-select__option-check", "aria-hidden": "true" }, /* @__PURE__ */ import_react23.default.createElement(CheckIcon2, null))
|
|
4812
|
+
);
|
|
4813
|
+
}))),
|
|
4814
|
+
document.body
|
|
4815
|
+
)
|
|
4767
4816
|
);
|
|
4768
4817
|
});
|
|
4769
4818
|
Select.displayName = "Select";
|
|
@@ -5921,7 +5970,7 @@ Skeleton.displayName = "Skeleton";
|
|
|
5921
5970
|
|
|
5922
5971
|
// lib/Tooltip/Tooltip.tsx
|
|
5923
5972
|
var import_react35 = __toESM(require("react"), 1);
|
|
5924
|
-
var
|
|
5973
|
+
var import_react_dom5 = __toESM(require("react-dom"), 1);
|
|
5925
5974
|
var GAP = 8;
|
|
5926
5975
|
function computePosition(anchor, tooltip, placement) {
|
|
5927
5976
|
const { top: aTop, left: aLeft, width: aW, height: aH } = anchor;
|
|
@@ -6140,7 +6189,7 @@ var Tooltip = ({
|
|
|
6140
6189
|
...childProps
|
|
6141
6190
|
},
|
|
6142
6191
|
import_react35.default.cloneElement(children)
|
|
6143
|
-
),
|
|
6192
|
+
), import_react_dom5.default.createPortal(tooltipElement, document.body));
|
|
6144
6193
|
};
|
|
6145
6194
|
Tooltip.displayName = "Tooltip";
|
|
6146
6195
|
|
|
@@ -7027,7 +7076,7 @@ Stepper.displayName = "Stepper";
|
|
|
7027
7076
|
|
|
7028
7077
|
// lib/Menu/Menu.tsx
|
|
7029
7078
|
var import_react40 = __toESM(require("react"), 1);
|
|
7030
|
-
var
|
|
7079
|
+
var import_react_dom6 = __toESM(require("react-dom"), 1);
|
|
7031
7080
|
var MenuDivider = () => /* @__PURE__ */ import_react40.default.createElement("hr", { className: "rf-menu-divider", "aria-hidden": "true" });
|
|
7032
7081
|
MenuDivider.displayName = "MenuDivider";
|
|
7033
7082
|
var MenuItem = ({
|
|
@@ -7180,13 +7229,13 @@ var Menu = ({
|
|
|
7180
7229
|
},
|
|
7181
7230
|
children
|
|
7182
7231
|
));
|
|
7183
|
-
return
|
|
7232
|
+
return import_react_dom6.default.createPortal(portal, document.body);
|
|
7184
7233
|
};
|
|
7185
7234
|
Menu.displayName = "Menu";
|
|
7186
7235
|
|
|
7187
7236
|
// lib/Drawer/Drawer.tsx
|
|
7188
7237
|
var import_react41 = __toESM(require("react"), 1);
|
|
7189
|
-
var
|
|
7238
|
+
var import_react_dom7 = __toESM(require("react-dom"), 1);
|
|
7190
7239
|
var Drawer = ({
|
|
7191
7240
|
open,
|
|
7192
7241
|
onClose,
|
|
@@ -7286,7 +7335,7 @@ var Drawer = ({
|
|
|
7286
7335
|
},
|
|
7287
7336
|
children
|
|
7288
7337
|
));
|
|
7289
|
-
return
|
|
7338
|
+
return import_react_dom7.default.createPortal(
|
|
7290
7339
|
/* @__PURE__ */ import_react41.default.createElement("div", { className: rootClasses, style }, drawerContent),
|
|
7291
7340
|
document.body
|
|
7292
7341
|
);
|
|
@@ -7295,7 +7344,7 @@ Drawer.displayName = "Drawer";
|
|
|
7295
7344
|
|
|
7296
7345
|
// lib/Snackbar/Snackbar.tsx
|
|
7297
7346
|
var import_react42 = __toESM(require("react"), 1);
|
|
7298
|
-
var
|
|
7347
|
+
var import_react_dom8 = __toESM(require("react-dom"), 1);
|
|
7299
7348
|
var SEVERITY_ICONS = {
|
|
7300
7349
|
success: "\u2713",
|
|
7301
7350
|
error: "\u2715",
|
|
@@ -7400,7 +7449,7 @@ var Snackbar = ({
|
|
|
7400
7449
|
"\u2715"
|
|
7401
7450
|
)
|
|
7402
7451
|
));
|
|
7403
|
-
return
|
|
7452
|
+
return import_react_dom8.default.createPortal(snackbarEl, document.body);
|
|
7404
7453
|
};
|
|
7405
7454
|
Snackbar.displayName = "Snackbar";
|
|
7406
7455
|
|
|
@@ -7454,7 +7503,7 @@ Link.displayName = "Link";
|
|
|
7454
7503
|
|
|
7455
7504
|
// lib/Popper/Popper.tsx
|
|
7456
7505
|
var import_react44 = __toESM(require("react"), 1);
|
|
7457
|
-
var
|
|
7506
|
+
var import_react_dom9 = __toESM(require("react-dom"), 1);
|
|
7458
7507
|
function computePopperPosition(anchorRect, popperRect, placement, offset2 = [0, 8]) {
|
|
7459
7508
|
const [skid, dist] = offset2;
|
|
7460
7509
|
let top = 0;
|
|
@@ -7597,13 +7646,13 @@ var Popper = ({
|
|
|
7597
7646
|
if (disablePortal) {
|
|
7598
7647
|
return /* @__PURE__ */ import_react44.default.createElement(import_react44.default.Fragment, null, popper);
|
|
7599
7648
|
}
|
|
7600
|
-
return
|
|
7649
|
+
return import_react_dom9.default.createPortal(popper, document.body);
|
|
7601
7650
|
};
|
|
7602
7651
|
Popper.displayName = "Popper";
|
|
7603
7652
|
|
|
7604
7653
|
// lib/Popover/Popover.tsx
|
|
7605
7654
|
var import_react45 = __toESM(require("react"), 1);
|
|
7606
|
-
var
|
|
7655
|
+
var import_react_dom10 = __toESM(require("react-dom"), 1);
|
|
7607
7656
|
function getPoint(rect, v, h) {
|
|
7608
7657
|
const x = h === "left" ? rect.left : h === "center" ? rect.left + rect.width / 2 : rect.right;
|
|
7609
7658
|
const y = v === "top" ? rect.top : v === "center" ? rect.top + rect.height / 2 : rect.bottom;
|
|
@@ -7706,7 +7755,7 @@ var Popover = ({
|
|
|
7706
7755
|
if (disablePortal) {
|
|
7707
7756
|
return /* @__PURE__ */ import_react45.default.createElement("div", { className: `${rootClasses} rf-popover-inline`, style }, content);
|
|
7708
7757
|
}
|
|
7709
|
-
return
|
|
7758
|
+
return import_react_dom10.default.createPortal(
|
|
7710
7759
|
/* @__PURE__ */ import_react45.default.createElement("div", { className: rootClasses, style }, content),
|
|
7711
7760
|
document.body
|
|
7712
7761
|
);
|
|
@@ -8357,7 +8406,7 @@ PhoneField.displayName = "PhoneField";
|
|
|
8357
8406
|
|
|
8358
8407
|
// lib/RufousTextEditor/RufousTextEditor.tsx
|
|
8359
8408
|
var import_react59 = __toESM(require("react"), 1);
|
|
8360
|
-
var
|
|
8409
|
+
var import_react_dom17 = require("react-dom");
|
|
8361
8410
|
var import_react60 = require("@tiptap/react");
|
|
8362
8411
|
var import_starter_kit = __toESM(require("@tiptap/starter-kit"), 1);
|
|
8363
8412
|
var import_extension_placeholder = __toESM(require("@tiptap/extension-placeholder"), 1);
|
|
@@ -8479,7 +8528,7 @@ function createMentionSuggestion(users) {
|
|
|
8479
8528
|
|
|
8480
8529
|
// lib/RufousTextEditor/Toolbar.tsx
|
|
8481
8530
|
var import_react55 = __toESM(require("react"), 1);
|
|
8482
|
-
var
|
|
8531
|
+
var import_react_dom13 = require("react-dom");
|
|
8483
8532
|
|
|
8484
8533
|
// lib/RufousTextEditor/TextToSpeech.tsx
|
|
8485
8534
|
var import_react51 = __toESM(require("react"), 1);
|
|
@@ -8792,7 +8841,7 @@ var SpeechToText_default = SpeechToText;
|
|
|
8792
8841
|
|
|
8793
8842
|
// lib/RufousTextEditor/AICommands.tsx
|
|
8794
8843
|
var import_react53 = __toESM(require("react"), 1);
|
|
8795
|
-
var
|
|
8844
|
+
var import_react_dom11 = require("react-dom");
|
|
8796
8845
|
var AI_COMMANDS = [
|
|
8797
8846
|
{ id: "improve", label: "Improve writing", prompt: "Improve the following text to make it clearer, more engaging, and well-structured. Return only the improved text, no explanations." },
|
|
8798
8847
|
{ id: "shorter", label: "Make shorter", prompt: "Make the following text shorter and more concise while keeping the key points. Return only the shortened text, no explanations." },
|
|
@@ -8949,7 +8998,7 @@ var AICommands = ({ editor, onAICommand }) => {
|
|
|
8949
8998
|
onClick: () => handleCommandSelect(cmd)
|
|
8950
8999
|
},
|
|
8951
9000
|
cmd.label
|
|
8952
|
-
))), /* @__PURE__ */ import_react53.default.createElement("div", { className: "ai-commands-hint" }, editor.state.selection.empty ? "Will apply to all text" : "Will apply to selected text"))), showModal && (0,
|
|
9001
|
+
))), /* @__PURE__ */ import_react53.default.createElement("div", { className: "ai-commands-hint" }, editor.state.selection.empty ? "Will apply to all text" : "Will apply to selected text"))), showModal && (0, import_react_dom11.createPortal)(
|
|
8953
9002
|
/* @__PURE__ */ import_react53.default.createElement("div", { className: "ai-modal-overlay", onMouseDown: handleCancel }, /* @__PURE__ */ import_react53.default.createElement("div", { className: "ai-modal", onMouseDown: (e) => e.stopPropagation() }, /* @__PURE__ */ import_react53.default.createElement("div", { className: "ai-modal-header" }, /* @__PURE__ */ import_react53.default.createElement("span", { className: "ai-modal-title" }, "AI Assistant"), /* @__PURE__ */ import_react53.default.createElement("button", { className: "ai-modal-close", onClick: handleCancel }, "\xD7")), /* @__PURE__ */ import_react53.default.createElement("div", { className: "ai-modal-prompt-section" }, /* @__PURE__ */ import_react53.default.createElement("label", { className: "ai-modal-label" }, "Prompt"), /* @__PURE__ */ import_react53.default.createElement("div", { className: "ai-modal-prompt-row" }, /* @__PURE__ */ import_react53.default.createElement(
|
|
8954
9003
|
"textarea",
|
|
8955
9004
|
{
|
|
@@ -9000,7 +9049,7 @@ var AICommands_default = AICommands;
|
|
|
9000
9049
|
|
|
9001
9050
|
// lib/RufousTextEditor/TranslateModal.tsx
|
|
9002
9051
|
var import_react54 = __toESM(require("react"), 1);
|
|
9003
|
-
var
|
|
9052
|
+
var import_react_dom12 = require("react-dom");
|
|
9004
9053
|
var LANGUAGES = [
|
|
9005
9054
|
{ code: "af", name: "Afrikaans" },
|
|
9006
9055
|
{ code: "sq", name: "Albanian" },
|
|
@@ -9191,7 +9240,7 @@ var TranslateModal = ({ editor, onClose, onTranslate, initialSource, initialTarg
|
|
|
9191
9240
|
setTranslating(false);
|
|
9192
9241
|
}
|
|
9193
9242
|
};
|
|
9194
|
-
return (0,
|
|
9243
|
+
return (0, import_react_dom12.createPortal)(
|
|
9195
9244
|
/* @__PURE__ */ import_react54.default.createElement("div", { className: "modal-overlay", onClick: onClose }, /* @__PURE__ */ import_react54.default.createElement("div", { className: "modal-content translate-modal", onClick: (e) => e.stopPropagation() }, /* @__PURE__ */ import_react54.default.createElement("div", { className: "modal-header" }, /* @__PURE__ */ import_react54.default.createElement("h3", null, "Translate options"), /* @__PURE__ */ import_react54.default.createElement("button", { className: "modal-close", onClick: onClose }, "\xD7")), /* @__PURE__ */ import_react54.default.createElement("div", { className: "modal-body" }, /* @__PURE__ */ import_react54.default.createElement("div", { className: "translate-columns" }, /* @__PURE__ */ import_react54.default.createElement("div", { className: "translate-col" }, /* @__PURE__ */ import_react54.default.createElement("div", { className: "translate-filter" }, /* @__PURE__ */ import_react54.default.createElement(
|
|
9196
9245
|
"input",
|
|
9197
9246
|
{
|
|
@@ -10101,7 +10150,7 @@ var Dropdown = ({ trigger, children, className = "", keepOpen = false }) => {
|
|
|
10101
10150
|
},
|
|
10102
10151
|
trigger.label,
|
|
10103
10152
|
/* @__PURE__ */ import_react55.default.createElement("span", { className: "dropdown-arrow" }, "\u25BE")
|
|
10104
|
-
), open && (0,
|
|
10153
|
+
), open && (0, import_react_dom13.createPortal)(
|
|
10105
10154
|
/* @__PURE__ */ import_react55.default.createElement("div", { className: "rf-rte-wrapper rf-rte-dropdown-portal" }, /* @__PURE__ */ import_react55.default.createElement("div", { ref: menuRef, className: "dropdown-menu dropdown-menu-fixed", onClick: keepOpen ? void 0 : () => setOpen(false) }, typeof children === "function" ? children(() => setOpen(false)) : children)),
|
|
10106
10155
|
document.body
|
|
10107
10156
|
));
|
|
@@ -11004,7 +11053,7 @@ var Toolbar_default = Toolbar;
|
|
|
11004
11053
|
|
|
11005
11054
|
// lib/RufousTextEditor/ImageToolbar.tsx
|
|
11006
11055
|
var import_react56 = __toESM(require("react"), 1);
|
|
11007
|
-
var
|
|
11056
|
+
var import_react_dom14 = require("react-dom");
|
|
11008
11057
|
var ALIGNMENTS = [
|
|
11009
11058
|
{ value: "left", label: "Left", icon: "\u2630" },
|
|
11010
11059
|
{ value: "center", label: "Center", icon: "\u2261" },
|
|
@@ -11176,7 +11225,7 @@ var ImageToolbar = ({ editor }) => {
|
|
|
11176
11225
|
}, [editor]);
|
|
11177
11226
|
const node = editor?.state.selection.node;
|
|
11178
11227
|
const isImage = node && node.type.name === "image";
|
|
11179
|
-
if (!editor || !isImage || !pos) return showModal ? (0,
|
|
11228
|
+
if (!editor || !isImage || !pos) return showModal ? (0, import_react_dom14.createPortal)(
|
|
11180
11229
|
/* @__PURE__ */ import_react56.default.createElement(ImagePropertiesModal, { editor, node, onClose: () => setShowModal(false) }),
|
|
11181
11230
|
document.body
|
|
11182
11231
|
) : null;
|
|
@@ -11253,7 +11302,7 @@ var ImageToolbar = ({ editor }) => {
|
|
|
11253
11302
|
);
|
|
11254
11303
|
setShowVAlign(false);
|
|
11255
11304
|
};
|
|
11256
|
-
return (0,
|
|
11305
|
+
return (0, import_react_dom14.createPortal)(
|
|
11257
11306
|
/* @__PURE__ */ import_react56.default.createElement(import_react56.default.Fragment, null, /* @__PURE__ */ import_react56.default.createElement(
|
|
11258
11307
|
"div",
|
|
11259
11308
|
{
|
|
@@ -11284,7 +11333,7 @@ var ImageToolbar_default = ImageToolbar;
|
|
|
11284
11333
|
|
|
11285
11334
|
// lib/RufousTextEditor/VideoToolbar.tsx
|
|
11286
11335
|
var import_react57 = __toESM(require("react"), 1);
|
|
11287
|
-
var
|
|
11336
|
+
var import_react_dom15 = require("react-dom");
|
|
11288
11337
|
var ALIGNMENTS2 = [
|
|
11289
11338
|
{ value: "left", label: "Left", icon: "\u2630" },
|
|
11290
11339
|
{ value: "center", label: "Center", icon: "\u2261" },
|
|
@@ -11430,7 +11479,7 @@ var VideoToolbar = ({ editor }) => {
|
|
|
11430
11479
|
const node = editor?.state.selection.node;
|
|
11431
11480
|
const isVideo = node && VIDEO_TYPES.includes(node.type.name);
|
|
11432
11481
|
const nodeType = node?.type.name;
|
|
11433
|
-
if (!editor || !isVideo || !pos) return showModal ? (0,
|
|
11482
|
+
if (!editor || !isVideo || !pos) return showModal ? (0, import_react_dom15.createPortal)(
|
|
11434
11483
|
/* @__PURE__ */ import_react57.default.createElement(VideoPropertiesModal, { editor, node, nodeType, onClose: () => setShowModal(false) }),
|
|
11435
11484
|
document.body
|
|
11436
11485
|
) : null;
|
|
@@ -11477,7 +11526,7 @@ var VideoToolbar = ({ editor }) => {
|
|
|
11477
11526
|
})
|
|
11478
11527
|
);
|
|
11479
11528
|
};
|
|
11480
|
-
return (0,
|
|
11529
|
+
return (0, import_react_dom15.createPortal)(
|
|
11481
11530
|
/* @__PURE__ */ import_react57.default.createElement(import_react57.default.Fragment, null, /* @__PURE__ */ import_react57.default.createElement(
|
|
11482
11531
|
"div",
|
|
11483
11532
|
{
|
|
@@ -11525,7 +11574,7 @@ var VideoToolbar_default = VideoToolbar;
|
|
|
11525
11574
|
|
|
11526
11575
|
// lib/RufousTextEditor/TableToolbar.tsx
|
|
11527
11576
|
var import_react58 = __toESM(require("react"), 1);
|
|
11528
|
-
var
|
|
11577
|
+
var import_react_dom16 = require("react-dom");
|
|
11529
11578
|
var IconAddRowBefore = () => /* @__PURE__ */ import_react58.default.createElement("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "currentColor" }, /* @__PURE__ */ import_react58.default.createElement("path", { d: "M20 3H4c-.55 0-1 .45-1 1v16c0 .55.45 1 1 1h16c.55 0 1-.45 1-1V4c0-.55-.45-1-1-1zm-1 8H5V5h14v6zm0 8H5v-6h14v6z" }), /* @__PURE__ */ import_react58.default.createElement("path", { d: "M9 6h2v1.5h1.5v2H11V11H9V9.5H7.5v-2H9z" }));
|
|
11530
11579
|
var IconAddRowAfter = () => /* @__PURE__ */ import_react58.default.createElement("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "currentColor" }, /* @__PURE__ */ import_react58.default.createElement("path", { d: "M20 3H4c-.55 0-1 .45-1 1v16c0 .55.45 1 1 1h16c.55 0 1-.45 1-1V4c0-.55-.45-1-1-1zm-1 8H5V5h14v6zm0 8H5v-6h14v6z" }), /* @__PURE__ */ import_react58.default.createElement("path", { d: "M9 14h2v1.5h1.5v2H11V19H9v-1.5H7.5v-2H9z" }));
|
|
11531
11580
|
var IconAddColBefore = () => /* @__PURE__ */ import_react58.default.createElement("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "currentColor" }, /* @__PURE__ */ import_react58.default.createElement("path", { d: "M20 3H4c-.55 0-1 .45-1 1v16c0 .55.45 1 1 1h16c.55 0 1-.45 1-1V4c0-.55-.45-1-1-1zm-9 16H5V5h6v14zm8 0h-6V5h6v14z" }), /* @__PURE__ */ import_react58.default.createElement("path", { d: "M6 10h1.5v2H6v1.5H4v-2h1.5V10H4V8h2z", transform: "translate(2,1)" }));
|
|
@@ -11582,7 +11631,7 @@ var TableToolbar = ({ editor }) => {
|
|
|
11582
11631
|
const canMerge = editor.can().mergeCells();
|
|
11583
11632
|
const canSplit = editor.can().splitCell();
|
|
11584
11633
|
const prevent = (e) => e.preventDefault();
|
|
11585
|
-
return (0,
|
|
11634
|
+
return (0, import_react_dom16.createPortal)(
|
|
11586
11635
|
/* @__PURE__ */ import_react58.default.createElement(
|
|
11587
11636
|
"div",
|
|
11588
11637
|
{
|
|
@@ -12271,7 +12320,7 @@ var RufousTextEditor = ({
|
|
|
12271
12320
|
},
|
|
12272
12321
|
"\u201C Quote"
|
|
12273
12322
|
)
|
|
12274
|
-
), /* @__PURE__ */ import_react59.default.createElement("div", { className: "status-bar" }, /* @__PURE__ */ import_react59.default.createElement("div", { className: "status-bar-left" }, onSaveProp && /* @__PURE__ */ import_react59.default.createElement("button", { onClick: handleSave, className: "status-btn save-btn" }, "Save"), onExportProp && /* @__PURE__ */ import_react59.default.createElement("button", { onClick: handleExport, className: "status-btn export-btn" }, "Export")), /* @__PURE__ */ import_react59.default.createElement("div", { className: "status-bar-right" }, saveStatus && /* @__PURE__ */ import_react59.default.createElement("span", { className: "save-status" }, saveStatus), editor && /* @__PURE__ */ import_react59.default.createElement(import_react59.default.Fragment, null, /* @__PURE__ */ import_react59.default.createElement("span", { className: "word-count" }, "CHARS: ", editor.storage.characterCount?.characters?.() ?? editor.getText().length), /* @__PURE__ */ import_react59.default.createElement("span", { className: "word-count" }, "WORDS: ", editor.storage.characterCount?.words?.() ?? editor.getText().split(/\s+/).filter(Boolean).length)))), linkModalOpen && (0,
|
|
12323
|
+
), /* @__PURE__ */ import_react59.default.createElement("div", { className: "status-bar" }, /* @__PURE__ */ import_react59.default.createElement("div", { className: "status-bar-left" }, onSaveProp && /* @__PURE__ */ import_react59.default.createElement("button", { onClick: handleSave, className: "status-btn save-btn" }, "Save"), onExportProp && /* @__PURE__ */ import_react59.default.createElement("button", { onClick: handleExport, className: "status-btn export-btn" }, "Export")), /* @__PURE__ */ import_react59.default.createElement("div", { className: "status-bar-right" }, saveStatus && /* @__PURE__ */ import_react59.default.createElement("span", { className: "save-status" }, saveStatus), editor && /* @__PURE__ */ import_react59.default.createElement(import_react59.default.Fragment, null, /* @__PURE__ */ import_react59.default.createElement("span", { className: "word-count" }, "CHARS: ", editor.storage.characterCount?.characters?.() ?? editor.getText().length), /* @__PURE__ */ import_react59.default.createElement("span", { className: "word-count" }, "WORDS: ", editor.storage.characterCount?.words?.() ?? editor.getText().split(/\s+/).filter(Boolean).length)))), linkModalOpen && (0, import_react_dom17.createPortal)(
|
|
12275
12324
|
/* @__PURE__ */ import_react59.default.createElement("div", { className: "link-modal-overlay", onClick: handleLinkCancel }, /* @__PURE__ */ import_react59.default.createElement("div", { className: "link-modal", onClick: (e) => e.stopPropagation() }, /* @__PURE__ */ import_react59.default.createElement("div", { className: "link-modal-body" }, /* @__PURE__ */ import_react59.default.createElement("div", { className: "link-modal-field" }, /* @__PURE__ */ import_react59.default.createElement("label", { className: "link-modal-label" }, "URL"), /* @__PURE__ */ import_react59.default.createElement(
|
|
12276
12325
|
"input",
|
|
12277
12326
|
{
|
|
@@ -12316,7 +12365,7 @@ var RufousTextEditor = ({
|
|
|
12316
12365
|
)),
|
|
12317
12366
|
helperText && /* @__PURE__ */ import_react59.default.createElement("div", { className: `rf-rte-helper-text ${error ? "rf-rte-helper-error" : ""}` }, helperText)
|
|
12318
12367
|
);
|
|
12319
|
-
return isFullscreen ? (0,
|
|
12368
|
+
return isFullscreen ? (0, import_react_dom17.createPortal)(wrapperJsx, document.body) : wrapperJsx;
|
|
12320
12369
|
};
|
|
12321
12370
|
var RufousTextContent = ({ content, className, style, sx }) => {
|
|
12322
12371
|
const sxClass = useSx(sx);
|
package/dist/main.css
CHANGED
|
@@ -75,6 +75,13 @@
|
|
|
75
75
|
z-index: 2000;
|
|
76
76
|
backdrop-filter: blur(2px);
|
|
77
77
|
}
|
|
78
|
+
.MuiPopover-root,
|
|
79
|
+
.MuiMenu-root,
|
|
80
|
+
.MuiAutocomplete-popper,
|
|
81
|
+
.MuiTooltip-popper,
|
|
82
|
+
.MuiModal-root:not(.dialog-overlay) {
|
|
83
|
+
z-index: 2100 !important;
|
|
84
|
+
}
|
|
78
85
|
.dialog-container {
|
|
79
86
|
background: var(--surface-color);
|
|
80
87
|
color: var(--text-color);
|
|
@@ -2235,12 +2242,9 @@ pre {
|
|
|
2235
2242
|
flex-shrink: 0;
|
|
2236
2243
|
}
|
|
2237
2244
|
.rf-autocomplete__popup {
|
|
2238
|
-
position:
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
right: 0;
|
|
2242
|
-
z-index: 1400;
|
|
2243
|
-
background: #ffffff;
|
|
2245
|
+
position: fixed;
|
|
2246
|
+
z-index: 2100;
|
|
2247
|
+
background: var(--surface-color, #ffffff);
|
|
2244
2248
|
border-radius: 8px;
|
|
2245
2249
|
box-shadow:
|
|
2246
2250
|
0 4px 6px rgba(0, 0, 0, 0.06),
|
|
@@ -2489,11 +2493,8 @@ pre {
|
|
|
2489
2493
|
margin-top: 17px;
|
|
2490
2494
|
}
|
|
2491
2495
|
.rf-select__popup {
|
|
2492
|
-
position:
|
|
2493
|
-
|
|
2494
|
-
left: 0;
|
|
2495
|
-
right: 0;
|
|
2496
|
-
z-index: 1400;
|
|
2496
|
+
position: fixed;
|
|
2497
|
+
z-index: 2100;
|
|
2497
2498
|
background: var(--surface-color, #ffffff);
|
|
2498
2499
|
border-radius: 8px;
|
|
2499
2500
|
box-shadow:
|
package/dist/main.js
CHANGED
|
@@ -1354,6 +1354,7 @@ IconButton.displayName = "IconButton";
|
|
|
1354
1354
|
// lib/Dialogs/BaseDialog.tsx
|
|
1355
1355
|
import * as React65 from "react";
|
|
1356
1356
|
import { useState as useState2 } from "react";
|
|
1357
|
+
import ReactDOM from "react-dom";
|
|
1357
1358
|
import { X } from "lucide-react";
|
|
1358
1359
|
var BaseDialog = ({
|
|
1359
1360
|
open = false,
|
|
@@ -1457,20 +1458,26 @@ var BaseDialog = ({
|
|
|
1457
1458
|
dialogInner
|
|
1458
1459
|
) : /* @__PURE__ */ React65.createElement("div", { className: containerClass, style: containerStyle }, dialogInner);
|
|
1459
1460
|
if (TransitionComponent) {
|
|
1460
|
-
return
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1461
|
+
return ReactDOM.createPortal(
|
|
1462
|
+
/* @__PURE__ */ React65.createElement(
|
|
1463
|
+
TransitionComponent,
|
|
1464
|
+
{
|
|
1465
|
+
in: open,
|
|
1466
|
+
unmountOnExit: true,
|
|
1467
|
+
...TransitionProps,
|
|
1468
|
+
onExited: () => {
|
|
1469
|
+
TransitionProps?.onExited?.();
|
|
1470
|
+
}
|
|
1471
|
+
},
|
|
1472
|
+
/* @__PURE__ */ React65.createElement("div", { className: `dialog-overlay ${size === "fullScreen" ? "overlay-fullscreen" : ""}` }, dialogContent)
|
|
1473
|
+
),
|
|
1474
|
+
document.body
|
|
1471
1475
|
);
|
|
1472
1476
|
}
|
|
1473
|
-
return
|
|
1477
|
+
return ReactDOM.createPortal(
|
|
1478
|
+
/* @__PURE__ */ React65.createElement("div", { className: `dialog-overlay ${size === "fullScreen" ? "overlay-fullscreen" : ""}` }, dialogContent),
|
|
1479
|
+
document.body
|
|
1480
|
+
);
|
|
1474
1481
|
};
|
|
1475
1482
|
var BaseDialog_default = BaseDialog;
|
|
1476
1483
|
|
|
@@ -3388,6 +3395,7 @@ import React72, {
|
|
|
3388
3395
|
useEffect as useEffect6,
|
|
3389
3396
|
useCallback as useCallback2
|
|
3390
3397
|
} from "react";
|
|
3398
|
+
import ReactDOM2 from "react-dom";
|
|
3391
3399
|
var ChevronDownIcon = () => /* @__PURE__ */ React72.createElement("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React72.createElement("polyline", { points: "6 9 12 15 18 9" }));
|
|
3392
3400
|
var CloseSmIcon = ({ size = 16 }) => /* @__PURE__ */ React72.createElement("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round" }, /* @__PURE__ */ React72.createElement("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), /* @__PURE__ */ React72.createElement("line", { x1: "6", y1: "6", x2: "18", y2: "18" }));
|
|
3393
3401
|
var CheckIcon = () => /* @__PURE__ */ React72.createElement("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React72.createElement("polyline", { points: "20 6 9 17 4 12" }));
|
|
@@ -3441,11 +3449,21 @@ function AutocompleteInner(props, _ref) {
|
|
|
3441
3449
|
const [open, setOpen] = useState7(false);
|
|
3442
3450
|
const [inputStr, setInputStr] = useState7("");
|
|
3443
3451
|
const [focusedIdx, setFocusedIdx] = useState7(-1);
|
|
3452
|
+
const [popupStyle, setPopupStyle] = useState7({});
|
|
3444
3453
|
const containerRef = useRef6(null);
|
|
3445
3454
|
const inputRef = useRef6(null);
|
|
3446
3455
|
const listRef = useRef6(null);
|
|
3447
3456
|
const inputId = useRef6(`rf-ac-${Math.random().toString(36).slice(2, 9)}`).current;
|
|
3448
3457
|
const sxClass = useSx(sx);
|
|
3458
|
+
const calcPopupStyle = useCallback2(() => {
|
|
3459
|
+
if (!containerRef.current) return;
|
|
3460
|
+
const rect = containerRef.current.getBoundingClientRect();
|
|
3461
|
+
setPopupStyle({
|
|
3462
|
+
top: rect.bottom + 4,
|
|
3463
|
+
left: rect.left,
|
|
3464
|
+
width: rect.width
|
|
3465
|
+
});
|
|
3466
|
+
}, []);
|
|
3449
3467
|
const activeInput = controlledInput !== void 0 ? controlledInput : inputStr;
|
|
3450
3468
|
const selectedValues = multiple ? Array.isArray(value) ? value : [] : value != null ? [value] : [];
|
|
3451
3469
|
const isEqual = useCallback2(
|
|
@@ -3479,12 +3497,13 @@ function AutocompleteInner(props, _ref) {
|
|
|
3479
3497
|
filtered.forEach((opt, i) => flatEntries.push({ kind: "option", option: opt, flatIdx: i }));
|
|
3480
3498
|
}
|
|
3481
3499
|
const selectableOptions = flatEntries.filter((e) => e.kind === "option");
|
|
3482
|
-
const openPopup = () => {
|
|
3500
|
+
const openPopup = useCallback2(() => {
|
|
3483
3501
|
if (disabled) return;
|
|
3502
|
+
calcPopupStyle();
|
|
3484
3503
|
setOpen(true);
|
|
3485
3504
|
setFocusedIdx(-1);
|
|
3486
3505
|
onOpen?.();
|
|
3487
|
-
};
|
|
3506
|
+
}, [disabled, calcPopupStyle, onOpen]);
|
|
3488
3507
|
const closePopup = useCallback2(() => {
|
|
3489
3508
|
setOpen(false);
|
|
3490
3509
|
setFocusedIdx(-1);
|
|
@@ -3496,14 +3515,20 @@ function AutocompleteInner(props, _ref) {
|
|
|
3496
3515
|
}, [freeSolo, multiple, value, onInputChange, onClose]);
|
|
3497
3516
|
useEffect6(() => {
|
|
3498
3517
|
if (!open) return;
|
|
3499
|
-
const
|
|
3518
|
+
const handleOutside = (e) => {
|
|
3500
3519
|
if (containerRef.current && !containerRef.current.contains(e.target)) {
|
|
3501
3520
|
closePopup();
|
|
3502
3521
|
}
|
|
3503
3522
|
};
|
|
3504
|
-
document.addEventListener("mousedown",
|
|
3505
|
-
|
|
3506
|
-
|
|
3523
|
+
document.addEventListener("mousedown", handleOutside);
|
|
3524
|
+
window.addEventListener("scroll", calcPopupStyle, true);
|
|
3525
|
+
window.addEventListener("resize", calcPopupStyle);
|
|
3526
|
+
return () => {
|
|
3527
|
+
document.removeEventListener("mousedown", handleOutside);
|
|
3528
|
+
window.removeEventListener("scroll", calcPopupStyle, true);
|
|
3529
|
+
window.removeEventListener("resize", calcPopupStyle);
|
|
3530
|
+
};
|
|
3531
|
+
}, [open, closePopup, calcPopupStyle]);
|
|
3507
3532
|
useEffect6(() => {
|
|
3508
3533
|
if (controlledInput !== void 0) return;
|
|
3509
3534
|
if (!multiple) {
|
|
@@ -3688,34 +3713,37 @@ function AutocompleteInner(props, _ref) {
|
|
|
3688
3713
|
},
|
|
3689
3714
|
/* @__PURE__ */ React72.createElement(ChevronDownIcon, null)
|
|
3690
3715
|
))
|
|
3691
|
-
), helperText && /* @__PURE__ */ React72.createElement("div", { className: `rf-text-field__helper-text${error ? " rf-text-field__helper-text--error" : ""}` }, helperText), open && !disabled &&
|
|
3692
|
-
|
|
3693
|
-
|
|
3694
|
-
|
|
3695
|
-
|
|
3696
|
-
|
|
3697
|
-
|
|
3698
|
-
|
|
3699
|
-
if (
|
|
3716
|
+
), helperText && /* @__PURE__ */ React72.createElement("div", { className: `rf-text-field__helper-text${error ? " rf-text-field__helper-text--error" : ""}` }, helperText), open && !disabled && ReactDOM2.createPortal(
|
|
3717
|
+
/* @__PURE__ */ React72.createElement("div", { className: "rf-autocomplete__popup", role: "presentation", style: popupStyle }, loading ? /* @__PURE__ */ React72.createElement("div", { className: "rf-autocomplete__loading" }, /* @__PURE__ */ React72.createElement("span", { className: "rf-ac-spinner" }), loadingText) : flatEntries.length === 0 ? /* @__PURE__ */ React72.createElement("div", { className: "rf-autocomplete__no-options" }, noOptionsText) : /* @__PURE__ */ React72.createElement("ul", { ref: listRef, className: "rf-autocomplete__listbox", role: "listbox" }, groupBy ? (
|
|
3718
|
+
// Grouped render
|
|
3719
|
+
(() => {
|
|
3720
|
+
const rendered = [];
|
|
3721
|
+
let groupItems = [];
|
|
3722
|
+
let currentGroup = "";
|
|
3723
|
+
flatEntries.forEach((entry, ei) => {
|
|
3724
|
+
if (entry.kind === "group") {
|
|
3725
|
+
if (groupItems.length > 0) {
|
|
3726
|
+
rendered.push(
|
|
3727
|
+
/* @__PURE__ */ React72.createElement("li", { key: `g-${currentGroup}`, role: "presentation" }, /* @__PURE__ */ React72.createElement("div", { className: "rf-autocomplete__group-header" }, currentGroup), /* @__PURE__ */ React72.createElement("ul", { className: "rf-autocomplete__group-items", role: "group" }, groupItems))
|
|
3728
|
+
);
|
|
3729
|
+
groupItems = [];
|
|
3730
|
+
}
|
|
3731
|
+
currentGroup = entry.label;
|
|
3732
|
+
} else {
|
|
3733
|
+
const { option, flatIdx } = entry;
|
|
3734
|
+
groupItems.push(renderOptionItem(option, flatIdx));
|
|
3735
|
+
}
|
|
3736
|
+
if (ei === flatEntries.length - 1 && groupItems.length > 0) {
|
|
3700
3737
|
rendered.push(
|
|
3701
3738
|
/* @__PURE__ */ React72.createElement("li", { key: `g-${currentGroup}`, role: "presentation" }, /* @__PURE__ */ React72.createElement("div", { className: "rf-autocomplete__group-header" }, currentGroup), /* @__PURE__ */ React72.createElement("ul", { className: "rf-autocomplete__group-items", role: "group" }, groupItems))
|
|
3702
3739
|
);
|
|
3703
|
-
groupItems = [];
|
|
3704
3740
|
}
|
|
3705
|
-
|
|
3706
|
-
|
|
3707
|
-
|
|
3708
|
-
|
|
3709
|
-
|
|
3710
|
-
|
|
3711
|
-
rendered.push(
|
|
3712
|
-
/* @__PURE__ */ React72.createElement("li", { key: `g-${currentGroup}`, role: "presentation" }, /* @__PURE__ */ React72.createElement("div", { className: "rf-autocomplete__group-header" }, currentGroup), /* @__PURE__ */ React72.createElement("ul", { className: "rf-autocomplete__group-items", role: "group" }, groupItems))
|
|
3713
|
-
);
|
|
3714
|
-
}
|
|
3715
|
-
});
|
|
3716
|
-
return rendered;
|
|
3717
|
-
})()
|
|
3718
|
-
) : selectableOptions.map(({ option, flatIdx }) => renderOptionItem(option, flatIdx)))));
|
|
3741
|
+
});
|
|
3742
|
+
return rendered;
|
|
3743
|
+
})()
|
|
3744
|
+
) : selectableOptions.map(({ option, flatIdx }) => renderOptionItem(option, flatIdx)))),
|
|
3745
|
+
document.body
|
|
3746
|
+
));
|
|
3719
3747
|
function renderOptionItem(option, flatIdx) {
|
|
3720
3748
|
const selected = isSelected(option);
|
|
3721
3749
|
const focused = focusedIdx === flatIdx;
|
|
@@ -4428,6 +4456,7 @@ import React75, {
|
|
|
4428
4456
|
useEffect as useEffect8,
|
|
4429
4457
|
useCallback as useCallback3
|
|
4430
4458
|
} from "react";
|
|
4459
|
+
import ReactDOM3 from "react-dom";
|
|
4431
4460
|
var ChevronDownIcon2 = () => /* @__PURE__ */ React75.createElement("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React75.createElement("polyline", { points: "6 9 12 15 18 9" }));
|
|
4432
4461
|
var CheckIcon2 = () => /* @__PURE__ */ React75.createElement("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React75.createElement("polyline", { points: "20 6 9 17 4 12" }));
|
|
4433
4462
|
function normaliseOptions(options) {
|
|
@@ -4454,10 +4483,20 @@ var Select = React75.forwardRef(function Select2(props, ref) {
|
|
|
4454
4483
|
} = props;
|
|
4455
4484
|
const [open, setOpen] = useState9(false);
|
|
4456
4485
|
const [focusedIdx, setFocusedIdx] = useState9(-1);
|
|
4486
|
+
const [popupStyle, setPopupStyle] = useState9({});
|
|
4457
4487
|
const containerRef = useRef9(null);
|
|
4458
4488
|
const listRef = useRef9(null);
|
|
4459
4489
|
const inputId = useRef9(`rf-sel-${Math.random().toString(36).slice(2, 9)}`).current;
|
|
4460
4490
|
const sxClass = useSx(sx);
|
|
4491
|
+
const calcPopupStyle = useCallback3(() => {
|
|
4492
|
+
if (!containerRef.current) return;
|
|
4493
|
+
const rect = containerRef.current.getBoundingClientRect();
|
|
4494
|
+
setPopupStyle({
|
|
4495
|
+
top: rect.bottom + 4,
|
|
4496
|
+
left: rect.left,
|
|
4497
|
+
width: rect.width
|
|
4498
|
+
});
|
|
4499
|
+
}, []);
|
|
4461
4500
|
const options = normaliseOptions(rawOptions);
|
|
4462
4501
|
const selectedValues = multiple ? Array.isArray(value) ? value : value != null ? [value] : [] : value != null ? [value] : [];
|
|
4463
4502
|
const isSelected = useCallback3(
|
|
@@ -4469,9 +4508,10 @@ var Select = React75.forwardRef(function Select2(props, ref) {
|
|
|
4469
4508
|
const isFloating = Boolean(open || hasValue);
|
|
4470
4509
|
const openPopup = useCallback3(() => {
|
|
4471
4510
|
if (disabled) return;
|
|
4511
|
+
calcPopupStyle();
|
|
4472
4512
|
setOpen(true);
|
|
4473
4513
|
setFocusedIdx(-1);
|
|
4474
|
-
}, [disabled]);
|
|
4514
|
+
}, [disabled, calcPopupStyle]);
|
|
4475
4515
|
const closePopup = useCallback3(() => {
|
|
4476
4516
|
setOpen(false);
|
|
4477
4517
|
setFocusedIdx(-1);
|
|
@@ -4482,14 +4522,20 @@ var Select = React75.forwardRef(function Select2(props, ref) {
|
|
|
4482
4522
|
}, [open, openPopup, closePopup]);
|
|
4483
4523
|
useEffect8(() => {
|
|
4484
4524
|
if (!open) return;
|
|
4485
|
-
const
|
|
4525
|
+
const handleOutside = (e) => {
|
|
4486
4526
|
if (containerRef.current && !containerRef.current.contains(e.target)) {
|
|
4487
4527
|
closePopup();
|
|
4488
4528
|
}
|
|
4489
4529
|
};
|
|
4490
|
-
document.addEventListener("mousedown",
|
|
4491
|
-
|
|
4492
|
-
|
|
4530
|
+
document.addEventListener("mousedown", handleOutside);
|
|
4531
|
+
window.addEventListener("scroll", calcPopupStyle, true);
|
|
4532
|
+
window.addEventListener("resize", calcPopupStyle);
|
|
4533
|
+
return () => {
|
|
4534
|
+
document.removeEventListener("mousedown", handleOutside);
|
|
4535
|
+
window.removeEventListener("scroll", calcPopupStyle, true);
|
|
4536
|
+
window.removeEventListener("resize", calcPopupStyle);
|
|
4537
|
+
};
|
|
4538
|
+
}, [open, closePopup, calcPopupStyle]);
|
|
4493
4539
|
const selectOption = useCallback3((opt) => {
|
|
4494
4540
|
if (opt.disabled) return;
|
|
4495
4541
|
if (multiple) {
|
|
@@ -4608,32 +4654,35 @@ var Select = React75.forwardRef(function Select2(props, ref) {
|
|
|
4608
4654
|
/* @__PURE__ */ React75.createElement("div", { className: "rf-select__arrow", "aria-hidden": "true" }, /* @__PURE__ */ React75.createElement(ChevronDownIcon2, null))
|
|
4609
4655
|
),
|
|
4610
4656
|
helperText && /* @__PURE__ */ React75.createElement("div", { className: `rf-text-field__helper-text${error ? " rf-text-field__helper-text--error" : ""}` }, helperText),
|
|
4611
|
-
open && !disabled &&
|
|
4612
|
-
|
|
4613
|
-
|
|
4614
|
-
|
|
4615
|
-
|
|
4616
|
-
|
|
4617
|
-
|
|
4618
|
-
|
|
4619
|
-
|
|
4620
|
-
|
|
4621
|
-
|
|
4622
|
-
|
|
4623
|
-
|
|
4624
|
-
|
|
4625
|
-
|
|
4626
|
-
|
|
4627
|
-
|
|
4628
|
-
|
|
4629
|
-
|
|
4630
|
-
|
|
4631
|
-
|
|
4632
|
-
|
|
4633
|
-
|
|
4634
|
-
|
|
4635
|
-
|
|
4636
|
-
|
|
4657
|
+
open && !disabled && ReactDOM3.createPortal(
|
|
4658
|
+
/* @__PURE__ */ React75.createElement("div", { className: "rf-select__popup", role: "presentation", style: popupStyle }, /* @__PURE__ */ React75.createElement("ul", { ref: listRef, className: "rf-select__listbox", role: "listbox", "aria-multiselectable": multiple }, options.map((opt, idx) => {
|
|
4659
|
+
const selected = isSelected(opt.value);
|
|
4660
|
+
const focused = focusedIdx === idx;
|
|
4661
|
+
return /* @__PURE__ */ React75.createElement(
|
|
4662
|
+
"li",
|
|
4663
|
+
{
|
|
4664
|
+
key: opt.value,
|
|
4665
|
+
"data-idx": idx,
|
|
4666
|
+
role: "option",
|
|
4667
|
+
"aria-selected": selected,
|
|
4668
|
+
"aria-disabled": opt.disabled,
|
|
4669
|
+
className: [
|
|
4670
|
+
"rf-select__option",
|
|
4671
|
+
selected ? "rf-select__option--selected" : "",
|
|
4672
|
+
focused ? "rf-select__option--focused" : "",
|
|
4673
|
+
opt.disabled ? "rf-select__option--disabled" : ""
|
|
4674
|
+
].filter(Boolean).join(" "),
|
|
4675
|
+
onMouseEnter: () => setFocusedIdx(idx),
|
|
4676
|
+
onMouseLeave: () => setFocusedIdx(-1),
|
|
4677
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
4678
|
+
onClick: () => selectOption(opt)
|
|
4679
|
+
},
|
|
4680
|
+
/* @__PURE__ */ React75.createElement("span", { className: "rf-select__option-label" }, opt.label),
|
|
4681
|
+
/* @__PURE__ */ React75.createElement("span", { className: "rf-select__option-check", "aria-hidden": "true" }, /* @__PURE__ */ React75.createElement(CheckIcon2, null))
|
|
4682
|
+
);
|
|
4683
|
+
}))),
|
|
4684
|
+
document.body
|
|
4685
|
+
)
|
|
4637
4686
|
);
|
|
4638
4687
|
});
|
|
4639
4688
|
Select.displayName = "Select";
|
|
@@ -5807,7 +5856,7 @@ import React87, {
|
|
|
5807
5856
|
useRef as useRef14,
|
|
5808
5857
|
useState as useState13
|
|
5809
5858
|
} from "react";
|
|
5810
|
-
import
|
|
5859
|
+
import ReactDOM4 from "react-dom";
|
|
5811
5860
|
var GAP = 8;
|
|
5812
5861
|
function computePosition(anchor, tooltip, placement) {
|
|
5813
5862
|
const { top: aTop, left: aLeft, width: aW, height: aH } = anchor;
|
|
@@ -6026,7 +6075,7 @@ var Tooltip = ({
|
|
|
6026
6075
|
...childProps
|
|
6027
6076
|
},
|
|
6028
6077
|
React87.cloneElement(children)
|
|
6029
|
-
),
|
|
6078
|
+
), ReactDOM4.createPortal(tooltipElement, document.body));
|
|
6030
6079
|
};
|
|
6031
6080
|
Tooltip.displayName = "Tooltip";
|
|
6032
6081
|
|
|
@@ -6932,7 +6981,7 @@ import React97, {
|
|
|
6932
6981
|
useRef as useRef16,
|
|
6933
6982
|
useState as useState17
|
|
6934
6983
|
} from "react";
|
|
6935
|
-
import
|
|
6984
|
+
import ReactDOM5 from "react-dom";
|
|
6936
6985
|
var MenuDivider = () => /* @__PURE__ */ React97.createElement("hr", { className: "rf-menu-divider", "aria-hidden": "true" });
|
|
6937
6986
|
MenuDivider.displayName = "MenuDivider";
|
|
6938
6987
|
var MenuItem = ({
|
|
@@ -7085,7 +7134,7 @@ var Menu = ({
|
|
|
7085
7134
|
},
|
|
7086
7135
|
children
|
|
7087
7136
|
));
|
|
7088
|
-
return
|
|
7137
|
+
return ReactDOM5.createPortal(portal, document.body);
|
|
7089
7138
|
};
|
|
7090
7139
|
Menu.displayName = "Menu";
|
|
7091
7140
|
|
|
@@ -7094,7 +7143,7 @@ import React98, {
|
|
|
7094
7143
|
useEffect as useEffect13,
|
|
7095
7144
|
useState as useState18
|
|
7096
7145
|
} from "react";
|
|
7097
|
-
import
|
|
7146
|
+
import ReactDOM6 from "react-dom";
|
|
7098
7147
|
var Drawer = ({
|
|
7099
7148
|
open,
|
|
7100
7149
|
onClose,
|
|
@@ -7194,7 +7243,7 @@ var Drawer = ({
|
|
|
7194
7243
|
},
|
|
7195
7244
|
children
|
|
7196
7245
|
));
|
|
7197
|
-
return
|
|
7246
|
+
return ReactDOM6.createPortal(
|
|
7198
7247
|
/* @__PURE__ */ React98.createElement("div", { className: rootClasses, style }, drawerContent),
|
|
7199
7248
|
document.body
|
|
7200
7249
|
);
|
|
@@ -7208,7 +7257,7 @@ import React99, {
|
|
|
7208
7257
|
useRef as useRef17,
|
|
7209
7258
|
useState as useState19
|
|
7210
7259
|
} from "react";
|
|
7211
|
-
import
|
|
7260
|
+
import ReactDOM7 from "react-dom";
|
|
7212
7261
|
var SEVERITY_ICONS = {
|
|
7213
7262
|
success: "\u2713",
|
|
7214
7263
|
error: "\u2715",
|
|
@@ -7313,7 +7362,7 @@ var Snackbar = ({
|
|
|
7313
7362
|
"\u2715"
|
|
7314
7363
|
)
|
|
7315
7364
|
));
|
|
7316
|
-
return
|
|
7365
|
+
return ReactDOM7.createPortal(snackbarEl, document.body);
|
|
7317
7366
|
};
|
|
7318
7367
|
Snackbar.displayName = "Snackbar";
|
|
7319
7368
|
|
|
@@ -7372,7 +7421,7 @@ import React101, {
|
|
|
7372
7421
|
useRef as useRef18,
|
|
7373
7422
|
useState as useState20
|
|
7374
7423
|
} from "react";
|
|
7375
|
-
import
|
|
7424
|
+
import ReactDOM8 from "react-dom";
|
|
7376
7425
|
function computePopperPosition(anchorRect, popperRect, placement, offset2 = [0, 8]) {
|
|
7377
7426
|
const [skid, dist] = offset2;
|
|
7378
7427
|
let top = 0;
|
|
@@ -7515,7 +7564,7 @@ var Popper = ({
|
|
|
7515
7564
|
if (disablePortal) {
|
|
7516
7565
|
return /* @__PURE__ */ React101.createElement(React101.Fragment, null, popper);
|
|
7517
7566
|
}
|
|
7518
|
-
return
|
|
7567
|
+
return ReactDOM8.createPortal(popper, document.body);
|
|
7519
7568
|
};
|
|
7520
7569
|
Popper.displayName = "Popper";
|
|
7521
7570
|
|
|
@@ -7526,7 +7575,7 @@ import React102, {
|
|
|
7526
7575
|
useRef as useRef19,
|
|
7527
7576
|
useState as useState21
|
|
7528
7577
|
} from "react";
|
|
7529
|
-
import
|
|
7578
|
+
import ReactDOM9 from "react-dom";
|
|
7530
7579
|
function getPoint(rect, v, h) {
|
|
7531
7580
|
const x = h === "left" ? rect.left : h === "center" ? rect.left + rect.width / 2 : rect.right;
|
|
7532
7581
|
const y = v === "top" ? rect.top : v === "center" ? rect.top + rect.height / 2 : rect.bottom;
|
|
@@ -7629,7 +7678,7 @@ var Popover = ({
|
|
|
7629
7678
|
if (disablePortal) {
|
|
7630
7679
|
return /* @__PURE__ */ React102.createElement("div", { className: `${rootClasses} rf-popover-inline`, style }, content);
|
|
7631
7680
|
}
|
|
7632
|
-
return
|
|
7681
|
+
return ReactDOM9.createPortal(
|
|
7633
7682
|
/* @__PURE__ */ React102.createElement("div", { className: rootClasses, style }, content),
|
|
7634
7683
|
document.body
|
|
7635
7684
|
);
|