@rufous/ui 0.3.26 → 0.3.28
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 +137 -83
- package/dist/main.css +6 -0
- package/dist/main.d.cts +2 -2
- package/dist/main.d.ts +2 -2
- package/dist/main.js +121 -66
- package/package.json +1 -1
package/dist/main.cjs
CHANGED
|
@@ -1841,12 +1841,6 @@ var STEP_BY_VARIANT = {
|
|
|
1841
1841
|
"positive-integer": 1,
|
|
1842
1842
|
"positive-decimal": 0.1
|
|
1843
1843
|
};
|
|
1844
|
-
var MIN_BY_VARIANT = {
|
|
1845
|
-
"integer": void 0,
|
|
1846
|
-
"decimal": void 0,
|
|
1847
|
-
"positive-integer": 0,
|
|
1848
|
-
"positive-decimal": 0
|
|
1849
|
-
};
|
|
1850
1844
|
var TextField = (0, import_react17.forwardRef)(({
|
|
1851
1845
|
label,
|
|
1852
1846
|
name,
|
|
@@ -1935,21 +1929,23 @@ var TextField = (0, import_react17.forwardRef)(({
|
|
|
1935
1929
|
}
|
|
1936
1930
|
}
|
|
1937
1931
|
};
|
|
1932
|
+
const stepBy = (delta) => {
|
|
1933
|
+
if (!internalRef.current) return;
|
|
1934
|
+
const step = Number(stepProp ?? (numberVariant ? STEP_BY_VARIANT[numberVariant] : 1));
|
|
1935
|
+
const newVal = (parseFloat(internalRef.current.value) || 0) + delta * step;
|
|
1936
|
+
const nativeInputValueSetter = Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype, "value")?.set;
|
|
1937
|
+
nativeInputValueSetter?.call(internalRef.current, String(newVal));
|
|
1938
|
+
triggerChange();
|
|
1939
|
+
};
|
|
1938
1940
|
const handleIncrement = (e) => {
|
|
1939
1941
|
e.preventDefault();
|
|
1940
1942
|
e.stopPropagation();
|
|
1941
|
-
|
|
1942
|
-
internalRef.current.stepUp();
|
|
1943
|
-
triggerChange();
|
|
1944
|
-
}
|
|
1943
|
+
stepBy(1);
|
|
1945
1944
|
};
|
|
1946
1945
|
const handleDecrement = (e) => {
|
|
1947
1946
|
e.preventDefault();
|
|
1948
1947
|
e.stopPropagation();
|
|
1949
|
-
|
|
1950
|
-
internalRef.current.stepDown();
|
|
1951
|
-
triggerChange();
|
|
1952
|
-
}
|
|
1948
|
+
stepBy(-1);
|
|
1953
1949
|
};
|
|
1954
1950
|
const handleKeyDown = (e) => {
|
|
1955
1951
|
if (type === "number") {
|
|
@@ -1960,16 +1956,10 @@ var TextField = (0, import_react17.forwardRef)(({
|
|
|
1960
1956
|
}
|
|
1961
1957
|
if (e.key === "ArrowUp") {
|
|
1962
1958
|
e.preventDefault();
|
|
1963
|
-
|
|
1964
|
-
internalRef.current.stepUp();
|
|
1965
|
-
triggerChange();
|
|
1966
|
-
}
|
|
1959
|
+
stepBy(1);
|
|
1967
1960
|
} else if (e.key === "ArrowDown") {
|
|
1968
1961
|
e.preventDefault();
|
|
1969
|
-
|
|
1970
|
-
internalRef.current.stepDown();
|
|
1971
|
-
triggerChange();
|
|
1972
|
-
}
|
|
1962
|
+
stepBy(-1);
|
|
1973
1963
|
}
|
|
1974
1964
|
}
|
|
1975
1965
|
if (props.onKeyDown) props.onKeyDown(e);
|
|
@@ -1995,18 +1985,24 @@ var TextField = (0, import_react17.forwardRef)(({
|
|
|
1995
1985
|
"input",
|
|
1996
1986
|
{
|
|
1997
1987
|
ref: internalRef,
|
|
1998
|
-
type,
|
|
1988
|
+
type: type === "number" ? "text" : type,
|
|
1989
|
+
inputMode: type === "number" ? "numeric" : void 0,
|
|
1999
1990
|
onKeyDown: handleKeyDown,
|
|
2000
1991
|
className: "rf-text-field__input",
|
|
2001
1992
|
placeholder: placeholder || (variant === "outlined" ? " " : void 0),
|
|
2002
1993
|
name,
|
|
2003
1994
|
id: inputId,
|
|
2004
|
-
value
|
|
1995
|
+
value: (() => {
|
|
1996
|
+
if (type !== "number" || value === void 0 || value === null || value === "") return value;
|
|
1997
|
+
const str = String(value);
|
|
1998
|
+
if (!str.includes("e") && !str.includes("E")) return str;
|
|
1999
|
+
const num = Number(str);
|
|
2000
|
+
if (isNaN(num)) return str;
|
|
2001
|
+
return num.toLocaleString("en-US", { useGrouping: false, maximumFractionDigits: 20 });
|
|
2002
|
+
})(),
|
|
2005
2003
|
required,
|
|
2006
2004
|
disabled,
|
|
2007
2005
|
readOnly,
|
|
2008
|
-
step: type === "number" ? stepProp ?? (numberVariant ? STEP_BY_VARIANT[numberVariant] : void 0) : void 0,
|
|
2009
|
-
min: type === "number" && numberVariant ? MIN_BY_VARIANT[numberVariant] : void 0,
|
|
2010
2006
|
...slotProps?.input,
|
|
2011
2007
|
...props,
|
|
2012
2008
|
onChange: handleChange
|
|
@@ -2419,7 +2415,7 @@ function AutocompleteInner(props, _ref) {
|
|
|
2419
2415
|
onClose?.();
|
|
2420
2416
|
if (!justSelected && !freeSolo && !multiple && value == null) {
|
|
2421
2417
|
setInputStr("");
|
|
2422
|
-
onInputChange?.(null, "");
|
|
2418
|
+
onInputChange?.(null, "", "reset");
|
|
2423
2419
|
}
|
|
2424
2420
|
}, [openProp, freeSolo, multiple, value, onInputChange, onClose]);
|
|
2425
2421
|
(0, import_react19.useEffect)(() => {
|
|
@@ -2464,13 +2460,13 @@ function AutocompleteInner(props, _ref) {
|
|
|
2464
2460
|
onChange?.(event, next, already ? "removeOption" : "selectOption");
|
|
2465
2461
|
setInputStr("");
|
|
2466
2462
|
setFilterQuery("");
|
|
2467
|
-
onInputChange?.(event, "");
|
|
2463
|
+
onInputChange?.(event, "", "reset");
|
|
2468
2464
|
inputRef.current?.focus();
|
|
2469
2465
|
} else {
|
|
2470
2466
|
onChange?.(event, opt, "selectOption");
|
|
2471
2467
|
setInputStr(getOptionLabel(opt));
|
|
2472
2468
|
setFilterQuery("");
|
|
2473
|
-
onInputChange?.(event, getOptionLabel(opt));
|
|
2469
|
+
onInputChange?.(event, getOptionLabel(opt), "reset");
|
|
2474
2470
|
closePopup(true);
|
|
2475
2471
|
}
|
|
2476
2472
|
setFocusedIdx(-1);
|
|
@@ -2480,7 +2476,7 @@ function AutocompleteInner(props, _ref) {
|
|
|
2480
2476
|
onChange?.(e, multiple ? [] : null, "clear");
|
|
2481
2477
|
setInputStr("");
|
|
2482
2478
|
setFilterQuery("");
|
|
2483
|
-
onInputChange?.(e, "");
|
|
2479
|
+
onInputChange?.(e, "", "clear");
|
|
2484
2480
|
inputRef.current?.focus();
|
|
2485
2481
|
};
|
|
2486
2482
|
const removeTag = (opt, e) => {
|
|
@@ -2492,7 +2488,7 @@ function AutocompleteInner(props, _ref) {
|
|
|
2492
2488
|
const v = e.target.value;
|
|
2493
2489
|
setInputStr(v);
|
|
2494
2490
|
setFilterQuery(v);
|
|
2495
|
-
onInputChange?.(e, v);
|
|
2491
|
+
onInputChange?.(e, v, "input");
|
|
2496
2492
|
if (!open) openPopup();
|
|
2497
2493
|
};
|
|
2498
2494
|
const handleKeyDown = (e) => {
|
|
@@ -2579,7 +2575,7 @@ function AutocompleteInner(props, _ref) {
|
|
|
2579
2575
|
multiple && (renderTags ? renderTags(selectedValues, ({ index }) => ({
|
|
2580
2576
|
key: index,
|
|
2581
2577
|
onDelete: (e) => removeTag(selectedValues[index], e)
|
|
2582
|
-
})) : /* @__PURE__ */ import_react19.default.createElement(import_react19.default.Fragment, null, visibleTags.map((opt, i) => /* @__PURE__ */ import_react19.default.createElement("span", { key: i, className: "rf-autocomplete__tag" }, /* @__PURE__ */ import_react19.default.createElement("span", { style: { overflow: "hidden", textOverflow: "ellipsis" } }, getOptionLabel(opt)), /* @__PURE__ */ import_react19.default.createElement(
|
|
2578
|
+
})) : /* @__PURE__ */ import_react19.default.createElement(import_react19.default.Fragment, null, visibleTags.map((opt, i) => /* @__PURE__ */ import_react19.default.createElement("span", { key: i, className: "rf-autocomplete__tag" }, /* @__PURE__ */ import_react19.default.createElement("span", { style: { overflow: "hidden", textOverflow: "ellipsis" } }, getOptionLabel(opt)), !disabled && /* @__PURE__ */ import_react19.default.createElement(
|
|
2583
2579
|
"button",
|
|
2584
2580
|
{
|
|
2585
2581
|
type: "button",
|
|
@@ -2632,7 +2628,7 @@ function AutocompleteInner(props, _ref) {
|
|
|
2632
2628
|
"aria-label": "Clear"
|
|
2633
2629
|
},
|
|
2634
2630
|
/* @__PURE__ */ import_react19.default.createElement(CloseSmIcon, { size: 16 })
|
|
2635
|
-
), !freeSolo && /* @__PURE__ */ import_react19.default.createElement(
|
|
2631
|
+
), !freeSolo && !disabled && /* @__PURE__ */ import_react19.default.createElement(
|
|
2636
2632
|
"button",
|
|
2637
2633
|
{
|
|
2638
2634
|
type: "button",
|
|
@@ -3807,16 +3803,15 @@ var DateField = ({
|
|
|
3807
3803
|
}
|
|
3808
3804
|
}
|
|
3809
3805
|
),
|
|
3810
|
-
/* @__PURE__ */ import_react21.default.createElement("div", { className: "rf-text-field__adornment rf-text-field__adornment--end" }, /* @__PURE__ */ import_react21.default.createElement(
|
|
3806
|
+
!disabled && /* @__PURE__ */ import_react21.default.createElement("div", { className: "rf-text-field__adornment rf-text-field__adornment--end" }, /* @__PURE__ */ import_react21.default.createElement(
|
|
3811
3807
|
"button",
|
|
3812
3808
|
{
|
|
3813
3809
|
type: "button",
|
|
3814
3810
|
className: "rf-date-field__icon-btn",
|
|
3815
3811
|
tabIndex: -1,
|
|
3816
|
-
disabled,
|
|
3817
3812
|
onClick: (e) => {
|
|
3818
3813
|
e.stopPropagation();
|
|
3819
|
-
|
|
3814
|
+
setOpen((o) => !o);
|
|
3820
3815
|
},
|
|
3821
3816
|
"aria-label": "Pick date"
|
|
3822
3817
|
},
|
|
@@ -4416,16 +4411,15 @@ var DateRangeField = ({
|
|
|
4416
4411
|
}
|
|
4417
4412
|
}
|
|
4418
4413
|
),
|
|
4419
|
-
/* @__PURE__ */ import_react22.default.createElement("div", { className: "rf-text-field__adornment rf-text-field__adornment--end" }, /* @__PURE__ */ import_react22.default.createElement(
|
|
4414
|
+
!disabled && /* @__PURE__ */ import_react22.default.createElement("div", { className: "rf-text-field__adornment rf-text-field__adornment--end" }, /* @__PURE__ */ import_react22.default.createElement(
|
|
4420
4415
|
"button",
|
|
4421
4416
|
{
|
|
4422
4417
|
type: "button",
|
|
4423
4418
|
className: "rf-date-field__icon-btn",
|
|
4424
4419
|
tabIndex: -1,
|
|
4425
|
-
disabled,
|
|
4426
4420
|
onClick: (e) => {
|
|
4427
4421
|
e.stopPropagation();
|
|
4428
|
-
|
|
4422
|
+
setOpen((o) => !o);
|
|
4429
4423
|
},
|
|
4430
4424
|
"aria-label": "Pick date range"
|
|
4431
4425
|
},
|
|
@@ -4619,7 +4613,59 @@ var RufousLogoLoader = ({ size = 80, sx, className }) => {
|
|
|
4619
4613
|
|
|
4620
4614
|
// lib/DataGrid/DataGrid.tsx
|
|
4621
4615
|
var import_react23 = __toESM(require("react"), 1);
|
|
4616
|
+
var import_react_dom5 = __toESM(require("react-dom"), 1);
|
|
4622
4617
|
var import_lucide_react2 = require("lucide-react");
|
|
4618
|
+
function OverflowTooltip({ content }) {
|
|
4619
|
+
const ref = (0, import_react23.useRef)(null);
|
|
4620
|
+
const [pos, setPos] = (0, import_react23.useState)(null);
|
|
4621
|
+
return /* @__PURE__ */ import_react23.default.createElement(import_react23.default.Fragment, null, /* @__PURE__ */ import_react23.default.createElement(
|
|
4622
|
+
"span",
|
|
4623
|
+
{
|
|
4624
|
+
ref,
|
|
4625
|
+
onMouseEnter: () => {
|
|
4626
|
+
if (ref.current && ref.current.scrollWidth > ref.current.clientWidth) {
|
|
4627
|
+
const r = ref.current.getBoundingClientRect();
|
|
4628
|
+
setPos({ top: r.top, left: r.left + r.width / 2 });
|
|
4629
|
+
}
|
|
4630
|
+
},
|
|
4631
|
+
onMouseLeave: () => setPos(null),
|
|
4632
|
+
style: { display: "block", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }
|
|
4633
|
+
},
|
|
4634
|
+
content
|
|
4635
|
+
), pos && import_react_dom5.default.createPortal(
|
|
4636
|
+
/* @__PURE__ */ import_react23.default.createElement("div", { style: {
|
|
4637
|
+
position: "fixed",
|
|
4638
|
+
top: pos.top - 4,
|
|
4639
|
+
left: pos.left,
|
|
4640
|
+
transform: "translate(-50%, -100%)",
|
|
4641
|
+
background: "rgba(0,0,0,0.75)",
|
|
4642
|
+
color: "#fff",
|
|
4643
|
+
padding: "4px 8px",
|
|
4644
|
+
borderRadius: 4,
|
|
4645
|
+
fontSize: "0.75rem",
|
|
4646
|
+
maxWidth: 320,
|
|
4647
|
+
wordBreak: "break-word",
|
|
4648
|
+
zIndex: 9999,
|
|
4649
|
+
pointerEvents: "none",
|
|
4650
|
+
whiteSpace: "normal"
|
|
4651
|
+
} }, content),
|
|
4652
|
+
document.body
|
|
4653
|
+
));
|
|
4654
|
+
}
|
|
4655
|
+
function formatCellValue(value, colType) {
|
|
4656
|
+
if (value == null) return "";
|
|
4657
|
+
if (colType === "number") {
|
|
4658
|
+
const num = Number(value);
|
|
4659
|
+
if (!isNaN(num)) {
|
|
4660
|
+
const str = String(num);
|
|
4661
|
+
if (str.includes("e") || str.includes("E")) {
|
|
4662
|
+
return num.toLocaleString("en-US", { useGrouping: false, maximumFractionDigits: 20 });
|
|
4663
|
+
}
|
|
4664
|
+
return str;
|
|
4665
|
+
}
|
|
4666
|
+
}
|
|
4667
|
+
return String(value);
|
|
4668
|
+
}
|
|
4623
4669
|
function getAllGroupIds(rows, fields, getKey, depth = 0, parentId = "") {
|
|
4624
4670
|
if (!fields.length || !rows.length) return [];
|
|
4625
4671
|
const [field, ...rest] = fields;
|
|
@@ -4934,6 +4980,8 @@ function DataGrid({
|
|
|
4934
4980
|
});
|
|
4935
4981
|
(0, import_react23.useEffect)(() => {
|
|
4936
4982
|
onFiltersChangeRef.current?.(advancedFilters);
|
|
4983
|
+
setCurrentPage(1);
|
|
4984
|
+
if (onPaginationModelChange) onPaginationModelChange({ page: 0, pageSize: activePageSize });
|
|
4937
4985
|
}, [advancedFilters]);
|
|
4938
4986
|
const handleSort = (fieldKey, dir) => {
|
|
4939
4987
|
if (dir !== void 0) {
|
|
@@ -5295,6 +5343,7 @@ function DataGrid({
|
|
|
5295
5343
|
onChange: (e) => {
|
|
5296
5344
|
setFilterText(e.target.value);
|
|
5297
5345
|
setCurrentPage(1);
|
|
5346
|
+
if (onPaginationModelChange) onPaginationModelChange({ page: 0, pageSize: activePageSize });
|
|
5298
5347
|
}
|
|
5299
5348
|
}
|
|
5300
5349
|
)), showFilterBtn && /* @__PURE__ */ import_react23.default.createElement(Tooltip, { title: "Filters", placement: "top" }, /* @__PURE__ */ import_react23.default.createElement(
|
|
@@ -5502,7 +5551,7 @@ function DataGrid({
|
|
|
5502
5551
|
const formattedValue = col.valueFormatter ? col.valueFormatter({ value, row: item, field }) : value;
|
|
5503
5552
|
if (col.renderCell) return col.renderCell({ value, row: item, field });
|
|
5504
5553
|
if (col.render) return col.render(value, item);
|
|
5505
|
-
return
|
|
5554
|
+
return /* @__PURE__ */ import_react23.default.createElement(OverflowTooltip, { content: formatCellValue(formattedValue, col.type) });
|
|
5506
5555
|
})()
|
|
5507
5556
|
);
|
|
5508
5557
|
}), actions && /* @__PURE__ */ import_react23.default.createElement("td", { className: "dg-row-actions-cell" }, (() => {
|
|
@@ -5571,7 +5620,7 @@ function DataGrid({
|
|
|
5571
5620
|
setActiveMenu(null);
|
|
5572
5621
|
} }, /* @__PURE__ */ import_react23.default.createElement(import_lucide_react2.Layers, { size: 14 }), " Group by");
|
|
5573
5622
|
})(),
|
|
5574
|
-
/* @__PURE__ */ import_react23.default.createElement("button", { className: "dg-menu-item", onClick: () => toggleHide(activeMenu) }, /* @__PURE__ */ import_react23.default.createElement(import_lucide_react2.EyeOff, { size: 14 }), " Hide column"),
|
|
5623
|
+
activeMenuCol?.hideable !== false && /* @__PURE__ */ import_react23.default.createElement("button", { className: "dg-menu-item", onClick: () => toggleHide(activeMenu) }, /* @__PURE__ */ import_react23.default.createElement(import_lucide_react2.EyeOff, { size: 14 }), " Hide column"),
|
|
5575
5624
|
/* @__PURE__ */ import_react23.default.createElement("button", { className: "dg-menu-item", onClick: () => {
|
|
5576
5625
|
setShowManageColumns(true);
|
|
5577
5626
|
setActiveMenu(null);
|
|
@@ -5588,7 +5637,7 @@ function DataGrid({
|
|
|
5588
5637
|
)), resolvedColumns.filter((c) => c.header.toLowerCase().includes(colSearch.toLowerCase())).map((col) => {
|
|
5589
5638
|
const key = String(col.key);
|
|
5590
5639
|
const isUnhideable = col.hideable === false;
|
|
5591
|
-
return /* @__PURE__ */ import_react23.default.createElement("div", { key, className: `dg-col-row${isUnhideable ? " disabled" : ""}` }, /* @__PURE__ */ import_react23.default.createElement("div", { className: "dg-col-label" }, /* @__PURE__ */ import_react23.default.createElement("div", { className: "dg-col-dot", style: { background: col.hidden ? "var(--border-color)" : "var(--primary-color)" } }), col.header), !isUnhideable && /* @__PURE__ */ import_react23.default.createElement("button", { className: "dg-icon-btn", onClick: () => toggleHide(key) }, col.hidden ? /* @__PURE__ */ import_react23.default.createElement(import_lucide_react2.EyeOff, { size: 14 }) : /* @__PURE__ */ import_react23.default.createElement(import_lucide_react2.
|
|
5640
|
+
return /* @__PURE__ */ import_react23.default.createElement("div", { key, className: `dg-col-row${isUnhideable ? " disabled" : ""}` }, /* @__PURE__ */ import_react23.default.createElement("div", { className: "dg-col-label" }, /* @__PURE__ */ import_react23.default.createElement("div", { className: "dg-col-dot", style: { background: col.hidden ? "var(--border-color)" : "var(--primary-color)" } }), col.header), !isUnhideable && /* @__PURE__ */ import_react23.default.createElement("button", { className: "dg-icon-btn", onClick: () => toggleHide(key) }, col.hidden ? /* @__PURE__ */ import_react23.default.createElement(import_lucide_react2.EyeOff, { size: 14 }) : /* @__PURE__ */ import_react23.default.createElement(import_lucide_react2.Eye, { size: 14 })));
|
|
5592
5641
|
})), /* @__PURE__ */ import_react23.default.createElement("div", { className: "dg-modal-footer" }, /* @__PURE__ */ import_react23.default.createElement("button", { className: "dg-action-btn", onClick: () => setColumnOverrides((prev) => {
|
|
5593
5642
|
const next = { ...prev };
|
|
5594
5643
|
resolvedColumns.forEach((c) => {
|
|
@@ -5648,7 +5697,9 @@ function DataGrid({
|
|
|
5648
5697
|
value: f.value,
|
|
5649
5698
|
onChange: (val) => setAdvancedFilters((p) => p.map((fi, i) => i === idx ? { ...fi, value: val } : fi)),
|
|
5650
5699
|
variant: "compact",
|
|
5651
|
-
fullWidth: true
|
|
5700
|
+
fullWidth: true,
|
|
5701
|
+
dateFormat: "DD/MM/YYYY",
|
|
5702
|
+
placeholder: "DD/MM/YYYY"
|
|
5652
5703
|
}
|
|
5653
5704
|
)), !hideValue && col?.type === "status" && (() => {
|
|
5654
5705
|
const opts = col.statusOptions || [...new Set(data.map((item) => String(item[col.field || col.key || ""])))].filter((v) => v && v !== "undefined" && v !== "null").sort();
|
|
@@ -5702,7 +5753,7 @@ function DataGrid({
|
|
|
5702
5753
|
|
|
5703
5754
|
// lib/Select/Select.tsx
|
|
5704
5755
|
var import_react24 = __toESM(require("react"), 1);
|
|
5705
|
-
var
|
|
5756
|
+
var import_react_dom6 = __toESM(require("react-dom"), 1);
|
|
5706
5757
|
var ChevronDownIcon2 = () => /* @__PURE__ */ import_react24.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_react24.default.createElement("polyline", { points: "6 9 12 15 18 9" }));
|
|
5707
5758
|
var CheckIcon2 = () => /* @__PURE__ */ import_react24.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_react24.default.createElement("polyline", { points: "20 6 9 17 4 12" }));
|
|
5708
5759
|
function normaliseOptions(options) {
|
|
@@ -5911,10 +5962,10 @@ var Select = import_react24.default.forwardRef(function Select2(props, ref) {
|
|
|
5911
5962
|
renderDisplay(),
|
|
5912
5963
|
label && /* @__PURE__ */ import_react24.default.createElement("label", { id: inputId, className: "rf-text-field__label" }, label, required && /* @__PURE__ */ import_react24.default.createElement("span", { className: "rf-text-field__asterisk" }, " *")),
|
|
5913
5964
|
variant === "outlined" && /* @__PURE__ */ import_react24.default.createElement("fieldset", { className: "rf-text-field__notch" }, label ? /* @__PURE__ */ import_react24.default.createElement("legend", { className: "rf-text-field__legend" }, /* @__PURE__ */ import_react24.default.createElement("span", null, label, required ? " *" : "")) : /* @__PURE__ */ import_react24.default.createElement("legend", { className: "rf-text-field__legend--empty" })),
|
|
5914
|
-
/* @__PURE__ */ import_react24.default.createElement("div", { className: "rf-select__arrow", "aria-hidden": "true" }, /* @__PURE__ */ import_react24.default.createElement(ChevronDownIcon2, null))
|
|
5965
|
+
!disabled && /* @__PURE__ */ import_react24.default.createElement("div", { className: "rf-select__arrow", "aria-hidden": "true" }, /* @__PURE__ */ import_react24.default.createElement(ChevronDownIcon2, null))
|
|
5915
5966
|
),
|
|
5916
5967
|
helperText && /* @__PURE__ */ import_react24.default.createElement("div", { className: `rf-text-field__helper-text${error ? " rf-text-field__helper-text--error" : ""}` }, helperText),
|
|
5917
|
-
open && !disabled &&
|
|
5968
|
+
open && !disabled && import_react_dom6.default.createPortal(
|
|
5918
5969
|
/* @__PURE__ */ import_react24.default.createElement("div", { ref: popupRef, className: "rf-select__popup", role: "presentation", style: popupStyle }, /* @__PURE__ */ import_react24.default.createElement("ul", { ref: listRef, className: "rf-select__listbox", role: "listbox", "aria-multiselectable": multiple }, (() => {
|
|
5919
5970
|
const renderOpt = (opt, selectableIdx) => {
|
|
5920
5971
|
const selected = isSelected(opt.value);
|
|
@@ -8001,7 +8052,7 @@ Stepper.displayName = "Stepper";
|
|
|
8001
8052
|
|
|
8002
8053
|
// lib/Menu/Menu.tsx
|
|
8003
8054
|
var import_react40 = __toESM(require("react"), 1);
|
|
8004
|
-
var
|
|
8055
|
+
var import_react_dom7 = __toESM(require("react-dom"), 1);
|
|
8005
8056
|
var MenuDivider = () => /* @__PURE__ */ import_react40.default.createElement("hr", { className: "rf-menu-divider", "aria-hidden": "true" });
|
|
8006
8057
|
MenuDivider.displayName = "MenuDivider";
|
|
8007
8058
|
var MenuItem = ({
|
|
@@ -8154,13 +8205,13 @@ var Menu = ({
|
|
|
8154
8205
|
},
|
|
8155
8206
|
children
|
|
8156
8207
|
));
|
|
8157
|
-
return
|
|
8208
|
+
return import_react_dom7.default.createPortal(portal, document.body);
|
|
8158
8209
|
};
|
|
8159
8210
|
Menu.displayName = "Menu";
|
|
8160
8211
|
|
|
8161
8212
|
// lib/Drawer/Drawer.tsx
|
|
8162
8213
|
var import_react41 = __toESM(require("react"), 1);
|
|
8163
|
-
var
|
|
8214
|
+
var import_react_dom8 = __toESM(require("react-dom"), 1);
|
|
8164
8215
|
var Drawer = ({
|
|
8165
8216
|
open,
|
|
8166
8217
|
onClose,
|
|
@@ -8260,7 +8311,7 @@ var Drawer = ({
|
|
|
8260
8311
|
},
|
|
8261
8312
|
children
|
|
8262
8313
|
));
|
|
8263
|
-
return
|
|
8314
|
+
return import_react_dom8.default.createPortal(
|
|
8264
8315
|
/* @__PURE__ */ import_react41.default.createElement("div", { className: rootClasses, style }, drawerContent),
|
|
8265
8316
|
document.body
|
|
8266
8317
|
);
|
|
@@ -8269,7 +8320,7 @@ Drawer.displayName = "Drawer";
|
|
|
8269
8320
|
|
|
8270
8321
|
// lib/Snackbar/Snackbar.tsx
|
|
8271
8322
|
var import_react42 = __toESM(require("react"), 1);
|
|
8272
|
-
var
|
|
8323
|
+
var import_react_dom9 = __toESM(require("react-dom"), 1);
|
|
8273
8324
|
var SEVERITY_ICONS = {
|
|
8274
8325
|
success: "\u2713",
|
|
8275
8326
|
error: "\u2715",
|
|
@@ -8374,7 +8425,7 @@ var Snackbar = ({
|
|
|
8374
8425
|
"\u2715"
|
|
8375
8426
|
)
|
|
8376
8427
|
));
|
|
8377
|
-
return
|
|
8428
|
+
return import_react_dom9.default.createPortal(snackbarEl, document.body);
|
|
8378
8429
|
};
|
|
8379
8430
|
Snackbar.displayName = "Snackbar";
|
|
8380
8431
|
|
|
@@ -8428,7 +8479,7 @@ Link.displayName = "Link";
|
|
|
8428
8479
|
|
|
8429
8480
|
// lib/Popper/Popper.tsx
|
|
8430
8481
|
var import_react44 = __toESM(require("react"), 1);
|
|
8431
|
-
var
|
|
8482
|
+
var import_react_dom10 = __toESM(require("react-dom"), 1);
|
|
8432
8483
|
function computePopperPosition(anchorRect, popperRect, placement, offset2 = [0, 8]) {
|
|
8433
8484
|
const [skid, dist] = offset2;
|
|
8434
8485
|
let top = 0;
|
|
@@ -8571,13 +8622,13 @@ var Popper = ({
|
|
|
8571
8622
|
if (disablePortal) {
|
|
8572
8623
|
return /* @__PURE__ */ import_react44.default.createElement(import_react44.default.Fragment, null, popper);
|
|
8573
8624
|
}
|
|
8574
|
-
return
|
|
8625
|
+
return import_react_dom10.default.createPortal(popper, document.body);
|
|
8575
8626
|
};
|
|
8576
8627
|
Popper.displayName = "Popper";
|
|
8577
8628
|
|
|
8578
8629
|
// lib/Popover/Popover.tsx
|
|
8579
8630
|
var import_react45 = __toESM(require("react"), 1);
|
|
8580
|
-
var
|
|
8631
|
+
var import_react_dom11 = __toESM(require("react-dom"), 1);
|
|
8581
8632
|
function getPoint(rect, v, h) {
|
|
8582
8633
|
const x = h === "left" ? rect.left : h === "center" ? rect.left + rect.width / 2 : rect.right;
|
|
8583
8634
|
const y = v === "top" ? rect.top : v === "center" ? rect.top + rect.height / 2 : rect.bottom;
|
|
@@ -8680,7 +8731,7 @@ var Popover = ({
|
|
|
8680
8731
|
if (disablePortal) {
|
|
8681
8732
|
return /* @__PURE__ */ import_react45.default.createElement("div", { className: `${rootClasses} rf-popover-inline`, style }, content);
|
|
8682
8733
|
}
|
|
8683
|
-
return
|
|
8734
|
+
return import_react_dom11.default.createPortal(
|
|
8684
8735
|
/* @__PURE__ */ import_react45.default.createElement("div", { className: rootClasses, style }, content),
|
|
8685
8736
|
document.body
|
|
8686
8737
|
);
|
|
@@ -9331,7 +9382,7 @@ PhoneField.displayName = "PhoneField";
|
|
|
9331
9382
|
|
|
9332
9383
|
// lib/TreeSelect/TreeSelect.tsx
|
|
9333
9384
|
var import_react49 = __toESM(require("react"), 1);
|
|
9334
|
-
var
|
|
9385
|
+
var import_react_dom12 = __toESM(require("react-dom"), 1);
|
|
9335
9386
|
var import_lucide_react3 = require("lucide-react");
|
|
9336
9387
|
function nodeId(node) {
|
|
9337
9388
|
return node.id ?? node._id;
|
|
@@ -9641,11 +9692,13 @@ function TreeSelect({
|
|
|
9641
9692
|
error ? "rf-text-field--error" : "",
|
|
9642
9693
|
fullWidth ? "rf-text-field--full-width" : "",
|
|
9643
9694
|
isFloating ? "rf-text-field--floating" : "",
|
|
9695
|
+
label ? "rf-text-field--has-label" : "",
|
|
9696
|
+
"rf-text-field--adorned-end",
|
|
9644
9697
|
"rf-tree-select",
|
|
9645
9698
|
sxClass,
|
|
9646
9699
|
className
|
|
9647
9700
|
].filter(Boolean).join(" ");
|
|
9648
|
-
return /* @__PURE__ */ import_react49.default.createElement("div", { className: rootClasses, style },
|
|
9701
|
+
return /* @__PURE__ */ import_react49.default.createElement("div", { className: rootClasses, style }, /* @__PURE__ */ import_react49.default.createElement(
|
|
9649
9702
|
"div",
|
|
9650
9703
|
{
|
|
9651
9704
|
ref: triggerRef,
|
|
@@ -9657,7 +9710,7 @@ function TreeSelect({
|
|
|
9657
9710
|
onBlur: handleTriggerBlur,
|
|
9658
9711
|
onKeyDown: handleKeyDown
|
|
9659
9712
|
},
|
|
9660
|
-
isMultiple ? /* @__PURE__ */ import_react49.default.createElement("div", { className: "rf-ts__chips" }, tagNodes.length > 0 ? tagNodes.map((node) => /* @__PURE__ */ import_react49.default.createElement("span", { key: node.id, className: "rf-ts__chip" }, node.label, /* @__PURE__ */ import_react49.default.createElement(
|
|
9713
|
+
isMultiple ? /* @__PURE__ */ import_react49.default.createElement("div", { className: "rf-ts__chips" }, tagNodes.length > 0 ? tagNodes.map((node) => /* @__PURE__ */ import_react49.default.createElement("span", { key: node.id, className: "rf-ts__chip" }, node.label, !disabled && /* @__PURE__ */ import_react49.default.createElement(
|
|
9661
9714
|
"button",
|
|
9662
9715
|
{
|
|
9663
9716
|
type: "button",
|
|
@@ -9666,8 +9719,8 @@ function TreeSelect({
|
|
|
9666
9719
|
tabIndex: -1
|
|
9667
9720
|
},
|
|
9668
9721
|
/* @__PURE__ */ import_react49.default.createElement(import_lucide_react3.X, { size: 10 })
|
|
9669
|
-
))) :
|
|
9670
|
-
/* @__PURE__ */ import_react49.default.createElement("div", { className: "rf-autocomplete__endgroup" }, clearable && hasValue && /* @__PURE__ */ import_react49.default.createElement(
|
|
9722
|
+
))) : isFloating || !label ? /* @__PURE__ */ import_react49.default.createElement("span", { className: "rf-ts__placeholder" }, placeholder) : null) : /* @__PURE__ */ import_react49.default.createElement("div", { className: `rf-ts__display${!hasValue ? " rf-ts__display--placeholder" : ""}` }, hasValue ? tagNodes[0]?.label : isFloating || !label ? placeholder : "\xA0"),
|
|
9723
|
+
/* @__PURE__ */ import_react49.default.createElement("div", { className: "rf-autocomplete__endgroup" }, !disabled && clearable && hasValue && /* @__PURE__ */ import_react49.default.createElement(
|
|
9671
9724
|
"button",
|
|
9672
9725
|
{
|
|
9673
9726
|
type: "button",
|
|
@@ -9676,7 +9729,7 @@ function TreeSelect({
|
|
|
9676
9729
|
tabIndex: -1
|
|
9677
9730
|
},
|
|
9678
9731
|
/* @__PURE__ */ import_react49.default.createElement(import_lucide_react3.X, { size: 16 })
|
|
9679
|
-
), /* @__PURE__ */ import_react49.default.createElement(
|
|
9732
|
+
), !disabled && /* @__PURE__ */ import_react49.default.createElement(
|
|
9680
9733
|
"button",
|
|
9681
9734
|
{
|
|
9682
9735
|
type: "button",
|
|
@@ -9689,10 +9742,11 @@ function TreeSelect({
|
|
|
9689
9742
|
},
|
|
9690
9743
|
/* @__PURE__ */ import_react49.default.createElement(import_lucide_react3.ChevronDown, { size: 18 })
|
|
9691
9744
|
)),
|
|
9745
|
+
label && /* @__PURE__ */ import_react49.default.createElement("label", { className: "rf-text-field__label" }, label, required && /* @__PURE__ */ import_react49.default.createElement("span", { className: "rf-text-field__asterisk" }, " *")),
|
|
9692
9746
|
variant === "outlined" && /* @__PURE__ */ import_react49.default.createElement("fieldset", { "aria-hidden": true, className: "rf-text-field__notch" }, /* @__PURE__ */ import_react49.default.createElement("legend", { className: "rf-text-field__legend" }, label && /* @__PURE__ */ import_react49.default.createElement("span", null, label, required ? " *" : ""))),
|
|
9693
9747
|
variant === "filled" && /* @__PURE__ */ import_react49.default.createElement(import_react49.default.Fragment, null, /* @__PURE__ */ import_react49.default.createElement("div", { className: "rf-text-field__filled-bg" }), /* @__PURE__ */ import_react49.default.createElement("div", { className: "rf-text-field__underline" })),
|
|
9694
9748
|
variant === "standard" && /* @__PURE__ */ import_react49.default.createElement("div", { className: "rf-text-field__underline" })
|
|
9695
|
-
), helperText && /* @__PURE__ */ import_react49.default.createElement("p", { className: `rf-text-field__helper-text${error ? " rf-text-field__helper-text--error" : ""}` }, helperText), open &&
|
|
9749
|
+
), helperText && /* @__PURE__ */ import_react49.default.createElement("p", { className: `rf-text-field__helper-text${error ? " rf-text-field__helper-text--error" : ""}` }, helperText), open && import_react_dom12.default.createPortal(
|
|
9696
9750
|
/* @__PURE__ */ import_react49.default.createElement(
|
|
9697
9751
|
"div",
|
|
9698
9752
|
{
|
|
@@ -9942,11 +9996,11 @@ function SmartSelect({
|
|
|
9942
9996
|
setInputValue(inputValue2);
|
|
9943
9997
|
if (!onSearchChange) return;
|
|
9944
9998
|
if (debounceTimer.current) clearTimeout(debounceTimer.current);
|
|
9945
|
-
if (reason
|
|
9946
|
-
|
|
9947
|
-
onSearchChange("", 0);
|
|
9999
|
+
if (reason !== "input") {
|
|
10000
|
+
if (reason === "clear") onSearchChange("", 0);
|
|
9948
10001
|
return;
|
|
9949
10002
|
}
|
|
10003
|
+
if (!inputValue2) return;
|
|
9950
10004
|
const q = inputValue2.toLowerCase();
|
|
9951
10005
|
let localCount = 0;
|
|
9952
10006
|
for (const opt of flatOptionsList) {
|
|
@@ -10105,7 +10159,7 @@ function SmartSelect({
|
|
|
10105
10159
|
|
|
10106
10160
|
// lib/RufousTextEditor/RufousTextEditor.tsx
|
|
10107
10161
|
var import_react62 = __toESM(require("react"), 1);
|
|
10108
|
-
var
|
|
10162
|
+
var import_react_dom19 = require("react-dom");
|
|
10109
10163
|
var import_react63 = require("@tiptap/react");
|
|
10110
10164
|
var import_starter_kit = __toESM(require("@tiptap/starter-kit"), 1);
|
|
10111
10165
|
var import_extension_placeholder = __toESM(require("@tiptap/extension-placeholder"), 1);
|
|
@@ -10227,7 +10281,7 @@ function createMentionSuggestion(users) {
|
|
|
10227
10281
|
|
|
10228
10282
|
// lib/RufousTextEditor/Toolbar.tsx
|
|
10229
10283
|
var import_react58 = __toESM(require("react"), 1);
|
|
10230
|
-
var
|
|
10284
|
+
var import_react_dom15 = require("react-dom");
|
|
10231
10285
|
|
|
10232
10286
|
// lib/RufousTextEditor/TextToSpeech.tsx
|
|
10233
10287
|
var import_react54 = __toESM(require("react"), 1);
|
|
@@ -10538,7 +10592,7 @@ var SpeechToText_default = SpeechToText;
|
|
|
10538
10592
|
|
|
10539
10593
|
// lib/RufousTextEditor/AICommands.tsx
|
|
10540
10594
|
var import_react56 = __toESM(require("react"), 1);
|
|
10541
|
-
var
|
|
10595
|
+
var import_react_dom13 = require("react-dom");
|
|
10542
10596
|
var AI_COMMANDS = [
|
|
10543
10597
|
{ 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." },
|
|
10544
10598
|
{ 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." },
|
|
@@ -10694,7 +10748,7 @@ var AICommands = ({ editor, onAICommand }) => {
|
|
|
10694
10748
|
onClick: () => handleCommandSelect(cmd)
|
|
10695
10749
|
},
|
|
10696
10750
|
cmd.label
|
|
10697
|
-
))), /* @__PURE__ */ import_react56.default.createElement("div", { className: "ai-commands-hint" }, editor.state.selection.empty ? "Will apply to all text" : "Will apply to selected text"))), showModal && (0,
|
|
10751
|
+
))), /* @__PURE__ */ import_react56.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_dom13.createPortal)(
|
|
10698
10752
|
/* @__PURE__ */ import_react56.default.createElement("div", { className: "ai-modal-overlay", onMouseDown: handleCancel }, /* @__PURE__ */ import_react56.default.createElement("div", { className: "ai-modal", onMouseDown: (e) => e.stopPropagation() }, /* @__PURE__ */ import_react56.default.createElement("div", { className: "ai-modal-header" }, /* @__PURE__ */ import_react56.default.createElement("span", { className: "ai-modal-title" }, "AI Assistant"), /* @__PURE__ */ import_react56.default.createElement("button", { className: "ai-modal-close", onClick: handleCancel }, "\xD7")), /* @__PURE__ */ import_react56.default.createElement("div", { className: "ai-modal-prompt-section" }, /* @__PURE__ */ import_react56.default.createElement("label", { className: "ai-modal-label" }, "Prompt"), /* @__PURE__ */ import_react56.default.createElement("div", { className: "ai-modal-prompt-row" }, /* @__PURE__ */ import_react56.default.createElement(
|
|
10699
10753
|
"textarea",
|
|
10700
10754
|
{
|
|
@@ -10743,7 +10797,7 @@ var AICommands_default = AICommands;
|
|
|
10743
10797
|
|
|
10744
10798
|
// lib/RufousTextEditor/TranslateModal.tsx
|
|
10745
10799
|
var import_react57 = __toESM(require("react"), 1);
|
|
10746
|
-
var
|
|
10800
|
+
var import_react_dom14 = require("react-dom");
|
|
10747
10801
|
var LANGUAGES = [
|
|
10748
10802
|
{ code: "af", name: "Afrikaans" },
|
|
10749
10803
|
{ code: "sq", name: "Albanian" },
|
|
@@ -10934,7 +10988,7 @@ var TranslateModal = ({ editor, onClose, onTranslate, initialSource, initialTarg
|
|
|
10934
10988
|
setTranslating(false);
|
|
10935
10989
|
}
|
|
10936
10990
|
};
|
|
10937
|
-
return (0,
|
|
10991
|
+
return (0, import_react_dom14.createPortal)(
|
|
10938
10992
|
/* @__PURE__ */ import_react57.default.createElement("div", { className: "modal-overlay", onClick: onClose }, /* @__PURE__ */ import_react57.default.createElement("div", { className: "modal-content translate-modal", onClick: (e) => e.stopPropagation() }, /* @__PURE__ */ import_react57.default.createElement("div", { className: "modal-header" }, /* @__PURE__ */ import_react57.default.createElement("h3", null, "Translate options"), /* @__PURE__ */ import_react57.default.createElement("button", { className: "modal-close", onClick: onClose }, "\xD7")), /* @__PURE__ */ import_react57.default.createElement("div", { className: "modal-body" }, /* @__PURE__ */ import_react57.default.createElement("div", { className: "translate-columns" }, /* @__PURE__ */ import_react57.default.createElement("div", { className: "translate-col" }, /* @__PURE__ */ import_react57.default.createElement("div", { className: "translate-filter" }, /* @__PURE__ */ import_react57.default.createElement(
|
|
10939
10993
|
"input",
|
|
10940
10994
|
{
|
|
@@ -11843,7 +11897,7 @@ var Dropdown = ({ trigger, children, className = "", keepOpen = false }) => {
|
|
|
11843
11897
|
},
|
|
11844
11898
|
trigger.label,
|
|
11845
11899
|
/* @__PURE__ */ import_react58.default.createElement("span", { className: "dropdown-arrow" }, "\u25BE")
|
|
11846
|
-
)), open && (0,
|
|
11900
|
+
)), open && (0, import_react_dom15.createPortal)(
|
|
11847
11901
|
/* @__PURE__ */ import_react58.default.createElement("div", { className: "rf-rte-wrapper rf-rte-dropdown-portal" }, /* @__PURE__ */ import_react58.default.createElement("div", { ref: menuRef, className: "dropdown-menu dropdown-menu-fixed", onClick: keepOpen ? void 0 : () => setOpen(false) }, typeof children === "function" ? children(() => setOpen(false)) : children)),
|
|
11848
11902
|
document.body
|
|
11849
11903
|
));
|
|
@@ -12728,7 +12782,7 @@ var Toolbar_default = Toolbar;
|
|
|
12728
12782
|
|
|
12729
12783
|
// lib/RufousTextEditor/ImageToolbar.tsx
|
|
12730
12784
|
var import_react59 = __toESM(require("react"), 1);
|
|
12731
|
-
var
|
|
12785
|
+
var import_react_dom16 = require("react-dom");
|
|
12732
12786
|
var ALIGNMENTS = [
|
|
12733
12787
|
{ value: "left", label: "Left", icon: "\u2630" },
|
|
12734
12788
|
{ value: "center", label: "Center", icon: "\u2261" },
|
|
@@ -12899,7 +12953,7 @@ var ImageToolbar = ({ editor }) => {
|
|
|
12899
12953
|
}, [editor]);
|
|
12900
12954
|
const node = editor?.state.selection.node;
|
|
12901
12955
|
const isImage = node && node.type.name === "image";
|
|
12902
|
-
if (!editor || !isImage || !pos) return showModal ? (0,
|
|
12956
|
+
if (!editor || !isImage || !pos) return showModal ? (0, import_react_dom16.createPortal)(
|
|
12903
12957
|
/* @__PURE__ */ import_react59.default.createElement(ImagePropertiesModal, { editor, node, onClose: () => setShowModal(false) }),
|
|
12904
12958
|
document.body
|
|
12905
12959
|
) : null;
|
|
@@ -12976,7 +13030,7 @@ var ImageToolbar = ({ editor }) => {
|
|
|
12976
13030
|
);
|
|
12977
13031
|
setShowVAlign(false);
|
|
12978
13032
|
};
|
|
12979
|
-
return (0,
|
|
13033
|
+
return (0, import_react_dom16.createPortal)(
|
|
12980
13034
|
/* @__PURE__ */ import_react59.default.createElement(import_react59.default.Fragment, null, /* @__PURE__ */ import_react59.default.createElement(
|
|
12981
13035
|
"div",
|
|
12982
13036
|
{
|
|
@@ -13007,7 +13061,7 @@ var ImageToolbar_default = ImageToolbar;
|
|
|
13007
13061
|
|
|
13008
13062
|
// lib/RufousTextEditor/VideoToolbar.tsx
|
|
13009
13063
|
var import_react60 = __toESM(require("react"), 1);
|
|
13010
|
-
var
|
|
13064
|
+
var import_react_dom17 = require("react-dom");
|
|
13011
13065
|
var ALIGNMENTS2 = [
|
|
13012
13066
|
{ value: "left", label: "Left", icon: "\u2630" },
|
|
13013
13067
|
{ value: "center", label: "Center", icon: "\u2261" },
|
|
@@ -13152,7 +13206,7 @@ var VideoToolbar = ({ editor }) => {
|
|
|
13152
13206
|
const node = editor?.state.selection.node;
|
|
13153
13207
|
const isVideo = node && VIDEO_TYPES.includes(node.type.name);
|
|
13154
13208
|
const nodeType = node?.type.name;
|
|
13155
|
-
if (!editor || !isVideo || !pos) return showModal ? (0,
|
|
13209
|
+
if (!editor || !isVideo || !pos) return showModal ? (0, import_react_dom17.createPortal)(
|
|
13156
13210
|
/* @__PURE__ */ import_react60.default.createElement(VideoPropertiesModal, { editor, node, nodeType, onClose: () => setShowModal(false) }),
|
|
13157
13211
|
document.body
|
|
13158
13212
|
) : null;
|
|
@@ -13199,7 +13253,7 @@ var VideoToolbar = ({ editor }) => {
|
|
|
13199
13253
|
})
|
|
13200
13254
|
);
|
|
13201
13255
|
};
|
|
13202
|
-
return (0,
|
|
13256
|
+
return (0, import_react_dom17.createPortal)(
|
|
13203
13257
|
/* @__PURE__ */ import_react60.default.createElement(import_react60.default.Fragment, null, /* @__PURE__ */ import_react60.default.createElement(
|
|
13204
13258
|
"div",
|
|
13205
13259
|
{
|
|
@@ -13247,7 +13301,7 @@ var VideoToolbar_default = VideoToolbar;
|
|
|
13247
13301
|
|
|
13248
13302
|
// lib/RufousTextEditor/TableToolbar.tsx
|
|
13249
13303
|
var import_react61 = __toESM(require("react"), 1);
|
|
13250
|
-
var
|
|
13304
|
+
var import_react_dom18 = require("react-dom");
|
|
13251
13305
|
var IconAddRowBefore = () => /* @__PURE__ */ import_react61.default.createElement("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "currentColor" }, /* @__PURE__ */ import_react61.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_react61.default.createElement("path", { d: "M9 6h2v1.5h1.5v2H11V11H9V9.5H7.5v-2H9z" }));
|
|
13252
13306
|
var IconAddRowAfter = () => /* @__PURE__ */ import_react61.default.createElement("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "currentColor" }, /* @__PURE__ */ import_react61.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_react61.default.createElement("path", { d: "M9 14h2v1.5h1.5v2H11V19H9v-1.5H7.5v-2H9z" }));
|
|
13253
13307
|
var IconAddColBefore = () => /* @__PURE__ */ import_react61.default.createElement("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "currentColor" }, /* @__PURE__ */ import_react61.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_react61.default.createElement("path", { d: "M6 10h1.5v2H6v1.5H4v-2h1.5V10H4V8h2z", transform: "translate(2,1)" }));
|
|
@@ -13304,7 +13358,7 @@ var TableToolbar = ({ editor }) => {
|
|
|
13304
13358
|
const canMerge = editor.can().mergeCells();
|
|
13305
13359
|
const canSplit = editor.can().splitCell();
|
|
13306
13360
|
const prevent = (e) => e.preventDefault();
|
|
13307
|
-
return (0,
|
|
13361
|
+
return (0, import_react_dom18.createPortal)(
|
|
13308
13362
|
/* @__PURE__ */ import_react61.default.createElement(
|
|
13309
13363
|
"div",
|
|
13310
13364
|
{
|
|
@@ -13911,7 +13965,7 @@ var RufousTextEditor = ({
|
|
|
13911
13965
|
},
|
|
13912
13966
|
"\u201C Quote"
|
|
13913
13967
|
)
|
|
13914
|
-
), /* @__PURE__ */ import_react62.default.createElement("div", { className: "status-bar" }, /* @__PURE__ */ import_react62.default.createElement("div", { className: "status-bar-left" }, onSaveProp && /* @__PURE__ */ import_react62.default.createElement("button", { onClick: handleSave, className: "status-btn save-btn" }, "Save"), onExportProp && /* @__PURE__ */ import_react62.default.createElement("button", { onClick: handleExport, className: "status-btn export-btn" }, "Export")), /* @__PURE__ */ import_react62.default.createElement("div", { className: "status-bar-right" }, saveStatus && /* @__PURE__ */ import_react62.default.createElement("span", { className: "save-status" }, saveStatus), editor && /* @__PURE__ */ import_react62.default.createElement(import_react62.default.Fragment, null, /* @__PURE__ */ import_react62.default.createElement("span", { className: "word-count" }, "CHARS: ", editor.storage.characterCount?.characters?.() ?? editor.getText().length), /* @__PURE__ */ import_react62.default.createElement("span", { className: "word-count" }, "WORDS: ", editor.storage.characterCount?.words?.() ?? editor.getText().split(/\s+/).filter(Boolean).length)))), linkModalOpen && (0,
|
|
13968
|
+
), /* @__PURE__ */ import_react62.default.createElement("div", { className: "status-bar" }, /* @__PURE__ */ import_react62.default.createElement("div", { className: "status-bar-left" }, onSaveProp && /* @__PURE__ */ import_react62.default.createElement("button", { onClick: handleSave, className: "status-btn save-btn" }, "Save"), onExportProp && /* @__PURE__ */ import_react62.default.createElement("button", { onClick: handleExport, className: "status-btn export-btn" }, "Export")), /* @__PURE__ */ import_react62.default.createElement("div", { className: "status-bar-right" }, saveStatus && /* @__PURE__ */ import_react62.default.createElement("span", { className: "save-status" }, saveStatus), editor && /* @__PURE__ */ import_react62.default.createElement(import_react62.default.Fragment, null, /* @__PURE__ */ import_react62.default.createElement("span", { className: "word-count" }, "CHARS: ", editor.storage.characterCount?.characters?.() ?? editor.getText().length), /* @__PURE__ */ import_react62.default.createElement("span", { className: "word-count" }, "WORDS: ", editor.storage.characterCount?.words?.() ?? editor.getText().split(/\s+/).filter(Boolean).length)))), linkModalOpen && (0, import_react_dom19.createPortal)(
|
|
13915
13969
|
/* @__PURE__ */ import_react62.default.createElement("div", { className: "link-modal-overlay", onClick: handleLinkCancel }, /* @__PURE__ */ import_react62.default.createElement("div", { className: "link-modal", onClick: (e) => e.stopPropagation() }, /* @__PURE__ */ import_react62.default.createElement("div", { className: "link-modal-body" }, /* @__PURE__ */ import_react62.default.createElement("div", { className: "link-modal-field" }, /* @__PURE__ */ import_react62.default.createElement("label", { className: "link-modal-label" }, "URL"), /* @__PURE__ */ import_react62.default.createElement(
|
|
13916
13970
|
"input",
|
|
13917
13971
|
{
|
|
@@ -13956,7 +14010,7 @@ var RufousTextEditor = ({
|
|
|
13956
14010
|
)),
|
|
13957
14011
|
helperText && /* @__PURE__ */ import_react62.default.createElement("div", { className: `rf-rte-helper-text ${error ? "rf-rte-helper-error" : ""}` }, helperText)
|
|
13958
14012
|
);
|
|
13959
|
-
return isFullscreen ? (0,
|
|
14013
|
+
return isFullscreen ? (0, import_react_dom19.createPortal)(wrapperJsx, document.body) : wrapperJsx;
|
|
13960
14014
|
};
|
|
13961
14015
|
var RufousTextContent = ({ content, className, style, sx }) => {
|
|
13962
14016
|
const sxClass = useSx(sx);
|
package/dist/main.css
CHANGED
|
@@ -6944,6 +6944,12 @@ pre {
|
|
|
6944
6944
|
.rf-text-field__input:focus::placeholder {
|
|
6945
6945
|
opacity: 1;
|
|
6946
6946
|
}
|
|
6947
|
+
.rf-text-field:not(.rf-text-field--has-label) .rf-text-field__input::placeholder {
|
|
6948
|
+
opacity: 1;
|
|
6949
|
+
}
|
|
6950
|
+
.rf-text-field__legend--empty {
|
|
6951
|
+
display: none;
|
|
6952
|
+
}
|
|
6947
6953
|
.rf-text-field__helper-text {
|
|
6948
6954
|
color: var(--tf-placeholder-color);
|
|
6949
6955
|
font-size: 0.75rem;
|
package/dist/main.d.cts
CHANGED
|
@@ -714,8 +714,8 @@ interface AutocompleteProps<T = string> {
|
|
|
714
714
|
onChange?: (event: React__default.SyntheticEvent, value: T | T[] | null, reason: 'selectOption' | 'removeOption' | 'clear' | 'freeSolo') => void;
|
|
715
715
|
/** Controlled text in the input */
|
|
716
716
|
inputValue?: string;
|
|
717
|
-
/** Called on every keystroke — receives the native event
|
|
718
|
-
onInputChange?: (event: React__default.SyntheticEvent | null, value: string) => void;
|
|
717
|
+
/** Called on every keystroke or when input resets — receives the native event, new input string, and reason */
|
|
718
|
+
onInputChange?: (event: React__default.SyntheticEvent | null, value: string, reason: 'input' | 'reset' | 'clear') => void;
|
|
719
719
|
/** Return the string label for an option */
|
|
720
720
|
getOptionLabel?: (option: T) => string;
|
|
721
721
|
/** Decide equality between option and value (useful for objects) */
|
package/dist/main.d.ts
CHANGED
|
@@ -714,8 +714,8 @@ interface AutocompleteProps<T = string> {
|
|
|
714
714
|
onChange?: (event: React__default.SyntheticEvent, value: T | T[] | null, reason: 'selectOption' | 'removeOption' | 'clear' | 'freeSolo') => void;
|
|
715
715
|
/** Controlled text in the input */
|
|
716
716
|
inputValue?: string;
|
|
717
|
-
/** Called on every keystroke — receives the native event
|
|
718
|
-
onInputChange?: (event: React__default.SyntheticEvent | null, value: string) => void;
|
|
717
|
+
/** Called on every keystroke or when input resets — receives the native event, new input string, and reason */
|
|
718
|
+
onInputChange?: (event: React__default.SyntheticEvent | null, value: string, reason: 'input' | 'reset' | 'clear') => void;
|
|
719
719
|
/** Return the string label for an option */
|
|
720
720
|
getOptionLabel?: (option: T) => string;
|
|
721
721
|
/** Decide equality between option and value (useful for objects) */
|
package/dist/main.js
CHANGED
|
@@ -1659,12 +1659,6 @@ var STEP_BY_VARIANT = {
|
|
|
1659
1659
|
"positive-integer": 1,
|
|
1660
1660
|
"positive-decimal": 0.1
|
|
1661
1661
|
};
|
|
1662
|
-
var MIN_BY_VARIANT = {
|
|
1663
|
-
"integer": void 0,
|
|
1664
|
-
"decimal": void 0,
|
|
1665
|
-
"positive-integer": 0,
|
|
1666
|
-
"positive-decimal": 0
|
|
1667
|
-
};
|
|
1668
1662
|
var TextField = forwardRef3(({
|
|
1669
1663
|
label,
|
|
1670
1664
|
name,
|
|
@@ -1753,21 +1747,23 @@ var TextField = forwardRef3(({
|
|
|
1753
1747
|
}
|
|
1754
1748
|
}
|
|
1755
1749
|
};
|
|
1750
|
+
const stepBy = (delta) => {
|
|
1751
|
+
if (!internalRef.current) return;
|
|
1752
|
+
const step = Number(stepProp ?? (numberVariant ? STEP_BY_VARIANT[numberVariant] : 1));
|
|
1753
|
+
const newVal = (parseFloat(internalRef.current.value) || 0) + delta * step;
|
|
1754
|
+
const nativeInputValueSetter = Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype, "value")?.set;
|
|
1755
|
+
nativeInputValueSetter?.call(internalRef.current, String(newVal));
|
|
1756
|
+
triggerChange();
|
|
1757
|
+
};
|
|
1756
1758
|
const handleIncrement = (e) => {
|
|
1757
1759
|
e.preventDefault();
|
|
1758
1760
|
e.stopPropagation();
|
|
1759
|
-
|
|
1760
|
-
internalRef.current.stepUp();
|
|
1761
|
-
triggerChange();
|
|
1762
|
-
}
|
|
1761
|
+
stepBy(1);
|
|
1763
1762
|
};
|
|
1764
1763
|
const handleDecrement = (e) => {
|
|
1765
1764
|
e.preventDefault();
|
|
1766
1765
|
e.stopPropagation();
|
|
1767
|
-
|
|
1768
|
-
internalRef.current.stepDown();
|
|
1769
|
-
triggerChange();
|
|
1770
|
-
}
|
|
1766
|
+
stepBy(-1);
|
|
1771
1767
|
};
|
|
1772
1768
|
const handleKeyDown = (e) => {
|
|
1773
1769
|
if (type === "number") {
|
|
@@ -1778,16 +1774,10 @@ var TextField = forwardRef3(({
|
|
|
1778
1774
|
}
|
|
1779
1775
|
if (e.key === "ArrowUp") {
|
|
1780
1776
|
e.preventDefault();
|
|
1781
|
-
|
|
1782
|
-
internalRef.current.stepUp();
|
|
1783
|
-
triggerChange();
|
|
1784
|
-
}
|
|
1777
|
+
stepBy(1);
|
|
1785
1778
|
} else if (e.key === "ArrowDown") {
|
|
1786
1779
|
e.preventDefault();
|
|
1787
|
-
|
|
1788
|
-
internalRef.current.stepDown();
|
|
1789
|
-
triggerChange();
|
|
1790
|
-
}
|
|
1780
|
+
stepBy(-1);
|
|
1791
1781
|
}
|
|
1792
1782
|
}
|
|
1793
1783
|
if (props.onKeyDown) props.onKeyDown(e);
|
|
@@ -1813,18 +1803,24 @@ var TextField = forwardRef3(({
|
|
|
1813
1803
|
"input",
|
|
1814
1804
|
{
|
|
1815
1805
|
ref: internalRef,
|
|
1816
|
-
type,
|
|
1806
|
+
type: type === "number" ? "text" : type,
|
|
1807
|
+
inputMode: type === "number" ? "numeric" : void 0,
|
|
1817
1808
|
onKeyDown: handleKeyDown,
|
|
1818
1809
|
className: "rf-text-field__input",
|
|
1819
1810
|
placeholder: placeholder || (variant === "outlined" ? " " : void 0),
|
|
1820
1811
|
name,
|
|
1821
1812
|
id: inputId,
|
|
1822
|
-
value
|
|
1813
|
+
value: (() => {
|
|
1814
|
+
if (type !== "number" || value === void 0 || value === null || value === "") return value;
|
|
1815
|
+
const str = String(value);
|
|
1816
|
+
if (!str.includes("e") && !str.includes("E")) return str;
|
|
1817
|
+
const num = Number(str);
|
|
1818
|
+
if (isNaN(num)) return str;
|
|
1819
|
+
return num.toLocaleString("en-US", { useGrouping: false, maximumFractionDigits: 20 });
|
|
1820
|
+
})(),
|
|
1823
1821
|
required,
|
|
1824
1822
|
disabled,
|
|
1825
1823
|
readOnly,
|
|
1826
|
-
step: type === "number" ? stepProp ?? (numberVariant ? STEP_BY_VARIANT[numberVariant] : void 0) : void 0,
|
|
1827
|
-
min: type === "number" && numberVariant ? MIN_BY_VARIANT[numberVariant] : void 0,
|
|
1828
1824
|
...slotProps?.input,
|
|
1829
1825
|
...props,
|
|
1830
1826
|
onChange: handleChange
|
|
@@ -2247,7 +2243,7 @@ function AutocompleteInner(props, _ref) {
|
|
|
2247
2243
|
onClose?.();
|
|
2248
2244
|
if (!justSelected && !freeSolo && !multiple && value == null) {
|
|
2249
2245
|
setInputStr("");
|
|
2250
|
-
onInputChange?.(null, "");
|
|
2246
|
+
onInputChange?.(null, "", "reset");
|
|
2251
2247
|
}
|
|
2252
2248
|
}, [openProp, freeSolo, multiple, value, onInputChange, onClose]);
|
|
2253
2249
|
useEffect5(() => {
|
|
@@ -2292,13 +2288,13 @@ function AutocompleteInner(props, _ref) {
|
|
|
2292
2288
|
onChange?.(event, next, already ? "removeOption" : "selectOption");
|
|
2293
2289
|
setInputStr("");
|
|
2294
2290
|
setFilterQuery("");
|
|
2295
|
-
onInputChange?.(event, "");
|
|
2291
|
+
onInputChange?.(event, "", "reset");
|
|
2296
2292
|
inputRef.current?.focus();
|
|
2297
2293
|
} else {
|
|
2298
2294
|
onChange?.(event, opt, "selectOption");
|
|
2299
2295
|
setInputStr(getOptionLabel(opt));
|
|
2300
2296
|
setFilterQuery("");
|
|
2301
|
-
onInputChange?.(event, getOptionLabel(opt));
|
|
2297
|
+
onInputChange?.(event, getOptionLabel(opt), "reset");
|
|
2302
2298
|
closePopup(true);
|
|
2303
2299
|
}
|
|
2304
2300
|
setFocusedIdx(-1);
|
|
@@ -2308,7 +2304,7 @@ function AutocompleteInner(props, _ref) {
|
|
|
2308
2304
|
onChange?.(e, multiple ? [] : null, "clear");
|
|
2309
2305
|
setInputStr("");
|
|
2310
2306
|
setFilterQuery("");
|
|
2311
|
-
onInputChange?.(e, "");
|
|
2307
|
+
onInputChange?.(e, "", "clear");
|
|
2312
2308
|
inputRef.current?.focus();
|
|
2313
2309
|
};
|
|
2314
2310
|
const removeTag = (opt, e) => {
|
|
@@ -2320,7 +2316,7 @@ function AutocompleteInner(props, _ref) {
|
|
|
2320
2316
|
const v = e.target.value;
|
|
2321
2317
|
setInputStr(v);
|
|
2322
2318
|
setFilterQuery(v);
|
|
2323
|
-
onInputChange?.(e, v);
|
|
2319
|
+
onInputChange?.(e, v, "input");
|
|
2324
2320
|
if (!open) openPopup();
|
|
2325
2321
|
};
|
|
2326
2322
|
const handleKeyDown = (e) => {
|
|
@@ -2407,7 +2403,7 @@ function AutocompleteInner(props, _ref) {
|
|
|
2407
2403
|
multiple && (renderTags ? renderTags(selectedValues, ({ index }) => ({
|
|
2408
2404
|
key: index,
|
|
2409
2405
|
onDelete: (e) => removeTag(selectedValues[index], e)
|
|
2410
|
-
})) : /* @__PURE__ */ React70.createElement(React70.Fragment, null, visibleTags.map((opt, i) => /* @__PURE__ */ React70.createElement("span", { key: i, className: "rf-autocomplete__tag" }, /* @__PURE__ */ React70.createElement("span", { style: { overflow: "hidden", textOverflow: "ellipsis" } }, getOptionLabel(opt)), /* @__PURE__ */ React70.createElement(
|
|
2406
|
+
})) : /* @__PURE__ */ React70.createElement(React70.Fragment, null, visibleTags.map((opt, i) => /* @__PURE__ */ React70.createElement("span", { key: i, className: "rf-autocomplete__tag" }, /* @__PURE__ */ React70.createElement("span", { style: { overflow: "hidden", textOverflow: "ellipsis" } }, getOptionLabel(opt)), !disabled && /* @__PURE__ */ React70.createElement(
|
|
2411
2407
|
"button",
|
|
2412
2408
|
{
|
|
2413
2409
|
type: "button",
|
|
@@ -2460,7 +2456,7 @@ function AutocompleteInner(props, _ref) {
|
|
|
2460
2456
|
"aria-label": "Clear"
|
|
2461
2457
|
},
|
|
2462
2458
|
/* @__PURE__ */ React70.createElement(CloseSmIcon, { size: 16 })
|
|
2463
|
-
), !freeSolo && /* @__PURE__ */ React70.createElement(
|
|
2459
|
+
), !freeSolo && !disabled && /* @__PURE__ */ React70.createElement(
|
|
2464
2460
|
"button",
|
|
2465
2461
|
{
|
|
2466
2462
|
type: "button",
|
|
@@ -3640,16 +3636,15 @@ var DateField = ({
|
|
|
3640
3636
|
}
|
|
3641
3637
|
}
|
|
3642
3638
|
),
|
|
3643
|
-
/* @__PURE__ */ React72.createElement("div", { className: "rf-text-field__adornment rf-text-field__adornment--end" }, /* @__PURE__ */ React72.createElement(
|
|
3639
|
+
!disabled && /* @__PURE__ */ React72.createElement("div", { className: "rf-text-field__adornment rf-text-field__adornment--end" }, /* @__PURE__ */ React72.createElement(
|
|
3644
3640
|
"button",
|
|
3645
3641
|
{
|
|
3646
3642
|
type: "button",
|
|
3647
3643
|
className: "rf-date-field__icon-btn",
|
|
3648
3644
|
tabIndex: -1,
|
|
3649
|
-
disabled,
|
|
3650
3645
|
onClick: (e) => {
|
|
3651
3646
|
e.stopPropagation();
|
|
3652
|
-
|
|
3647
|
+
setOpen((o) => !o);
|
|
3653
3648
|
},
|
|
3654
3649
|
"aria-label": "Pick date"
|
|
3655
3650
|
},
|
|
@@ -4253,16 +4248,15 @@ var DateRangeField = ({
|
|
|
4253
4248
|
}
|
|
4254
4249
|
}
|
|
4255
4250
|
),
|
|
4256
|
-
/* @__PURE__ */ React73.createElement("div", { className: "rf-text-field__adornment rf-text-field__adornment--end" }, /* @__PURE__ */ React73.createElement(
|
|
4251
|
+
!disabled && /* @__PURE__ */ React73.createElement("div", { className: "rf-text-field__adornment rf-text-field__adornment--end" }, /* @__PURE__ */ React73.createElement(
|
|
4257
4252
|
"button",
|
|
4258
4253
|
{
|
|
4259
4254
|
type: "button",
|
|
4260
4255
|
className: "rf-date-field__icon-btn",
|
|
4261
4256
|
tabIndex: -1,
|
|
4262
|
-
disabled,
|
|
4263
4257
|
onClick: (e) => {
|
|
4264
4258
|
e.stopPropagation();
|
|
4265
|
-
|
|
4259
|
+
setOpen((o) => !o);
|
|
4266
4260
|
},
|
|
4267
4261
|
"aria-label": "Pick date range"
|
|
4268
4262
|
},
|
|
@@ -4456,6 +4450,7 @@ var RufousLogoLoader = ({ size = 80, sx, className }) => {
|
|
|
4456
4450
|
|
|
4457
4451
|
// lib/DataGrid/DataGrid.tsx
|
|
4458
4452
|
import React75, { useState as useState9, useMemo as useMemo2, useRef as useRef10, useEffect as useEffect9 } from "react";
|
|
4453
|
+
import ReactDOM4 from "react-dom";
|
|
4459
4454
|
import {
|
|
4460
4455
|
ChevronUp,
|
|
4461
4456
|
ChevronDown,
|
|
@@ -4468,6 +4463,7 @@ import {
|
|
|
4468
4463
|
X as X2,
|
|
4469
4464
|
Pin,
|
|
4470
4465
|
EyeOff,
|
|
4466
|
+
Eye,
|
|
4471
4467
|
Columns,
|
|
4472
4468
|
ArrowUp,
|
|
4473
4469
|
ArrowDown,
|
|
@@ -4476,6 +4472,57 @@ import {
|
|
|
4476
4472
|
ChevronsUpDown,
|
|
4477
4473
|
Layers
|
|
4478
4474
|
} from "lucide-react";
|
|
4475
|
+
function OverflowTooltip({ content }) {
|
|
4476
|
+
const ref = useRef10(null);
|
|
4477
|
+
const [pos, setPos] = useState9(null);
|
|
4478
|
+
return /* @__PURE__ */ React75.createElement(React75.Fragment, null, /* @__PURE__ */ React75.createElement(
|
|
4479
|
+
"span",
|
|
4480
|
+
{
|
|
4481
|
+
ref,
|
|
4482
|
+
onMouseEnter: () => {
|
|
4483
|
+
if (ref.current && ref.current.scrollWidth > ref.current.clientWidth) {
|
|
4484
|
+
const r = ref.current.getBoundingClientRect();
|
|
4485
|
+
setPos({ top: r.top, left: r.left + r.width / 2 });
|
|
4486
|
+
}
|
|
4487
|
+
},
|
|
4488
|
+
onMouseLeave: () => setPos(null),
|
|
4489
|
+
style: { display: "block", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }
|
|
4490
|
+
},
|
|
4491
|
+
content
|
|
4492
|
+
), pos && ReactDOM4.createPortal(
|
|
4493
|
+
/* @__PURE__ */ React75.createElement("div", { style: {
|
|
4494
|
+
position: "fixed",
|
|
4495
|
+
top: pos.top - 4,
|
|
4496
|
+
left: pos.left,
|
|
4497
|
+
transform: "translate(-50%, -100%)",
|
|
4498
|
+
background: "rgba(0,0,0,0.75)",
|
|
4499
|
+
color: "#fff",
|
|
4500
|
+
padding: "4px 8px",
|
|
4501
|
+
borderRadius: 4,
|
|
4502
|
+
fontSize: "0.75rem",
|
|
4503
|
+
maxWidth: 320,
|
|
4504
|
+
wordBreak: "break-word",
|
|
4505
|
+
zIndex: 9999,
|
|
4506
|
+
pointerEvents: "none",
|
|
4507
|
+
whiteSpace: "normal"
|
|
4508
|
+
} }, content),
|
|
4509
|
+
document.body
|
|
4510
|
+
));
|
|
4511
|
+
}
|
|
4512
|
+
function formatCellValue(value, colType) {
|
|
4513
|
+
if (value == null) return "";
|
|
4514
|
+
if (colType === "number") {
|
|
4515
|
+
const num = Number(value);
|
|
4516
|
+
if (!isNaN(num)) {
|
|
4517
|
+
const str = String(num);
|
|
4518
|
+
if (str.includes("e") || str.includes("E")) {
|
|
4519
|
+
return num.toLocaleString("en-US", { useGrouping: false, maximumFractionDigits: 20 });
|
|
4520
|
+
}
|
|
4521
|
+
return str;
|
|
4522
|
+
}
|
|
4523
|
+
}
|
|
4524
|
+
return String(value);
|
|
4525
|
+
}
|
|
4479
4526
|
function getAllGroupIds(rows, fields, getKey, depth = 0, parentId = "") {
|
|
4480
4527
|
if (!fields.length || !rows.length) return [];
|
|
4481
4528
|
const [field, ...rest] = fields;
|
|
@@ -4790,6 +4837,8 @@ function DataGrid({
|
|
|
4790
4837
|
});
|
|
4791
4838
|
useEffect9(() => {
|
|
4792
4839
|
onFiltersChangeRef.current?.(advancedFilters);
|
|
4840
|
+
setCurrentPage(1);
|
|
4841
|
+
if (onPaginationModelChange) onPaginationModelChange({ page: 0, pageSize: activePageSize });
|
|
4793
4842
|
}, [advancedFilters]);
|
|
4794
4843
|
const handleSort = (fieldKey, dir) => {
|
|
4795
4844
|
if (dir !== void 0) {
|
|
@@ -5151,6 +5200,7 @@ function DataGrid({
|
|
|
5151
5200
|
onChange: (e) => {
|
|
5152
5201
|
setFilterText(e.target.value);
|
|
5153
5202
|
setCurrentPage(1);
|
|
5203
|
+
if (onPaginationModelChange) onPaginationModelChange({ page: 0, pageSize: activePageSize });
|
|
5154
5204
|
}
|
|
5155
5205
|
}
|
|
5156
5206
|
)), showFilterBtn && /* @__PURE__ */ React75.createElement(Tooltip, { title: "Filters", placement: "top" }, /* @__PURE__ */ React75.createElement(
|
|
@@ -5358,7 +5408,7 @@ function DataGrid({
|
|
|
5358
5408
|
const formattedValue = col.valueFormatter ? col.valueFormatter({ value, row: item, field }) : value;
|
|
5359
5409
|
if (col.renderCell) return col.renderCell({ value, row: item, field });
|
|
5360
5410
|
if (col.render) return col.render(value, item);
|
|
5361
|
-
return
|
|
5411
|
+
return /* @__PURE__ */ React75.createElement(OverflowTooltip, { content: formatCellValue(formattedValue, col.type) });
|
|
5362
5412
|
})()
|
|
5363
5413
|
);
|
|
5364
5414
|
}), actions && /* @__PURE__ */ React75.createElement("td", { className: "dg-row-actions-cell" }, (() => {
|
|
@@ -5427,7 +5477,7 @@ function DataGrid({
|
|
|
5427
5477
|
setActiveMenu(null);
|
|
5428
5478
|
} }, /* @__PURE__ */ React75.createElement(Layers, { size: 14 }), " Group by");
|
|
5429
5479
|
})(),
|
|
5430
|
-
/* @__PURE__ */ React75.createElement("button", { className: "dg-menu-item", onClick: () => toggleHide(activeMenu) }, /* @__PURE__ */ React75.createElement(EyeOff, { size: 14 }), " Hide column"),
|
|
5480
|
+
activeMenuCol?.hideable !== false && /* @__PURE__ */ React75.createElement("button", { className: "dg-menu-item", onClick: () => toggleHide(activeMenu) }, /* @__PURE__ */ React75.createElement(EyeOff, { size: 14 }), " Hide column"),
|
|
5431
5481
|
/* @__PURE__ */ React75.createElement("button", { className: "dg-menu-item", onClick: () => {
|
|
5432
5482
|
setShowManageColumns(true);
|
|
5433
5483
|
setActiveMenu(null);
|
|
@@ -5444,7 +5494,7 @@ function DataGrid({
|
|
|
5444
5494
|
)), resolvedColumns.filter((c) => c.header.toLowerCase().includes(colSearch.toLowerCase())).map((col) => {
|
|
5445
5495
|
const key = String(col.key);
|
|
5446
5496
|
const isUnhideable = col.hideable === false;
|
|
5447
|
-
return /* @__PURE__ */ React75.createElement("div", { key, className: `dg-col-row${isUnhideable ? " disabled" : ""}` }, /* @__PURE__ */ React75.createElement("div", { className: "dg-col-label" }, /* @__PURE__ */ React75.createElement("div", { className: "dg-col-dot", style: { background: col.hidden ? "var(--border-color)" : "var(--primary-color)" } }), col.header), !isUnhideable && /* @__PURE__ */ React75.createElement("button", { className: "dg-icon-btn", onClick: () => toggleHide(key) }, col.hidden ? /* @__PURE__ */ React75.createElement(EyeOff, { size: 14 }) : /* @__PURE__ */ React75.createElement(
|
|
5497
|
+
return /* @__PURE__ */ React75.createElement("div", { key, className: `dg-col-row${isUnhideable ? " disabled" : ""}` }, /* @__PURE__ */ React75.createElement("div", { className: "dg-col-label" }, /* @__PURE__ */ React75.createElement("div", { className: "dg-col-dot", style: { background: col.hidden ? "var(--border-color)" : "var(--primary-color)" } }), col.header), !isUnhideable && /* @__PURE__ */ React75.createElement("button", { className: "dg-icon-btn", onClick: () => toggleHide(key) }, col.hidden ? /* @__PURE__ */ React75.createElement(EyeOff, { size: 14 }) : /* @__PURE__ */ React75.createElement(Eye, { size: 14 })));
|
|
5448
5498
|
})), /* @__PURE__ */ React75.createElement("div", { className: "dg-modal-footer" }, /* @__PURE__ */ React75.createElement("button", { className: "dg-action-btn", onClick: () => setColumnOverrides((prev) => {
|
|
5449
5499
|
const next = { ...prev };
|
|
5450
5500
|
resolvedColumns.forEach((c) => {
|
|
@@ -5504,7 +5554,9 @@ function DataGrid({
|
|
|
5504
5554
|
value: f.value,
|
|
5505
5555
|
onChange: (val) => setAdvancedFilters((p) => p.map((fi, i) => i === idx ? { ...fi, value: val } : fi)),
|
|
5506
5556
|
variant: "compact",
|
|
5507
|
-
fullWidth: true
|
|
5557
|
+
fullWidth: true,
|
|
5558
|
+
dateFormat: "DD/MM/YYYY",
|
|
5559
|
+
placeholder: "DD/MM/YYYY"
|
|
5508
5560
|
}
|
|
5509
5561
|
)), !hideValue && col?.type === "status" && (() => {
|
|
5510
5562
|
const opts = col.statusOptions || [...new Set(data.map((item) => String(item[col.field || col.key || ""])))].filter((v) => v && v !== "undefined" && v !== "null").sort();
|
|
@@ -5563,7 +5615,7 @@ import React76, {
|
|
|
5563
5615
|
useEffect as useEffect10,
|
|
5564
5616
|
useCallback as useCallback5
|
|
5565
5617
|
} from "react";
|
|
5566
|
-
import
|
|
5618
|
+
import ReactDOM5 from "react-dom";
|
|
5567
5619
|
var ChevronDownIcon2 = () => /* @__PURE__ */ React76.createElement("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React76.createElement("polyline", { points: "6 9 12 15 18 9" }));
|
|
5568
5620
|
var CheckIcon2 = () => /* @__PURE__ */ React76.createElement("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React76.createElement("polyline", { points: "20 6 9 17 4 12" }));
|
|
5569
5621
|
function normaliseOptions(options) {
|
|
@@ -5772,10 +5824,10 @@ var Select = React76.forwardRef(function Select2(props, ref) {
|
|
|
5772
5824
|
renderDisplay(),
|
|
5773
5825
|
label && /* @__PURE__ */ React76.createElement("label", { id: inputId, className: "rf-text-field__label" }, label, required && /* @__PURE__ */ React76.createElement("span", { className: "rf-text-field__asterisk" }, " *")),
|
|
5774
5826
|
variant === "outlined" && /* @__PURE__ */ React76.createElement("fieldset", { className: "rf-text-field__notch" }, label ? /* @__PURE__ */ React76.createElement("legend", { className: "rf-text-field__legend" }, /* @__PURE__ */ React76.createElement("span", null, label, required ? " *" : "")) : /* @__PURE__ */ React76.createElement("legend", { className: "rf-text-field__legend--empty" })),
|
|
5775
|
-
/* @__PURE__ */ React76.createElement("div", { className: "rf-select__arrow", "aria-hidden": "true" }, /* @__PURE__ */ React76.createElement(ChevronDownIcon2, null))
|
|
5827
|
+
!disabled && /* @__PURE__ */ React76.createElement("div", { className: "rf-select__arrow", "aria-hidden": "true" }, /* @__PURE__ */ React76.createElement(ChevronDownIcon2, null))
|
|
5776
5828
|
),
|
|
5777
5829
|
helperText && /* @__PURE__ */ React76.createElement("div", { className: `rf-text-field__helper-text${error ? " rf-text-field__helper-text--error" : ""}` }, helperText),
|
|
5778
|
-
open && !disabled &&
|
|
5830
|
+
open && !disabled && ReactDOM5.createPortal(
|
|
5779
5831
|
/* @__PURE__ */ React76.createElement("div", { ref: popupRef, className: "rf-select__popup", role: "presentation", style: popupStyle }, /* @__PURE__ */ React76.createElement("ul", { ref: listRef, className: "rf-select__listbox", role: "listbox", "aria-multiselectable": multiple }, (() => {
|
|
5780
5832
|
const renderOpt = (opt, selectableIdx) => {
|
|
5781
5833
|
const selected = isSelected(opt.value);
|
|
@@ -7892,7 +7944,7 @@ import React97, {
|
|
|
7892
7944
|
useRef as useRef17,
|
|
7893
7945
|
useState as useState17
|
|
7894
7946
|
} from "react";
|
|
7895
|
-
import
|
|
7947
|
+
import ReactDOM6 from "react-dom";
|
|
7896
7948
|
var MenuDivider = () => /* @__PURE__ */ React97.createElement("hr", { className: "rf-menu-divider", "aria-hidden": "true" });
|
|
7897
7949
|
MenuDivider.displayName = "MenuDivider";
|
|
7898
7950
|
var MenuItem = ({
|
|
@@ -8045,7 +8097,7 @@ var Menu = ({
|
|
|
8045
8097
|
},
|
|
8046
8098
|
children
|
|
8047
8099
|
));
|
|
8048
|
-
return
|
|
8100
|
+
return ReactDOM6.createPortal(portal, document.body);
|
|
8049
8101
|
};
|
|
8050
8102
|
Menu.displayName = "Menu";
|
|
8051
8103
|
|
|
@@ -8054,7 +8106,7 @@ import React98, {
|
|
|
8054
8106
|
useEffect as useEffect14,
|
|
8055
8107
|
useState as useState18
|
|
8056
8108
|
} from "react";
|
|
8057
|
-
import
|
|
8109
|
+
import ReactDOM7 from "react-dom";
|
|
8058
8110
|
var Drawer = ({
|
|
8059
8111
|
open,
|
|
8060
8112
|
onClose,
|
|
@@ -8154,7 +8206,7 @@ var Drawer = ({
|
|
|
8154
8206
|
},
|
|
8155
8207
|
children
|
|
8156
8208
|
));
|
|
8157
|
-
return
|
|
8209
|
+
return ReactDOM7.createPortal(
|
|
8158
8210
|
/* @__PURE__ */ React98.createElement("div", { className: rootClasses, style }, drawerContent),
|
|
8159
8211
|
document.body
|
|
8160
8212
|
);
|
|
@@ -8168,7 +8220,7 @@ import React99, {
|
|
|
8168
8220
|
useRef as useRef18,
|
|
8169
8221
|
useState as useState19
|
|
8170
8222
|
} from "react";
|
|
8171
|
-
import
|
|
8223
|
+
import ReactDOM8 from "react-dom";
|
|
8172
8224
|
var SEVERITY_ICONS = {
|
|
8173
8225
|
success: "\u2713",
|
|
8174
8226
|
error: "\u2715",
|
|
@@ -8273,7 +8325,7 @@ var Snackbar = ({
|
|
|
8273
8325
|
"\u2715"
|
|
8274
8326
|
)
|
|
8275
8327
|
));
|
|
8276
|
-
return
|
|
8328
|
+
return ReactDOM8.createPortal(snackbarEl, document.body);
|
|
8277
8329
|
};
|
|
8278
8330
|
Snackbar.displayName = "Snackbar";
|
|
8279
8331
|
|
|
@@ -8332,7 +8384,7 @@ import React101, {
|
|
|
8332
8384
|
useRef as useRef19,
|
|
8333
8385
|
useState as useState20
|
|
8334
8386
|
} from "react";
|
|
8335
|
-
import
|
|
8387
|
+
import ReactDOM9 from "react-dom";
|
|
8336
8388
|
function computePopperPosition(anchorRect, popperRect, placement, offset2 = [0, 8]) {
|
|
8337
8389
|
const [skid, dist] = offset2;
|
|
8338
8390
|
let top = 0;
|
|
@@ -8475,7 +8527,7 @@ var Popper = ({
|
|
|
8475
8527
|
if (disablePortal) {
|
|
8476
8528
|
return /* @__PURE__ */ React101.createElement(React101.Fragment, null, popper);
|
|
8477
8529
|
}
|
|
8478
|
-
return
|
|
8530
|
+
return ReactDOM9.createPortal(popper, document.body);
|
|
8479
8531
|
};
|
|
8480
8532
|
Popper.displayName = "Popper";
|
|
8481
8533
|
|
|
@@ -8486,7 +8538,7 @@ import React102, {
|
|
|
8486
8538
|
useRef as useRef20,
|
|
8487
8539
|
useState as useState21
|
|
8488
8540
|
} from "react";
|
|
8489
|
-
import
|
|
8541
|
+
import ReactDOM10 from "react-dom";
|
|
8490
8542
|
function getPoint(rect, v, h) {
|
|
8491
8543
|
const x = h === "left" ? rect.left : h === "center" ? rect.left + rect.width / 2 : rect.right;
|
|
8492
8544
|
const y = v === "top" ? rect.top : v === "center" ? rect.top + rect.height / 2 : rect.bottom;
|
|
@@ -8589,7 +8641,7 @@ var Popover = ({
|
|
|
8589
8641
|
if (disablePortal) {
|
|
8590
8642
|
return /* @__PURE__ */ React102.createElement("div", { className: `${rootClasses} rf-popover-inline`, style }, content);
|
|
8591
8643
|
}
|
|
8592
|
-
return
|
|
8644
|
+
return ReactDOM10.createPortal(
|
|
8593
8645
|
/* @__PURE__ */ React102.createElement("div", { className: rootClasses, style }, content),
|
|
8594
8646
|
document.body
|
|
8595
8647
|
);
|
|
@@ -9256,7 +9308,7 @@ import React106, {
|
|
|
9256
9308
|
useEffect as useEffect20,
|
|
9257
9309
|
useCallback as useCallback10
|
|
9258
9310
|
} from "react";
|
|
9259
|
-
import
|
|
9311
|
+
import ReactDOM11 from "react-dom";
|
|
9260
9312
|
import { ChevronDown as ChevronDown2, ChevronRight as ChevronRight2, X as X3, Search as Search2, Check, Minus } from "lucide-react";
|
|
9261
9313
|
function nodeId(node) {
|
|
9262
9314
|
return node.id ?? node._id;
|
|
@@ -9566,11 +9618,13 @@ function TreeSelect({
|
|
|
9566
9618
|
error ? "rf-text-field--error" : "",
|
|
9567
9619
|
fullWidth ? "rf-text-field--full-width" : "",
|
|
9568
9620
|
isFloating ? "rf-text-field--floating" : "",
|
|
9621
|
+
label ? "rf-text-field--has-label" : "",
|
|
9622
|
+
"rf-text-field--adorned-end",
|
|
9569
9623
|
"rf-tree-select",
|
|
9570
9624
|
sxClass,
|
|
9571
9625
|
className
|
|
9572
9626
|
].filter(Boolean).join(" ");
|
|
9573
|
-
return /* @__PURE__ */ React106.createElement("div", { className: rootClasses, style },
|
|
9627
|
+
return /* @__PURE__ */ React106.createElement("div", { className: rootClasses, style }, /* @__PURE__ */ React106.createElement(
|
|
9574
9628
|
"div",
|
|
9575
9629
|
{
|
|
9576
9630
|
ref: triggerRef,
|
|
@@ -9582,7 +9636,7 @@ function TreeSelect({
|
|
|
9582
9636
|
onBlur: handleTriggerBlur,
|
|
9583
9637
|
onKeyDown: handleKeyDown
|
|
9584
9638
|
},
|
|
9585
|
-
isMultiple ? /* @__PURE__ */ React106.createElement("div", { className: "rf-ts__chips" }, tagNodes.length > 0 ? tagNodes.map((node) => /* @__PURE__ */ React106.createElement("span", { key: node.id, className: "rf-ts__chip" }, node.label, /* @__PURE__ */ React106.createElement(
|
|
9639
|
+
isMultiple ? /* @__PURE__ */ React106.createElement("div", { className: "rf-ts__chips" }, tagNodes.length > 0 ? tagNodes.map((node) => /* @__PURE__ */ React106.createElement("span", { key: node.id, className: "rf-ts__chip" }, node.label, !disabled && /* @__PURE__ */ React106.createElement(
|
|
9586
9640
|
"button",
|
|
9587
9641
|
{
|
|
9588
9642
|
type: "button",
|
|
@@ -9591,8 +9645,8 @@ function TreeSelect({
|
|
|
9591
9645
|
tabIndex: -1
|
|
9592
9646
|
},
|
|
9593
9647
|
/* @__PURE__ */ React106.createElement(X3, { size: 10 })
|
|
9594
|
-
))) :
|
|
9595
|
-
/* @__PURE__ */ React106.createElement("div", { className: "rf-autocomplete__endgroup" }, clearable && hasValue && /* @__PURE__ */ React106.createElement(
|
|
9648
|
+
))) : isFloating || !label ? /* @__PURE__ */ React106.createElement("span", { className: "rf-ts__placeholder" }, placeholder) : null) : /* @__PURE__ */ React106.createElement("div", { className: `rf-ts__display${!hasValue ? " rf-ts__display--placeholder" : ""}` }, hasValue ? tagNodes[0]?.label : isFloating || !label ? placeholder : "\xA0"),
|
|
9649
|
+
/* @__PURE__ */ React106.createElement("div", { className: "rf-autocomplete__endgroup" }, !disabled && clearable && hasValue && /* @__PURE__ */ React106.createElement(
|
|
9596
9650
|
"button",
|
|
9597
9651
|
{
|
|
9598
9652
|
type: "button",
|
|
@@ -9601,7 +9655,7 @@ function TreeSelect({
|
|
|
9601
9655
|
tabIndex: -1
|
|
9602
9656
|
},
|
|
9603
9657
|
/* @__PURE__ */ React106.createElement(X3, { size: 16 })
|
|
9604
|
-
), /* @__PURE__ */ React106.createElement(
|
|
9658
|
+
), !disabled && /* @__PURE__ */ React106.createElement(
|
|
9605
9659
|
"button",
|
|
9606
9660
|
{
|
|
9607
9661
|
type: "button",
|
|
@@ -9614,10 +9668,11 @@ function TreeSelect({
|
|
|
9614
9668
|
},
|
|
9615
9669
|
/* @__PURE__ */ React106.createElement(ChevronDown2, { size: 18 })
|
|
9616
9670
|
)),
|
|
9671
|
+
label && /* @__PURE__ */ React106.createElement("label", { className: "rf-text-field__label" }, label, required && /* @__PURE__ */ React106.createElement("span", { className: "rf-text-field__asterisk" }, " *")),
|
|
9617
9672
|
variant === "outlined" && /* @__PURE__ */ React106.createElement("fieldset", { "aria-hidden": true, className: "rf-text-field__notch" }, /* @__PURE__ */ React106.createElement("legend", { className: "rf-text-field__legend" }, label && /* @__PURE__ */ React106.createElement("span", null, label, required ? " *" : ""))),
|
|
9618
9673
|
variant === "filled" && /* @__PURE__ */ React106.createElement(React106.Fragment, null, /* @__PURE__ */ React106.createElement("div", { className: "rf-text-field__filled-bg" }), /* @__PURE__ */ React106.createElement("div", { className: "rf-text-field__underline" })),
|
|
9619
9674
|
variant === "standard" && /* @__PURE__ */ React106.createElement("div", { className: "rf-text-field__underline" })
|
|
9620
|
-
), helperText && /* @__PURE__ */ React106.createElement("p", { className: `rf-text-field__helper-text${error ? " rf-text-field__helper-text--error" : ""}` }, helperText), open &&
|
|
9675
|
+
), helperText && /* @__PURE__ */ React106.createElement("p", { className: `rf-text-field__helper-text${error ? " rf-text-field__helper-text--error" : ""}` }, helperText), open && ReactDOM11.createPortal(
|
|
9621
9676
|
/* @__PURE__ */ React106.createElement(
|
|
9622
9677
|
"div",
|
|
9623
9678
|
{
|
|
@@ -9867,11 +9922,11 @@ function SmartSelect({
|
|
|
9867
9922
|
setInputValue(inputValue2);
|
|
9868
9923
|
if (!onSearchChange) return;
|
|
9869
9924
|
if (debounceTimer.current) clearTimeout(debounceTimer.current);
|
|
9870
|
-
if (reason
|
|
9871
|
-
|
|
9872
|
-
onSearchChange("", 0);
|
|
9925
|
+
if (reason !== "input") {
|
|
9926
|
+
if (reason === "clear") onSearchChange("", 0);
|
|
9873
9927
|
return;
|
|
9874
9928
|
}
|
|
9929
|
+
if (!inputValue2) return;
|
|
9875
9930
|
const q = inputValue2.toLowerCase();
|
|
9876
9931
|
let localCount = 0;
|
|
9877
9932
|
for (const opt of flatOptionsList) {
|