@rufous/ui 0.2.81 → 0.2.82
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 +623 -733
- package/dist/main.js +628 -738
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -3870,7 +3870,7 @@ var RufousLogoLoader = ({ size = 80, sx, className }) => {
|
|
|
3870
3870
|
};
|
|
3871
3871
|
|
|
3872
3872
|
// lib/DataGrid/DataGrid.tsx
|
|
3873
|
-
import
|
|
3873
|
+
import React75, { useState as useState9, useMemo as useMemo2, useRef as useRef9, useEffect as useEffect9 } from "react";
|
|
3874
3874
|
import {
|
|
3875
3875
|
ChevronUp,
|
|
3876
3876
|
ChevronDown,
|
|
@@ -3889,6 +3889,238 @@ import {
|
|
|
3889
3889
|
Trash2,
|
|
3890
3890
|
Plus
|
|
3891
3891
|
} from "lucide-react";
|
|
3892
|
+
|
|
3893
|
+
// lib/Tooltip/Tooltip.tsx
|
|
3894
|
+
import React74, {
|
|
3895
|
+
useCallback as useCallback3,
|
|
3896
|
+
useEffect as useEffect8,
|
|
3897
|
+
useRef as useRef8,
|
|
3898
|
+
useState as useState8
|
|
3899
|
+
} from "react";
|
|
3900
|
+
import ReactDOM3 from "react-dom";
|
|
3901
|
+
var GAP = 8;
|
|
3902
|
+
function computePosition(anchor, tooltip, placement) {
|
|
3903
|
+
const { top: aTop, left: aLeft, width: aW, height: aH } = anchor;
|
|
3904
|
+
const { width: tW, height: tH } = tooltip;
|
|
3905
|
+
let top = 0;
|
|
3906
|
+
let left = 0;
|
|
3907
|
+
let arrowLeft;
|
|
3908
|
+
let arrowTop;
|
|
3909
|
+
switch (placement) {
|
|
3910
|
+
case "top":
|
|
3911
|
+
top = aTop - tH - GAP;
|
|
3912
|
+
left = aLeft + aW / 2 - tW / 2;
|
|
3913
|
+
arrowLeft = tW / 2 - 4;
|
|
3914
|
+
break;
|
|
3915
|
+
case "top-start":
|
|
3916
|
+
top = aTop - tH - GAP;
|
|
3917
|
+
left = aLeft;
|
|
3918
|
+
arrowLeft = Math.min(aW / 2, tW - 16);
|
|
3919
|
+
break;
|
|
3920
|
+
case "top-end":
|
|
3921
|
+
top = aTop - tH - GAP;
|
|
3922
|
+
left = aLeft + aW - tW;
|
|
3923
|
+
arrowLeft = Math.max(tW - aW / 2 - 4, 8);
|
|
3924
|
+
break;
|
|
3925
|
+
case "bottom":
|
|
3926
|
+
top = aTop + aH + GAP;
|
|
3927
|
+
left = aLeft + aW / 2 - tW / 2;
|
|
3928
|
+
arrowLeft = tW / 2 - 4;
|
|
3929
|
+
break;
|
|
3930
|
+
case "bottom-start":
|
|
3931
|
+
top = aTop + aH + GAP;
|
|
3932
|
+
left = aLeft;
|
|
3933
|
+
arrowLeft = Math.min(aW / 2, tW - 16);
|
|
3934
|
+
break;
|
|
3935
|
+
case "bottom-end":
|
|
3936
|
+
top = aTop + aH + GAP;
|
|
3937
|
+
left = aLeft + aW - tW;
|
|
3938
|
+
arrowLeft = Math.max(tW - aW / 2 - 4, 8);
|
|
3939
|
+
break;
|
|
3940
|
+
case "left":
|
|
3941
|
+
top = aTop + aH / 2 - tH / 2;
|
|
3942
|
+
left = aLeft - tW - GAP;
|
|
3943
|
+
arrowTop = tH / 2 - 4;
|
|
3944
|
+
break;
|
|
3945
|
+
case "left-start":
|
|
3946
|
+
top = aTop;
|
|
3947
|
+
left = aLeft - tW - GAP;
|
|
3948
|
+
arrowTop = Math.min(aH / 2, tH - 16);
|
|
3949
|
+
break;
|
|
3950
|
+
case "left-end":
|
|
3951
|
+
top = aTop + aH - tH;
|
|
3952
|
+
left = aLeft - tW - GAP;
|
|
3953
|
+
arrowTop = Math.max(tH - aH / 2 - 4, 8);
|
|
3954
|
+
break;
|
|
3955
|
+
case "right":
|
|
3956
|
+
top = aTop + aH / 2 - tH / 2;
|
|
3957
|
+
left = aLeft + aW + GAP;
|
|
3958
|
+
arrowTop = tH / 2 - 4;
|
|
3959
|
+
break;
|
|
3960
|
+
case "right-start":
|
|
3961
|
+
top = aTop;
|
|
3962
|
+
left = aLeft + aW + GAP;
|
|
3963
|
+
arrowTop = Math.min(aH / 2, tH - 16);
|
|
3964
|
+
break;
|
|
3965
|
+
case "right-end":
|
|
3966
|
+
top = aTop + aH - tH;
|
|
3967
|
+
left = aLeft + aW + GAP;
|
|
3968
|
+
arrowTop = Math.max(tH - aH / 2 - 4, 8);
|
|
3969
|
+
break;
|
|
3970
|
+
default:
|
|
3971
|
+
top = aTop - tH - GAP;
|
|
3972
|
+
left = aLeft + aW / 2 - tW / 2;
|
|
3973
|
+
}
|
|
3974
|
+
const vw = window.innerWidth;
|
|
3975
|
+
const vh = window.innerHeight;
|
|
3976
|
+
left = Math.max(8, Math.min(left, vw - tW - 8));
|
|
3977
|
+
top = Math.max(8, Math.min(top, vh - tH - 8));
|
|
3978
|
+
return { top, left, arrowLeft, arrowTop };
|
|
3979
|
+
}
|
|
3980
|
+
var Tooltip = ({
|
|
3981
|
+
title,
|
|
3982
|
+
placement = "top",
|
|
3983
|
+
arrow = false,
|
|
3984
|
+
open: controlledOpen,
|
|
3985
|
+
disableHoverListener = false,
|
|
3986
|
+
disableFocusListener = false,
|
|
3987
|
+
enterDelay = 100,
|
|
3988
|
+
leaveDelay = 0,
|
|
3989
|
+
children,
|
|
3990
|
+
followCursor = false,
|
|
3991
|
+
className = "",
|
|
3992
|
+
style,
|
|
3993
|
+
sx
|
|
3994
|
+
}) => {
|
|
3995
|
+
const sxClass = useSx(sx);
|
|
3996
|
+
const [internalOpen, setInternalOpen] = useState8(false);
|
|
3997
|
+
const [position, setPosition] = useState8({ top: 0, left: 0 });
|
|
3998
|
+
const anchorRef = useRef8(null);
|
|
3999
|
+
const tooltipRef = useRef8(null);
|
|
4000
|
+
const enterTimer = useRef8(null);
|
|
4001
|
+
const leaveTimer = useRef8(null);
|
|
4002
|
+
const cursorPos = useRef8({ x: 0, y: 0 });
|
|
4003
|
+
const isOpen = controlledOpen !== void 0 ? controlledOpen : internalOpen;
|
|
4004
|
+
const clearTimers = useCallback3(() => {
|
|
4005
|
+
if (enterTimer.current) clearTimeout(enterTimer.current);
|
|
4006
|
+
if (leaveTimer.current) clearTimeout(leaveTimer.current);
|
|
4007
|
+
}, []);
|
|
4008
|
+
const updatePosition = useCallback3(() => {
|
|
4009
|
+
if (!anchorRef.current || !tooltipRef.current) return;
|
|
4010
|
+
const anchorRect = anchorRef.current.getBoundingClientRect();
|
|
4011
|
+
const tooltipRect = tooltipRef.current.getBoundingClientRect();
|
|
4012
|
+
if (followCursor) {
|
|
4013
|
+
const fakeRect = {
|
|
4014
|
+
top: cursorPos.current.y,
|
|
4015
|
+
left: cursorPos.current.x,
|
|
4016
|
+
right: cursorPos.current.x,
|
|
4017
|
+
bottom: cursorPos.current.y,
|
|
4018
|
+
width: 0,
|
|
4019
|
+
height: 0,
|
|
4020
|
+
x: cursorPos.current.x,
|
|
4021
|
+
y: cursorPos.current.y,
|
|
4022
|
+
toJSON: () => ({})
|
|
4023
|
+
};
|
|
4024
|
+
setPosition(computePosition(fakeRect, tooltipRect, placement));
|
|
4025
|
+
} else {
|
|
4026
|
+
setPosition(computePosition(anchorRect, tooltipRect, placement));
|
|
4027
|
+
}
|
|
4028
|
+
}, [placement, followCursor]);
|
|
4029
|
+
useEffect8(() => {
|
|
4030
|
+
if (isOpen) {
|
|
4031
|
+
requestAnimationFrame(() => {
|
|
4032
|
+
updatePosition();
|
|
4033
|
+
});
|
|
4034
|
+
}
|
|
4035
|
+
}, [isOpen, updatePosition]);
|
|
4036
|
+
const handleOpen = useCallback3(() => {
|
|
4037
|
+
clearTimers();
|
|
4038
|
+
if (enterDelay > 0) {
|
|
4039
|
+
enterTimer.current = setTimeout(() => {
|
|
4040
|
+
setInternalOpen(true);
|
|
4041
|
+
}, enterDelay);
|
|
4042
|
+
} else {
|
|
4043
|
+
setInternalOpen(true);
|
|
4044
|
+
}
|
|
4045
|
+
}, [enterDelay, clearTimers]);
|
|
4046
|
+
const handleClose = useCallback3(() => {
|
|
4047
|
+
clearTimers();
|
|
4048
|
+
if (leaveDelay > 0) {
|
|
4049
|
+
leaveTimer.current = setTimeout(() => {
|
|
4050
|
+
setInternalOpen(false);
|
|
4051
|
+
}, leaveDelay);
|
|
4052
|
+
} else {
|
|
4053
|
+
setInternalOpen(false);
|
|
4054
|
+
}
|
|
4055
|
+
}, [leaveDelay, clearTimers]);
|
|
4056
|
+
const handleMouseMove = useCallback3(
|
|
4057
|
+
(e) => {
|
|
4058
|
+
cursorPos.current = { x: e.clientX, y: e.clientY };
|
|
4059
|
+
if (isOpen && followCursor) {
|
|
4060
|
+
updatePosition();
|
|
4061
|
+
}
|
|
4062
|
+
},
|
|
4063
|
+
[isOpen, followCursor, updatePosition]
|
|
4064
|
+
);
|
|
4065
|
+
useEffect8(() => {
|
|
4066
|
+
return () => clearTimers();
|
|
4067
|
+
}, [clearTimers]);
|
|
4068
|
+
const childProps = {};
|
|
4069
|
+
if (!disableHoverListener) {
|
|
4070
|
+
childProps.onMouseEnter = handleOpen;
|
|
4071
|
+
childProps.onMouseLeave = handleClose;
|
|
4072
|
+
childProps.onMouseMove = followCursor ? handleMouseMove : void 0;
|
|
4073
|
+
}
|
|
4074
|
+
if (!disableFocusListener) {
|
|
4075
|
+
childProps.onFocus = handleOpen;
|
|
4076
|
+
childProps.onBlur = handleClose;
|
|
4077
|
+
}
|
|
4078
|
+
const tooltipClasses = [
|
|
4079
|
+
"rf-tooltip",
|
|
4080
|
+
`rf-tooltip--placement-${placement}`,
|
|
4081
|
+
isOpen ? "rf-tooltip--visible" : "",
|
|
4082
|
+
sxClass,
|
|
4083
|
+
className
|
|
4084
|
+
].filter(Boolean).join(" ");
|
|
4085
|
+
const tooltipElement = /* @__PURE__ */ React74.createElement(
|
|
4086
|
+
"div",
|
|
4087
|
+
{
|
|
4088
|
+
ref: tooltipRef,
|
|
4089
|
+
className: tooltipClasses,
|
|
4090
|
+
style: {
|
|
4091
|
+
top: position.top,
|
|
4092
|
+
left: position.left,
|
|
4093
|
+
...style
|
|
4094
|
+
},
|
|
4095
|
+
role: "tooltip",
|
|
4096
|
+
"aria-hidden": !isOpen
|
|
4097
|
+
},
|
|
4098
|
+
title,
|
|
4099
|
+
arrow && /* @__PURE__ */ React74.createElement(
|
|
4100
|
+
"span",
|
|
4101
|
+
{
|
|
4102
|
+
className: "rf-tooltip__arrow",
|
|
4103
|
+
style: {
|
|
4104
|
+
...position.arrowLeft !== void 0 ? { left: position.arrowLeft } : {},
|
|
4105
|
+
...position.arrowTop !== void 0 ? { top: position.arrowTop } : {}
|
|
4106
|
+
}
|
|
4107
|
+
}
|
|
4108
|
+
)
|
|
4109
|
+
);
|
|
4110
|
+
return /* @__PURE__ */ React74.createElement(React74.Fragment, null, /* @__PURE__ */ React74.createElement(
|
|
4111
|
+
"span",
|
|
4112
|
+
{
|
|
4113
|
+
ref: anchorRef,
|
|
4114
|
+
style: { display: "inline-flex", position: "relative" },
|
|
4115
|
+
"aria-describedby": isOpen ? "rf-tooltip" : void 0,
|
|
4116
|
+
...childProps
|
|
4117
|
+
},
|
|
4118
|
+
React74.cloneElement(children)
|
|
4119
|
+
), ReactDOM3.createPortal(tooltipElement, document.body));
|
|
4120
|
+
};
|
|
4121
|
+
Tooltip.displayName = "Tooltip";
|
|
4122
|
+
|
|
4123
|
+
// lib/DataGrid/DataGrid.tsx
|
|
3892
4124
|
var getOperatorsForType = (type) => {
|
|
3893
4125
|
if (type === "date") return [
|
|
3894
4126
|
{ value: "is", label: "is" },
|
|
@@ -3944,7 +4176,7 @@ function DataGrid({
|
|
|
3944
4176
|
sx
|
|
3945
4177
|
}) {
|
|
3946
4178
|
const sxClass = useSx(sx);
|
|
3947
|
-
const [columnOverrides, setColumnOverrides] =
|
|
4179
|
+
const [columnOverrides, setColumnOverrides] = useState9({});
|
|
3948
4180
|
const resolvedColumns = useMemo2(() => {
|
|
3949
4181
|
return initialColumnsProp.map((col) => {
|
|
3950
4182
|
const field = String(col.field || col.key || "");
|
|
@@ -3958,7 +4190,7 @@ function DataGrid({
|
|
|
3958
4190
|
};
|
|
3959
4191
|
});
|
|
3960
4192
|
}, [initialColumnsProp, columnOverrides]);
|
|
3961
|
-
const [columnWidths, setColumnWidths] =
|
|
4193
|
+
const [columnWidths, setColumnWidths] = useState9(() => {
|
|
3962
4194
|
const widths = {};
|
|
3963
4195
|
initialColumnsProp.forEach((col) => {
|
|
3964
4196
|
const field = String(col.field || col.key || "");
|
|
@@ -3967,26 +4199,26 @@ function DataGrid({
|
|
|
3967
4199
|
});
|
|
3968
4200
|
return widths;
|
|
3969
4201
|
});
|
|
3970
|
-
const [pageSize, setPageSize] =
|
|
3971
|
-
const [sortField, setSortField] =
|
|
3972
|
-
const [sortDirection, setSortDirection] =
|
|
3973
|
-
const [filterText, setFilterText] =
|
|
3974
|
-
const [currentPage, setCurrentPage] =
|
|
3975
|
-
const [columnFilters, setColumnFilters] =
|
|
3976
|
-
const [resizingColumn, setResizingColumn] =
|
|
3977
|
-
const [startX, setStartX] =
|
|
3978
|
-
const [startWidth, setStartWidth] =
|
|
3979
|
-
const [activeMenu, setActiveMenu] =
|
|
3980
|
-
const [menuPosition, setMenuPosition] =
|
|
3981
|
-
const menuRef =
|
|
3982
|
-
const [showManageColumns, setShowManageColumns] =
|
|
3983
|
-
const [showAdvancedFilter, setShowAdvancedFilter] =
|
|
4202
|
+
const [pageSize, setPageSize] = useState9(initialPageSize);
|
|
4203
|
+
const [sortField, setSortField] = useState9(null);
|
|
4204
|
+
const [sortDirection, setSortDirection] = useState9(null);
|
|
4205
|
+
const [filterText, setFilterText] = useState9("");
|
|
4206
|
+
const [currentPage, setCurrentPage] = useState9(1);
|
|
4207
|
+
const [columnFilters, setColumnFilters] = useState9({});
|
|
4208
|
+
const [resizingColumn, setResizingColumn] = useState9(null);
|
|
4209
|
+
const [startX, setStartX] = useState9(0);
|
|
4210
|
+
const [startWidth, setStartWidth] = useState9(0);
|
|
4211
|
+
const [activeMenu, setActiveMenu] = useState9(null);
|
|
4212
|
+
const [menuPosition, setMenuPosition] = useState9({ top: 0, left: 0 });
|
|
4213
|
+
const menuRef = useRef9(null);
|
|
4214
|
+
const [showManageColumns, setShowManageColumns] = useState9(false);
|
|
4215
|
+
const [showAdvancedFilter, setShowAdvancedFilter] = useState9(false);
|
|
3984
4216
|
const initialFilterCol = String(initialColumnsProp[0]?.field || initialColumnsProp[0]?.key || "");
|
|
3985
|
-
const [advancedFilters, setAdvancedFilters] =
|
|
4217
|
+
const [advancedFilters, setAdvancedFilters] = useState9([
|
|
3986
4218
|
{ column: initialFilterCol, operator: getDefaultOperator(initialColumnsProp[0]?.type), value: "", logic: "AND" }
|
|
3987
4219
|
]);
|
|
3988
|
-
const [colSearch, setColSearch] =
|
|
3989
|
-
|
|
4220
|
+
const [colSearch, setColSearch] = useState9("");
|
|
4221
|
+
useEffect9(() => {
|
|
3990
4222
|
const handleMouseMove = (e) => {
|
|
3991
4223
|
if (!resizingColumn) return;
|
|
3992
4224
|
const col = resolvedColumns.find((c) => String(c.field) === resizingColumn);
|
|
@@ -4006,7 +4238,7 @@ function DataGrid({
|
|
|
4006
4238
|
document.removeEventListener("mouseup", handleMouseUp);
|
|
4007
4239
|
};
|
|
4008
4240
|
}, [resizingColumn, startX, startWidth, resolvedColumns]);
|
|
4009
|
-
|
|
4241
|
+
useEffect9(() => {
|
|
4010
4242
|
const handleClickOutside = (e) => {
|
|
4011
4243
|
if (menuRef.current && !menuRef.current.contains(e.target)) {
|
|
4012
4244
|
setActiveMenu(null);
|
|
@@ -4015,7 +4247,7 @@ function DataGrid({
|
|
|
4015
4247
|
document.addEventListener("mousedown", handleClickOutside);
|
|
4016
4248
|
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
4017
4249
|
}, []);
|
|
4018
|
-
|
|
4250
|
+
useEffect9(() => {
|
|
4019
4251
|
setColumnWidths((prev) => {
|
|
4020
4252
|
const next = { ...prev };
|
|
4021
4253
|
initialColumnsProp.forEach((col) => {
|
|
@@ -4252,7 +4484,7 @@ function DataGrid({
|
|
|
4252
4484
|
return offset2;
|
|
4253
4485
|
};
|
|
4254
4486
|
const hasActiveFilters = advancedFilters.some((f) => f.value);
|
|
4255
|
-
return /* @__PURE__ */
|
|
4487
|
+
return /* @__PURE__ */ React75.createElement("div", { className: ["dg-root", sxClass, className].filter(Boolean).join(" ") }, /* @__PURE__ */ React75.createElement("div", { className: "dg-header" }, /* @__PURE__ */ React75.createElement("div", { className: "dg-header-info" }, /* @__PURE__ */ React75.createElement("h2", null, title), /* @__PURE__ */ React75.createElement("p", null, filteredData.length, " total records")), /* @__PURE__ */ React75.createElement("div", { className: "dg-header-actions" }, /* @__PURE__ */ React75.createElement("div", { className: "dg-search-wrap" }, /* @__PURE__ */ React75.createElement(Search, { size: 15 }), /* @__PURE__ */ React75.createElement(
|
|
4256
4488
|
"input",
|
|
4257
4489
|
{
|
|
4258
4490
|
className: "dg-search",
|
|
@@ -4263,52 +4495,50 @@ function DataGrid({
|
|
|
4263
4495
|
setCurrentPage(1);
|
|
4264
4496
|
}
|
|
4265
4497
|
}
|
|
4266
|
-
)), /* @__PURE__ */
|
|
4498
|
+
)), /* @__PURE__ */ React75.createElement(Tooltip, { title: "Filters", placement: "top" }, /* @__PURE__ */ React75.createElement(
|
|
4267
4499
|
"button",
|
|
4268
4500
|
{
|
|
4269
4501
|
className: `dg-icon-btn ${hasActiveFilters ? "active" : ""}`,
|
|
4270
|
-
onClick: () => setShowAdvancedFilter(true)
|
|
4271
|
-
title: "Filters"
|
|
4502
|
+
onClick: () => setShowAdvancedFilter(true)
|
|
4272
4503
|
},
|
|
4273
|
-
/* @__PURE__ */
|
|
4274
|
-
), /* @__PURE__ */
|
|
4504
|
+
/* @__PURE__ */ React75.createElement(Filter, { size: 16 })
|
|
4505
|
+
)), /* @__PURE__ */ React75.createElement(Tooltip, { title: "Manage Columns", placement: "top" }, /* @__PURE__ */ React75.createElement(
|
|
4275
4506
|
"button",
|
|
4276
4507
|
{
|
|
4277
4508
|
className: "dg-icon-btn",
|
|
4278
|
-
onClick: () => setShowManageColumns(true)
|
|
4279
|
-
title: "Manage Columns"
|
|
4509
|
+
onClick: () => setShowManageColumns(true)
|
|
4280
4510
|
},
|
|
4281
|
-
/* @__PURE__ */
|
|
4282
|
-
), /* @__PURE__ */
|
|
4511
|
+
/* @__PURE__ */ React75.createElement(Columns, { size: 16 })
|
|
4512
|
+
)), /* @__PURE__ */ React75.createElement("button", { className: "dg-action-btn", onClick: handleExport }, /* @__PURE__ */ React75.createElement(Download, { size: 14 }), " Export CSV"))), /* @__PURE__ */ React75.createElement("div", { className: "dg-table-wrap" }, /* @__PURE__ */ React75.createElement("table", { className: "dg-table" }, /* @__PURE__ */ React75.createElement("thead", null, /* @__PURE__ */ React75.createElement("tr", null, visibleColumns.map((col, idx) => {
|
|
4283
4513
|
const colField = String(col.field);
|
|
4284
4514
|
const width = columnWidths[colField] || 200;
|
|
4285
4515
|
const leftOffset = getLeftOffset(col, idx);
|
|
4286
4516
|
const rightOffset = getRightOffset(col, idx);
|
|
4287
4517
|
const isSorted = sortField === col.field;
|
|
4288
|
-
return /* @__PURE__ */
|
|
4518
|
+
return /* @__PURE__ */ React75.createElement(
|
|
4289
4519
|
"th",
|
|
4290
4520
|
{
|
|
4291
4521
|
key: colField,
|
|
4292
4522
|
className: `dg-thead-cell${col.pinned === "left" ? " pinned-left" : col.pinned === "right" ? " pinned-right" : ""} ${col.headerClassName || ""}`,
|
|
4293
4523
|
style: { width, minWidth: width, left: leftOffset, right: rightOffset, flex: col.flex }
|
|
4294
4524
|
},
|
|
4295
|
-
/* @__PURE__ */
|
|
4525
|
+
/* @__PURE__ */ React75.createElement("div", { className: "dg-th-inner" }, /* @__PURE__ */ React75.createElement(
|
|
4296
4526
|
"div",
|
|
4297
4527
|
{
|
|
4298
4528
|
className: `dg-th-label${col.sortable === false ? " no-sort" : ""}`,
|
|
4299
4529
|
onClick: () => col.sortable !== false && handleSort(col.field || "")
|
|
4300
4530
|
},
|
|
4301
4531
|
col.headerName,
|
|
4302
|
-
isSorted && sortDirection === "asc" && /* @__PURE__ */
|
|
4303
|
-
isSorted && sortDirection === "desc" && /* @__PURE__ */
|
|
4304
|
-
), /* @__PURE__ */
|
|
4532
|
+
isSorted && sortDirection === "asc" && /* @__PURE__ */ React75.createElement(ChevronUp, { size: 12 }),
|
|
4533
|
+
isSorted && sortDirection === "desc" && /* @__PURE__ */ React75.createElement(ChevronDown, { size: 12 })
|
|
4534
|
+
), /* @__PURE__ */ React75.createElement("div", { className: "dg-th-actions" }, !col.disableColumnMenu && /* @__PURE__ */ React75.createElement(
|
|
4305
4535
|
"button",
|
|
4306
4536
|
{
|
|
4307
4537
|
className: "dg-th-menu-btn",
|
|
4308
4538
|
onClick: (e) => handleMenuOpen(e, colField)
|
|
4309
4539
|
},
|
|
4310
|
-
/* @__PURE__ */
|
|
4311
|
-
), /* @__PURE__ */
|
|
4540
|
+
/* @__PURE__ */ React75.createElement(MoreVertical, { size: 13 })
|
|
4541
|
+
), /* @__PURE__ */ React75.createElement(
|
|
4312
4542
|
"div",
|
|
4313
4543
|
{
|
|
4314
4544
|
className: `dg-resizer${resizingColumn === colField ? " resizing" : ""}`,
|
|
@@ -4321,12 +4551,12 @@ function DataGrid({
|
|
|
4321
4551
|
}
|
|
4322
4552
|
)))
|
|
4323
4553
|
);
|
|
4324
|
-
}), actions && /* @__PURE__ */
|
|
4554
|
+
}), actions && /* @__PURE__ */ React75.createElement("th", { style: { width: 0, padding: 0 } }))), /* @__PURE__ */ React75.createElement("tbody", null, paginatedData.length === 0 ? /* @__PURE__ */ React75.createElement("tr", null, /* @__PURE__ */ React75.createElement("td", { colSpan: visibleColumns.length + (actions ? 1 : 0), className: "dg-empty" }, "No records found")) : paginatedData.map((item) => /* @__PURE__ */ React75.createElement("tr", { key: item.id, className: "dg-tbody-row" }, visibleColumns.map((col, idx) => {
|
|
4325
4555
|
const colField = String(col.field);
|
|
4326
4556
|
const width = columnWidths[colField] || 200;
|
|
4327
4557
|
const leftOffset = getLeftOffset(col, idx);
|
|
4328
4558
|
const rightOffset = getRightOffset(col, idx);
|
|
4329
|
-
return /* @__PURE__ */
|
|
4559
|
+
return /* @__PURE__ */ React75.createElement(
|
|
4330
4560
|
"td",
|
|
4331
4561
|
{
|
|
4332
4562
|
key: `${item.id}-${colField}`,
|
|
@@ -4347,22 +4577,20 @@ function DataGrid({
|
|
|
4347
4577
|
return String(formattedValue ?? "");
|
|
4348
4578
|
})()
|
|
4349
4579
|
);
|
|
4350
|
-
}), actions && /* @__PURE__ */
|
|
4580
|
+
}), actions && /* @__PURE__ */ React75.createElement("td", { className: "dg-row-actions-cell" }, (() => {
|
|
4351
4581
|
const resolvedActions = typeof actions === "function" ? actions(item) : actions;
|
|
4352
4582
|
const visibleActions = resolvedActions.filter((a) => !a.show || a.show(item));
|
|
4353
4583
|
if (visibleActions.length === 0) return null;
|
|
4354
|
-
return /* @__PURE__ */
|
|
4584
|
+
return /* @__PURE__ */ React75.createElement("div", { className: "dg-row-actions" }, /* @__PURE__ */ React75.createElement("div", { className: "dg-action-group" }, visibleActions.map((action, i) => /* @__PURE__ */ React75.createElement(Tooltip, { key: i, title: action.label, placement: "top" }, /* @__PURE__ */ React75.createElement(
|
|
4355
4585
|
"button",
|
|
4356
4586
|
{
|
|
4357
|
-
key: i,
|
|
4358
4587
|
className: "dg-row-action-btn",
|
|
4359
4588
|
style: { color: action.color || "var(--text-secondary)" },
|
|
4360
|
-
onClick: () => action.onClick(item)
|
|
4361
|
-
title: action.label
|
|
4589
|
+
onClick: () => action.onClick(item)
|
|
4362
4590
|
},
|
|
4363
4591
|
action.icon
|
|
4364
|
-
))));
|
|
4365
|
-
})())))))), /* @__PURE__ */
|
|
4592
|
+
)))));
|
|
4593
|
+
})())))))), /* @__PURE__ */ React75.createElement("div", { className: "dg-pagination" }, /* @__PURE__ */ React75.createElement("div", { className: "dg-page-info" }, /* @__PURE__ */ React75.createElement("div", { className: "dg-per-page" }, /* @__PURE__ */ React75.createElement("span", null, "Rows per page:"), /* @__PURE__ */ React75.createElement(
|
|
4366
4594
|
"select",
|
|
4367
4595
|
{
|
|
4368
4596
|
value: pageSize,
|
|
@@ -4371,8 +4599,8 @@ function DataGrid({
|
|
|
4371
4599
|
setCurrentPage(1);
|
|
4372
4600
|
}
|
|
4373
4601
|
},
|
|
4374
|
-
pageSizeOptions.map((o) => /* @__PURE__ */
|
|
4375
|
-
)), /* @__PURE__ */
|
|
4602
|
+
pageSizeOptions.map((o) => /* @__PURE__ */ React75.createElement("option", { key: o, value: o }, o))
|
|
4603
|
+
)), /* @__PURE__ */ React75.createElement("span", null, (currentPage - 1) * pageSize + 1, "\u2013", Math.min(currentPage * pageSize, filteredData.length), " of ", filteredData.length)), /* @__PURE__ */ React75.createElement("div", { className: "dg-page-nav" }, /* @__PURE__ */ React75.createElement("button", { className: "dg-page-btn", disabled: currentPage === 1, onClick: () => setCurrentPage((p) => p - 1) }, /* @__PURE__ */ React75.createElement(ChevronLeft, { size: 15 })), /* @__PURE__ */ React75.createElement("span", { className: "dg-page-fraction" }, currentPage, " / ", totalPages), /* @__PURE__ */ React75.createElement("button", { className: "dg-page-btn", disabled: currentPage === totalPages, onClick: () => setCurrentPage((p) => p + 1) }, /* @__PURE__ */ React75.createElement(ChevronRight, { size: 15 })))), activeMenu && /* @__PURE__ */ React75.createElement(
|
|
4376
4604
|
"div",
|
|
4377
4605
|
{
|
|
4378
4606
|
ref: menuRef,
|
|
@@ -4383,25 +4611,25 @@ function DataGrid({
|
|
|
4383
4611
|
...menuPosition.right !== void 0 ? { right: menuPosition.right } : {}
|
|
4384
4612
|
}
|
|
4385
4613
|
},
|
|
4386
|
-
/* @__PURE__ */
|
|
4387
|
-
/* @__PURE__ */
|
|
4388
|
-
/* @__PURE__ */
|
|
4614
|
+
/* @__PURE__ */ React75.createElement("button", { className: "dg-menu-item", onClick: () => handleSort(activeMenu, "asc") }, /* @__PURE__ */ React75.createElement(ArrowUp, { size: 14 }), " Sort ascending"),
|
|
4615
|
+
/* @__PURE__ */ React75.createElement("button", { className: "dg-menu-item", onClick: () => handleSort(activeMenu, "desc") }, /* @__PURE__ */ React75.createElement(ArrowDown, { size: 14 }), " Sort descending"),
|
|
4616
|
+
/* @__PURE__ */ React75.createElement("div", { className: "dg-menu-divider" }),
|
|
4389
4617
|
(() => {
|
|
4390
4618
|
const col = resolvedColumns.find((c) => c.field === activeMenu);
|
|
4391
4619
|
if (!col) return null;
|
|
4392
|
-
return /* @__PURE__ */
|
|
4620
|
+
return /* @__PURE__ */ React75.createElement(React75.Fragment, null, col.pinned === "left" ? /* @__PURE__ */ React75.createElement("button", { className: "dg-menu-item", onClick: () => togglePin(activeMenu, "left") }, /* @__PURE__ */ React75.createElement(Pin, { size: 14, style: { transform: "rotate(0deg)", opacity: 0.5 } }), " Unpin") : /* @__PURE__ */ React75.createElement("button", { className: "dg-menu-item", onClick: () => togglePin(activeMenu, "left") }, /* @__PURE__ */ React75.createElement(Pin, { size: 14, style: { transform: "rotate(45deg)" } }), " Pin left"), col.pinned === "right" ? /* @__PURE__ */ React75.createElement("button", { className: "dg-menu-item", onClick: () => togglePin(activeMenu, "right") }, /* @__PURE__ */ React75.createElement(Pin, { size: 14, style: { transform: "rotate(0deg)", opacity: 0.5 } }), " Unpin") : /* @__PURE__ */ React75.createElement("button", { className: "dg-menu-item", onClick: () => togglePin(activeMenu, "right") }, /* @__PURE__ */ React75.createElement(Pin, { size: 14, style: { transform: "rotate(-45deg)" } }), " Pin right"));
|
|
4393
4621
|
})(),
|
|
4394
|
-
/* @__PURE__ */
|
|
4395
|
-
/* @__PURE__ */
|
|
4622
|
+
/* @__PURE__ */ React75.createElement("div", { className: "dg-menu-divider" }),
|
|
4623
|
+
/* @__PURE__ */ React75.createElement("button", { className: "dg-menu-item", onClick: () => {
|
|
4396
4624
|
setShowAdvancedFilter(true);
|
|
4397
4625
|
setActiveMenu(null);
|
|
4398
|
-
} }, /* @__PURE__ */
|
|
4399
|
-
/* @__PURE__ */
|
|
4400
|
-
/* @__PURE__ */
|
|
4626
|
+
} }, /* @__PURE__ */ React75.createElement(Filter, { size: 14 }), " Filter\u2026"),
|
|
4627
|
+
/* @__PURE__ */ React75.createElement("button", { className: "dg-menu-item", onClick: () => toggleHide(activeMenu) }, /* @__PURE__ */ React75.createElement(EyeOff, { size: 14 }), " Hide column"),
|
|
4628
|
+
/* @__PURE__ */ React75.createElement("button", { className: "dg-menu-item", onClick: () => {
|
|
4401
4629
|
setShowManageColumns(true);
|
|
4402
4630
|
setActiveMenu(null);
|
|
4403
|
-
} }, /* @__PURE__ */
|
|
4404
|
-
), showManageColumns && /* @__PURE__ */
|
|
4631
|
+
} }, /* @__PURE__ */ React75.createElement(Columns, { size: 14 }), " Manage columns")
|
|
4632
|
+
), showManageColumns && /* @__PURE__ */ React75.createElement("div", { className: "dg-modal-overlay", onClick: () => setShowManageColumns(false) }, /* @__PURE__ */ React75.createElement("div", { className: "dg-modal", onClick: (e) => e.stopPropagation() }, /* @__PURE__ */ React75.createElement("div", { className: "dg-modal-header" }, /* @__PURE__ */ React75.createElement("h3", null, "Manage Columns"), /* @__PURE__ */ React75.createElement("button", { className: "dg-icon-btn", onClick: () => setShowManageColumns(false) }, /* @__PURE__ */ React75.createElement(X2, { size: 18 }))), /* @__PURE__ */ React75.createElement("div", { className: "dg-modal-body" }, /* @__PURE__ */ React75.createElement("div", { className: "dg-search-wrap", style: { marginBottom: 8 } }, /* @__PURE__ */ React75.createElement(Search, { size: 14 }), /* @__PURE__ */ React75.createElement(
|
|
4405
4633
|
"input",
|
|
4406
4634
|
{
|
|
4407
4635
|
className: "dg-search",
|
|
@@ -4413,15 +4641,15 @@ function DataGrid({
|
|
|
4413
4641
|
)), resolvedColumns.filter((c) => c.header.toLowerCase().includes(colSearch.toLowerCase())).map((col) => {
|
|
4414
4642
|
const key = String(col.key);
|
|
4415
4643
|
const isUnhideable = col.hideable === false;
|
|
4416
|
-
return /* @__PURE__ */
|
|
4417
|
-
})), /* @__PURE__ */
|
|
4644
|
+
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(EyeOff, { size: 14, style: { opacity: 0.4 } })));
|
|
4645
|
+
})), /* @__PURE__ */ React75.createElement("div", { className: "dg-modal-footer" }, /* @__PURE__ */ React75.createElement("button", { className: "dg-action-btn", onClick: () => setColumnOverrides((prev) => {
|
|
4418
4646
|
const next = { ...prev };
|
|
4419
4647
|
resolvedColumns.forEach((c) => {
|
|
4420
4648
|
const k = String(c.key);
|
|
4421
4649
|
next[k] = { ...next[k], hidden: false };
|
|
4422
4650
|
});
|
|
4423
4651
|
return next;
|
|
4424
|
-
}) }, "Show All"), /* @__PURE__ */
|
|
4652
|
+
}) }, "Show All"), /* @__PURE__ */ React75.createElement("button", { className: "dg-action-btn", onClick: () => {
|
|
4425
4653
|
const newOverrides = { ...columnOverrides };
|
|
4426
4654
|
resolvedColumns.forEach((c) => {
|
|
4427
4655
|
if (c.hideable !== false) {
|
|
@@ -4430,21 +4658,21 @@ function DataGrid({
|
|
|
4430
4658
|
}
|
|
4431
4659
|
});
|
|
4432
4660
|
setColumnOverrides(newOverrides);
|
|
4433
|
-
} }, "Hide All")))), showAdvancedFilter && /* @__PURE__ */
|
|
4661
|
+
} }, "Hide All")))), showAdvancedFilter && /* @__PURE__ */ React75.createElement("div", { className: "dg-modal-overlay", onClick: () => setShowAdvancedFilter(false) }, /* @__PURE__ */ React75.createElement("div", { className: "dg-modal dg-modal-wide dg-filter-modal", onClick: (e) => e.stopPropagation() }, /* @__PURE__ */ React75.createElement("div", { className: "dg-modal-header" }, /* @__PURE__ */ React75.createElement("h3", null, "Filters"), /* @__PURE__ */ React75.createElement("button", { className: "dg-icon-btn", onClick: () => setShowAdvancedFilter(false) }, /* @__PURE__ */ React75.createElement(X2, { size: 18 }))), /* @__PURE__ */ React75.createElement("div", { className: "dg-modal-body" }, advancedFilters.map((f, idx) => /* @__PURE__ */ React75.createElement("div", { key: idx }, idx > 0 && /* @__PURE__ */ React75.createElement("div", { className: "dg-filter-logic" }, /* @__PURE__ */ React75.createElement(
|
|
4434
4662
|
"button",
|
|
4435
4663
|
{
|
|
4436
4664
|
className: `dg-logic-btn${f.logic === "AND" ? " active" : ""}`,
|
|
4437
4665
|
onClick: () => setAdvancedFilters((p) => p.map((fi, i) => i === idx ? { ...fi, logic: "AND" } : fi))
|
|
4438
4666
|
},
|
|
4439
4667
|
"AND"
|
|
4440
|
-
), /* @__PURE__ */
|
|
4668
|
+
), /* @__PURE__ */ React75.createElement(
|
|
4441
4669
|
"button",
|
|
4442
4670
|
{
|
|
4443
4671
|
className: `dg-logic-btn${f.logic === "OR" ? " active" : ""}`,
|
|
4444
4672
|
onClick: () => setAdvancedFilters((p) => p.map((fi, i) => i === idx ? { ...fi, logic: "OR" } : fi))
|
|
4445
4673
|
},
|
|
4446
4674
|
"OR"
|
|
4447
|
-
)), /* @__PURE__ */
|
|
4675
|
+
)), /* @__PURE__ */ React75.createElement("div", { className: "dg-filter-row" }, advancedFilters.length > 1 && /* @__PURE__ */ React75.createElement("button", { className: "dg-icon-btn", onClick: () => setAdvancedFilters((p) => p.filter((_, i) => i !== idx)) }, /* @__PURE__ */ React75.createElement(X2, { size: 14 })), /* @__PURE__ */ React75.createElement(
|
|
4448
4676
|
"select",
|
|
4449
4677
|
{
|
|
4450
4678
|
className: "dg-filter-select",
|
|
@@ -4456,20 +4684,20 @@ function DataGrid({
|
|
|
4456
4684
|
setAdvancedFilters((p) => p.map((fi, i) => i === idx ? { ...fi, column: newColKey, operator: defaultOp, value: "" } : fi));
|
|
4457
4685
|
}
|
|
4458
4686
|
},
|
|
4459
|
-
resolvedColumns.map((c) => /* @__PURE__ */
|
|
4687
|
+
resolvedColumns.map((c) => /* @__PURE__ */ React75.createElement("option", { key: String(c.key), value: String(c.key) }, c.header))
|
|
4460
4688
|
), (() => {
|
|
4461
4689
|
const col = resolvedColumns.find((c) => String(c.key) === f.column);
|
|
4462
4690
|
const operators = getOperatorsForType(col?.type);
|
|
4463
4691
|
const hideValue = f.operator === "is empty" || f.operator === "is not empty";
|
|
4464
|
-
return /* @__PURE__ */
|
|
4692
|
+
return /* @__PURE__ */ React75.createElement(React75.Fragment, null, /* @__PURE__ */ React75.createElement(
|
|
4465
4693
|
"select",
|
|
4466
4694
|
{
|
|
4467
4695
|
className: "dg-filter-select dg-filter-select-sm",
|
|
4468
4696
|
value: f.operator,
|
|
4469
4697
|
onChange: (e) => setAdvancedFilters((p) => p.map((fi, i) => i === idx ? { ...fi, operator: e.target.value, value: "" } : fi))
|
|
4470
4698
|
},
|
|
4471
|
-
operators.map((op) => /* @__PURE__ */
|
|
4472
|
-
), !hideValue && col?.type === "date" && /* @__PURE__ */
|
|
4699
|
+
operators.map((op) => /* @__PURE__ */ React75.createElement("option", { key: op.value, value: op.value }, op.label))
|
|
4700
|
+
), !hideValue && col?.type === "date" && /* @__PURE__ */ React75.createElement("div", { className: "dg-filter-datefield" }, /* @__PURE__ */ React75.createElement(
|
|
4473
4701
|
DateField,
|
|
4474
4702
|
{
|
|
4475
4703
|
value: f.value,
|
|
@@ -4478,17 +4706,17 @@ function DataGrid({
|
|
|
4478
4706
|
}
|
|
4479
4707
|
)), !hideValue && col?.type === "status" && (() => {
|
|
4480
4708
|
const options = col.statusOptions || [...new Set(data.map((item) => String(item[col.field || col.key || ""])))].filter((v) => v && v !== "undefined" && v !== "null").sort();
|
|
4481
|
-
return /* @__PURE__ */
|
|
4709
|
+
return /* @__PURE__ */ React75.createElement(
|
|
4482
4710
|
"select",
|
|
4483
4711
|
{
|
|
4484
4712
|
className: "dg-filter-select",
|
|
4485
4713
|
value: f.value,
|
|
4486
4714
|
onChange: (e) => setAdvancedFilters((p) => p.map((fi, i) => i === idx ? { ...fi, value: e.target.value } : fi))
|
|
4487
4715
|
},
|
|
4488
|
-
/* @__PURE__ */
|
|
4489
|
-
options.map((opt) => /* @__PURE__ */
|
|
4716
|
+
/* @__PURE__ */ React75.createElement("option", { value: "" }, "Select\u2026"),
|
|
4717
|
+
options.map((opt) => /* @__PURE__ */ React75.createElement("option", { key: opt, value: opt }, opt))
|
|
4490
4718
|
);
|
|
4491
|
-
})(), !hideValue && col?.type !== "date" && col?.type !== "status" && /* @__PURE__ */
|
|
4719
|
+
})(), !hideValue && col?.type !== "date" && col?.type !== "status" && /* @__PURE__ */ React75.createElement(
|
|
4492
4720
|
"input",
|
|
4493
4721
|
{
|
|
4494
4722
|
type: col?.type === "number" ? "number" : "text",
|
|
@@ -4498,7 +4726,7 @@ function DataGrid({
|
|
|
4498
4726
|
onChange: (e) => setAdvancedFilters((p) => p.map((fi, i) => i === idx ? { ...fi, value: e.target.value } : fi))
|
|
4499
4727
|
}
|
|
4500
4728
|
));
|
|
4501
|
-
})()))), /* @__PURE__ */
|
|
4729
|
+
})()))), /* @__PURE__ */ React75.createElement(
|
|
4502
4730
|
"button",
|
|
4503
4731
|
{
|
|
4504
4732
|
className: "dg-action-btn",
|
|
@@ -4509,9 +4737,9 @@ function DataGrid({
|
|
|
4509
4737
|
setAdvancedFilters((p) => [...p, { column: String(firstCol.key), operator: defaultOp, value: "", logic: "AND" }]);
|
|
4510
4738
|
}
|
|
4511
4739
|
},
|
|
4512
|
-
/* @__PURE__ */
|
|
4740
|
+
/* @__PURE__ */ React75.createElement(Plus, { size: 14 }),
|
|
4513
4741
|
" Add Filter"
|
|
4514
|
-
)), /* @__PURE__ */
|
|
4742
|
+
)), /* @__PURE__ */ React75.createElement("div", { className: "dg-modal-footer" }, /* @__PURE__ */ React75.createElement(
|
|
4515
4743
|
"button",
|
|
4516
4744
|
{
|
|
4517
4745
|
className: "dg-action-btn",
|
|
@@ -4520,25 +4748,25 @@ function DataGrid({
|
|
|
4520
4748
|
setAdvancedFilters([{ column: String(firstCol.key), operator: getDefaultOperator(firstCol?.type), value: "", logic: "AND" }]);
|
|
4521
4749
|
}
|
|
4522
4750
|
},
|
|
4523
|
-
/* @__PURE__ */
|
|
4751
|
+
/* @__PURE__ */ React75.createElement(Trash2, { size: 14 }),
|
|
4524
4752
|
" Reset"
|
|
4525
|
-
), /* @__PURE__ */
|
|
4753
|
+
), /* @__PURE__ */ React75.createElement("button", { className: "submit-btn", onClick: () => setShowAdvancedFilter(false) }, "Apply")))));
|
|
4526
4754
|
}
|
|
4527
4755
|
|
|
4528
4756
|
// lib/Select/Select.tsx
|
|
4529
|
-
import
|
|
4530
|
-
useState as
|
|
4531
|
-
useRef as
|
|
4532
|
-
useEffect as
|
|
4533
|
-
useCallback as
|
|
4757
|
+
import React76, {
|
|
4758
|
+
useState as useState10,
|
|
4759
|
+
useRef as useRef10,
|
|
4760
|
+
useEffect as useEffect10,
|
|
4761
|
+
useCallback as useCallback4
|
|
4534
4762
|
} from "react";
|
|
4535
|
-
import
|
|
4536
|
-
var ChevronDownIcon2 = () => /* @__PURE__ */
|
|
4537
|
-
var CheckIcon2 = () => /* @__PURE__ */
|
|
4763
|
+
import ReactDOM4 from "react-dom";
|
|
4764
|
+
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" }));
|
|
4765
|
+
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" }));
|
|
4538
4766
|
function normaliseOptions(options) {
|
|
4539
4767
|
return options.map((o) => typeof o === "string" ? { value: o, label: o } : o);
|
|
4540
4768
|
}
|
|
4541
|
-
var Select =
|
|
4769
|
+
var Select = React76.forwardRef(function Select2(props, ref) {
|
|
4542
4770
|
const {
|
|
4543
4771
|
options: rawOptions,
|
|
4544
4772
|
value,
|
|
@@ -4557,14 +4785,14 @@ var Select = React75.forwardRef(function Select2(props, ref) {
|
|
|
4557
4785
|
style,
|
|
4558
4786
|
sx
|
|
4559
4787
|
} = props;
|
|
4560
|
-
const [open, setOpen] =
|
|
4561
|
-
const [focusedIdx, setFocusedIdx] =
|
|
4562
|
-
const [popupStyle, setPopupStyle] =
|
|
4563
|
-
const containerRef =
|
|
4564
|
-
const listRef =
|
|
4565
|
-
const inputId =
|
|
4788
|
+
const [open, setOpen] = useState10(false);
|
|
4789
|
+
const [focusedIdx, setFocusedIdx] = useState10(-1);
|
|
4790
|
+
const [popupStyle, setPopupStyle] = useState10({});
|
|
4791
|
+
const containerRef = useRef10(null);
|
|
4792
|
+
const listRef = useRef10(null);
|
|
4793
|
+
const inputId = useRef10(`rf-sel-${Math.random().toString(36).slice(2, 9)}`).current;
|
|
4566
4794
|
const sxClass = useSx(sx);
|
|
4567
|
-
const calcPopupStyle =
|
|
4795
|
+
const calcPopupStyle = useCallback4(() => {
|
|
4568
4796
|
if (!containerRef.current) return;
|
|
4569
4797
|
const rect = containerRef.current.getBoundingClientRect();
|
|
4570
4798
|
setPopupStyle({
|
|
@@ -4575,28 +4803,28 @@ var Select = React75.forwardRef(function Select2(props, ref) {
|
|
|
4575
4803
|
}, []);
|
|
4576
4804
|
const options = normaliseOptions(rawOptions);
|
|
4577
4805
|
const selectedValues = multiple ? Array.isArray(value) ? value : value != null ? [value] : [] : value != null ? [value] : [];
|
|
4578
|
-
const isSelected =
|
|
4806
|
+
const isSelected = useCallback4(
|
|
4579
4807
|
(optValue) => selectedValues.includes(optValue),
|
|
4580
4808
|
[selectedValues]
|
|
4581
4809
|
);
|
|
4582
4810
|
const getSelectedLabels = () => options.filter((o) => selectedValues.includes(o.value)).map((o) => o.label);
|
|
4583
4811
|
const hasValue = selectedValues.length > 0;
|
|
4584
4812
|
const isFloating = Boolean(open || hasValue);
|
|
4585
|
-
const openPopup =
|
|
4813
|
+
const openPopup = useCallback4(() => {
|
|
4586
4814
|
if (disabled) return;
|
|
4587
4815
|
calcPopupStyle();
|
|
4588
4816
|
setOpen(true);
|
|
4589
4817
|
setFocusedIdx(-1);
|
|
4590
4818
|
}, [disabled, calcPopupStyle]);
|
|
4591
|
-
const closePopup =
|
|
4819
|
+
const closePopup = useCallback4(() => {
|
|
4592
4820
|
setOpen(false);
|
|
4593
4821
|
setFocusedIdx(-1);
|
|
4594
4822
|
}, []);
|
|
4595
|
-
const togglePopup =
|
|
4823
|
+
const togglePopup = useCallback4(() => {
|
|
4596
4824
|
if (open) closePopup();
|
|
4597
4825
|
else openPopup();
|
|
4598
4826
|
}, [open, openPopup, closePopup]);
|
|
4599
|
-
|
|
4827
|
+
useEffect10(() => {
|
|
4600
4828
|
if (!open) return;
|
|
4601
4829
|
const handleOutside = (e) => {
|
|
4602
4830
|
if (containerRef.current && !containerRef.current.contains(e.target)) {
|
|
@@ -4612,7 +4840,7 @@ var Select = React75.forwardRef(function Select2(props, ref) {
|
|
|
4612
4840
|
window.removeEventListener("resize", calcPopupStyle);
|
|
4613
4841
|
};
|
|
4614
4842
|
}, [open, closePopup, calcPopupStyle]);
|
|
4615
|
-
const selectOption =
|
|
4843
|
+
const selectOption = useCallback4((opt) => {
|
|
4616
4844
|
if (opt.disabled) return;
|
|
4617
4845
|
if (multiple) {
|
|
4618
4846
|
const already = isSelected(opt.value);
|
|
@@ -4687,20 +4915,20 @@ var Select = React75.forwardRef(function Select2(props, ref) {
|
|
|
4687
4915
|
if (multiple) {
|
|
4688
4916
|
const labels = getSelectedLabels();
|
|
4689
4917
|
if (labels.length === 0) {
|
|
4690
|
-
return /* @__PURE__ */
|
|
4918
|
+
return /* @__PURE__ */ React76.createElement("div", { className: "rf-select__chips" }, placeholder && /* @__PURE__ */ React76.createElement("span", { className: "rf-select__display rf-select__display--placeholder" }, placeholder));
|
|
4691
4919
|
}
|
|
4692
4920
|
if (labels.length <= 2) {
|
|
4693
|
-
return /* @__PURE__ */
|
|
4921
|
+
return /* @__PURE__ */ React76.createElement("div", { className: "rf-select__chips" }, labels.map((l, i) => /* @__PURE__ */ React76.createElement("span", { key: i, className: "rf-select__chip" }, l)));
|
|
4694
4922
|
}
|
|
4695
|
-
return /* @__PURE__ */
|
|
4923
|
+
return /* @__PURE__ */ React76.createElement("div", { className: "rf-select__chips" }, labels.slice(0, 2).map((l, i) => /* @__PURE__ */ React76.createElement("span", { key: i, className: "rf-select__chip" }, l)), /* @__PURE__ */ React76.createElement("span", { className: "rf-select__count" }, "+", labels.length - 2));
|
|
4696
4924
|
}
|
|
4697
4925
|
const selectedOpt = options.find((o) => o.value === value);
|
|
4698
4926
|
if (selectedOpt) {
|
|
4699
|
-
return /* @__PURE__ */
|
|
4927
|
+
return /* @__PURE__ */ React76.createElement("div", { className: "rf-select__display" }, selectedOpt.label);
|
|
4700
4928
|
}
|
|
4701
|
-
return /* @__PURE__ */
|
|
4929
|
+
return /* @__PURE__ */ React76.createElement("div", { className: `rf-select__display${placeholder ? " rf-select__display--placeholder" : ""}` }, placeholder || "\xA0");
|
|
4702
4930
|
};
|
|
4703
|
-
return /* @__PURE__ */
|
|
4931
|
+
return /* @__PURE__ */ React76.createElement(
|
|
4704
4932
|
"div",
|
|
4705
4933
|
{
|
|
4706
4934
|
ref: (node) => {
|
|
@@ -4711,7 +4939,7 @@ var Select = React75.forwardRef(function Select2(props, ref) {
|
|
|
4711
4939
|
className: rootClasses,
|
|
4712
4940
|
style
|
|
4713
4941
|
},
|
|
4714
|
-
/* @__PURE__ */
|
|
4942
|
+
/* @__PURE__ */ React76.createElement(
|
|
4715
4943
|
"div",
|
|
4716
4944
|
{
|
|
4717
4945
|
className: "rf-text-field__wrapper",
|
|
@@ -4725,16 +4953,16 @@ var Select = React75.forwardRef(function Select2(props, ref) {
|
|
|
4725
4953
|
onKeyDown: handleKeyDown
|
|
4726
4954
|
},
|
|
4727
4955
|
renderDisplay(),
|
|
4728
|
-
label && /* @__PURE__ */
|
|
4729
|
-
variant === "outlined" && /* @__PURE__ */
|
|
4730
|
-
/* @__PURE__ */
|
|
4956
|
+
label && /* @__PURE__ */ React76.createElement("label", { id: inputId, className: "rf-text-field__label" }, label, required && /* @__PURE__ */ React76.createElement("span", { className: "rf-text-field__asterisk" }, " *")),
|
|
4957
|
+
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" })),
|
|
4958
|
+
/* @__PURE__ */ React76.createElement("div", { className: "rf-select__arrow", "aria-hidden": "true" }, /* @__PURE__ */ React76.createElement(ChevronDownIcon2, null))
|
|
4731
4959
|
),
|
|
4732
|
-
helperText && /* @__PURE__ */
|
|
4733
|
-
open && !disabled &&
|
|
4734
|
-
/* @__PURE__ */
|
|
4960
|
+
helperText && /* @__PURE__ */ React76.createElement("div", { className: `rf-text-field__helper-text${error ? " rf-text-field__helper-text--error" : ""}` }, helperText),
|
|
4961
|
+
open && !disabled && ReactDOM4.createPortal(
|
|
4962
|
+
/* @__PURE__ */ React76.createElement("div", { className: "rf-select__popup", role: "presentation", style: popupStyle }, /* @__PURE__ */ React76.createElement("ul", { ref: listRef, className: "rf-select__listbox", role: "listbox", "aria-multiselectable": multiple }, options.map((opt, idx) => {
|
|
4735
4963
|
const selected = isSelected(opt.value);
|
|
4736
4964
|
const focused = focusedIdx === idx;
|
|
4737
|
-
return /* @__PURE__ */
|
|
4965
|
+
return /* @__PURE__ */ React76.createElement(
|
|
4738
4966
|
"li",
|
|
4739
4967
|
{
|
|
4740
4968
|
key: opt.value,
|
|
@@ -4753,8 +4981,8 @@ var Select = React75.forwardRef(function Select2(props, ref) {
|
|
|
4753
4981
|
onMouseDown: (e) => e.preventDefault(),
|
|
4754
4982
|
onClick: () => selectOption(opt)
|
|
4755
4983
|
},
|
|
4756
|
-
/* @__PURE__ */
|
|
4757
|
-
/* @__PURE__ */
|
|
4984
|
+
/* @__PURE__ */ React76.createElement("span", { className: "rf-select__option-label" }, opt.label),
|
|
4985
|
+
/* @__PURE__ */ React76.createElement("span", { className: "rf-select__option-check", "aria-hidden": "true" }, /* @__PURE__ */ React76.createElement(CheckIcon2, null))
|
|
4758
4986
|
);
|
|
4759
4987
|
}))),
|
|
4760
4988
|
document.body
|
|
@@ -4764,11 +4992,11 @@ var Select = React75.forwardRef(function Select2(props, ref) {
|
|
|
4764
4992
|
Select.displayName = "Select";
|
|
4765
4993
|
|
|
4766
4994
|
// lib/Slider/Slider.tsx
|
|
4767
|
-
import
|
|
4768
|
-
useState as
|
|
4769
|
-
useRef as
|
|
4770
|
-
useEffect as
|
|
4771
|
-
useCallback as
|
|
4995
|
+
import React77, {
|
|
4996
|
+
useState as useState11,
|
|
4997
|
+
useRef as useRef11,
|
|
4998
|
+
useEffect as useEffect11,
|
|
4999
|
+
useCallback as useCallback5
|
|
4772
5000
|
} from "react";
|
|
4773
5001
|
function clamp(val, min, max) {
|
|
4774
5002
|
return Math.max(min, Math.min(max, val));
|
|
@@ -4779,7 +5007,7 @@ function snapToStep(val, min, step) {
|
|
|
4779
5007
|
function pct(val, min, max) {
|
|
4780
5008
|
return (val - min) / (max - min) * 100;
|
|
4781
5009
|
}
|
|
4782
|
-
var Slider =
|
|
5010
|
+
var Slider = React77.forwardRef(function Slider2(props, ref) {
|
|
4783
5011
|
const {
|
|
4784
5012
|
value,
|
|
4785
5013
|
onChange,
|
|
@@ -4799,9 +5027,9 @@ var Slider = React76.forwardRef(function Slider2(props, ref) {
|
|
|
4799
5027
|
sx
|
|
4800
5028
|
} = props;
|
|
4801
5029
|
const sxClass = useSx(sx);
|
|
4802
|
-
const trackRef =
|
|
4803
|
-
const draggingThumb =
|
|
4804
|
-
const [dragging, setDragging] =
|
|
5030
|
+
const trackRef = useRef11(null);
|
|
5031
|
+
const draggingThumb = useRef11(null);
|
|
5032
|
+
const [dragging, setDragging] = useState11(null);
|
|
4805
5033
|
const isRange = range || Array.isArray(value);
|
|
4806
5034
|
const rawVal = value ?? (isRange ? [min, max] : min);
|
|
4807
5035
|
const vals = isRange ? Array.isArray(rawVal) ? [rawVal[0], rawVal[1]] : [rawVal, rawVal] : [rawVal, rawVal];
|
|
@@ -4812,7 +5040,7 @@ var Slider = React76.forwardRef(function Slider2(props, ref) {
|
|
|
4812
5040
|
computedMarks.push(...marks);
|
|
4813
5041
|
}
|
|
4814
5042
|
const hasLabelledMarks = computedMarks.some((m) => m.label);
|
|
4815
|
-
const getValueFromPointer =
|
|
5043
|
+
const getValueFromPointer = useCallback5((e) => {
|
|
4816
5044
|
const track = trackRef.current;
|
|
4817
5045
|
if (!track) return min;
|
|
4818
5046
|
const rect = track.getBoundingClientRect();
|
|
@@ -4826,7 +5054,7 @@ var Slider = React76.forwardRef(function Slider2(props, ref) {
|
|
|
4826
5054
|
const raw = min + ratio * (max - min);
|
|
4827
5055
|
return clamp(snapToStep(raw, min, step), min, max);
|
|
4828
5056
|
}, [min, max, step, orientation]);
|
|
4829
|
-
|
|
5057
|
+
useEffect11(() => {
|
|
4830
5058
|
if (dragging === null) return;
|
|
4831
5059
|
const onMove = (e) => {
|
|
4832
5060
|
const newVal = getValueFromPointer(e);
|
|
@@ -4919,7 +5147,7 @@ var Slider = React76.forwardRef(function Slider2(props, ref) {
|
|
|
4919
5147
|
const val = vals[thumb];
|
|
4920
5148
|
const p = pct(val, min, max);
|
|
4921
5149
|
const thumbStyle = orientation === "vertical" ? { bottom: `${p}%`, transform: "translate(-50%, 50%)" } : { left: `${p}%` };
|
|
4922
|
-
return /* @__PURE__ */
|
|
5150
|
+
return /* @__PURE__ */ React77.createElement(
|
|
4923
5151
|
"div",
|
|
4924
5152
|
{
|
|
4925
5153
|
key: thumb,
|
|
@@ -4935,30 +5163,30 @@ var Slider = React76.forwardRef(function Slider2(props, ref) {
|
|
|
4935
5163
|
onPointerDown: (e) => handleThumbPointerDown(e, thumb),
|
|
4936
5164
|
onKeyDown: (e) => handleThumbKeyDown(e, thumb)
|
|
4937
5165
|
},
|
|
4938
|
-
valueLabelDisplay !== "off" && /* @__PURE__ */
|
|
5166
|
+
valueLabelDisplay !== "off" && /* @__PURE__ */ React77.createElement("div", { className: "rf-slider__value-label", "aria-hidden": "true" }, val)
|
|
4939
5167
|
);
|
|
4940
5168
|
};
|
|
4941
|
-
return /* @__PURE__ */
|
|
5169
|
+
return /* @__PURE__ */ React77.createElement("div", { ref, className: rootClasses, style }, label && /* @__PURE__ */ React77.createElement("div", { className: "rf-slider__label" }, label), /* @__PURE__ */ React77.createElement(
|
|
4942
5170
|
"div",
|
|
4943
5171
|
{
|
|
4944
5172
|
ref: trackRef,
|
|
4945
5173
|
className: "rf-slider__track-container",
|
|
4946
5174
|
onPointerDown: handleTrackPointerDown
|
|
4947
5175
|
},
|
|
4948
|
-
/* @__PURE__ */
|
|
4949
|
-
/* @__PURE__ */
|
|
5176
|
+
/* @__PURE__ */ React77.createElement("div", { className: "rf-slider__rail", "aria-hidden": "true" }),
|
|
5177
|
+
/* @__PURE__ */ React77.createElement("div", { className: "rf-slider__track", style: trackStyle, "aria-hidden": "true" }),
|
|
4950
5178
|
computedMarks.map((mark) => {
|
|
4951
5179
|
const p = pct(mark.value, min, max);
|
|
4952
5180
|
const isActive = isRange ? mark.value >= vals[0] && mark.value <= vals[1] : mark.value <= vals[0];
|
|
4953
5181
|
const markStyle = orientation === "vertical" ? { bottom: `${p}%`, transform: "translate(-50%, 50%)" } : { left: `${p}%` };
|
|
4954
|
-
return /* @__PURE__ */
|
|
5182
|
+
return /* @__PURE__ */ React77.createElement(React77.Fragment, { key: mark.value }, /* @__PURE__ */ React77.createElement(
|
|
4955
5183
|
"div",
|
|
4956
5184
|
{
|
|
4957
5185
|
className: `rf-slider__mark${isActive ? " rf-slider__mark--active" : ""}`,
|
|
4958
5186
|
style: markStyle,
|
|
4959
5187
|
"aria-hidden": "true"
|
|
4960
5188
|
}
|
|
4961
|
-
), mark.label && orientation === "horizontal" && /* @__PURE__ */
|
|
5189
|
+
), mark.label && orientation === "horizontal" && /* @__PURE__ */ React77.createElement(
|
|
4962
5190
|
"div",
|
|
4963
5191
|
{
|
|
4964
5192
|
className: "rf-slider__mark-label",
|
|
@@ -4970,13 +5198,13 @@ var Slider = React76.forwardRef(function Slider2(props, ref) {
|
|
|
4970
5198
|
}),
|
|
4971
5199
|
renderThumb(0),
|
|
4972
5200
|
isRange && renderThumb(1)
|
|
4973
|
-
), hasLabelledMarks && orientation === "horizontal" && /* @__PURE__ */
|
|
5201
|
+
), hasLabelledMarks && orientation === "horizontal" && /* @__PURE__ */ React77.createElement("div", { className: "rf-slider__marks-labels", "aria-hidden": "true" }));
|
|
4974
5202
|
});
|
|
4975
5203
|
Slider.displayName = "Slider";
|
|
4976
5204
|
|
|
4977
5205
|
// lib/Switch/Switch.tsx
|
|
4978
|
-
import
|
|
4979
|
-
var Switch =
|
|
5206
|
+
import React78, { useRef as useRef12 } from "react";
|
|
5207
|
+
var Switch = React78.forwardRef(function Switch2(props, ref) {
|
|
4980
5208
|
const {
|
|
4981
5209
|
checked = false,
|
|
4982
5210
|
onChange,
|
|
@@ -4991,8 +5219,8 @@ var Switch = React77.forwardRef(function Switch2(props, ref) {
|
|
|
4991
5219
|
sx
|
|
4992
5220
|
} = props;
|
|
4993
5221
|
const sxClass = useSx(sx);
|
|
4994
|
-
const inputRef =
|
|
4995
|
-
const inputId =
|
|
5222
|
+
const inputRef = useRef12(null);
|
|
5223
|
+
const inputId = useRef12(`rf-sw-${Math.random().toString(36).slice(2, 9)}`).current;
|
|
4996
5224
|
const handleChange = (e) => {
|
|
4997
5225
|
if (!disabled) onChange?.(e.target.checked);
|
|
4998
5226
|
};
|
|
@@ -5006,7 +5234,7 @@ var Switch = React77.forwardRef(function Switch2(props, ref) {
|
|
|
5006
5234
|
sxClass,
|
|
5007
5235
|
className
|
|
5008
5236
|
].filter(Boolean).join(" ");
|
|
5009
|
-
return /* @__PURE__ */
|
|
5237
|
+
return /* @__PURE__ */ React78.createElement(
|
|
5010
5238
|
"label",
|
|
5011
5239
|
{
|
|
5012
5240
|
ref,
|
|
@@ -5014,7 +5242,7 @@ var Switch = React77.forwardRef(function Switch2(props, ref) {
|
|
|
5014
5242
|
style,
|
|
5015
5243
|
htmlFor: inputId
|
|
5016
5244
|
},
|
|
5017
|
-
/* @__PURE__ */
|
|
5245
|
+
/* @__PURE__ */ React78.createElement(
|
|
5018
5246
|
"input",
|
|
5019
5247
|
{
|
|
5020
5248
|
ref: inputRef,
|
|
@@ -5029,16 +5257,16 @@ var Switch = React77.forwardRef(function Switch2(props, ref) {
|
|
|
5029
5257
|
"aria-checked": checked
|
|
5030
5258
|
}
|
|
5031
5259
|
),
|
|
5032
|
-
/* @__PURE__ */
|
|
5033
|
-
label && /* @__PURE__ */
|
|
5260
|
+
/* @__PURE__ */ React78.createElement("div", { className: "rf-switch__track", "aria-hidden": "true" }, /* @__PURE__ */ React78.createElement("div", { className: "rf-switch__thumb" })),
|
|
5261
|
+
label && /* @__PURE__ */ React78.createElement("span", { className: "rf-switch__label" }, label, required && /* @__PURE__ */ React78.createElement("span", { style: { color: "var(--tf-error-color, #d32f2f)" } }, " *"))
|
|
5034
5262
|
);
|
|
5035
5263
|
});
|
|
5036
5264
|
Switch.displayName = "Switch";
|
|
5037
5265
|
|
|
5038
5266
|
// lib/RadioGroup/RadioGroup.tsx
|
|
5039
|
-
import
|
|
5267
|
+
import React79, { useRef as useRef13, createContext as createContext3, useContext as useContext3 } from "react";
|
|
5040
5268
|
var RadioGroupContext = createContext3({});
|
|
5041
|
-
var Radio =
|
|
5269
|
+
var Radio = React79.forwardRef(function Radio2(props, ref) {
|
|
5042
5270
|
const ctx = useContext3(RadioGroupContext);
|
|
5043
5271
|
const {
|
|
5044
5272
|
value,
|
|
@@ -5051,7 +5279,7 @@ var Radio = React78.forwardRef(function Radio2(props, ref) {
|
|
|
5051
5279
|
sx
|
|
5052
5280
|
} = props;
|
|
5053
5281
|
const sxClass = useSx(sx);
|
|
5054
|
-
const inputId =
|
|
5282
|
+
const inputId = useRef13(`rf-radio-${Math.random().toString(36).slice(2, 9)}`).current;
|
|
5055
5283
|
const isChecked = checkedProp !== void 0 ? checkedProp : ctx.value === value;
|
|
5056
5284
|
const isDisabled = disabledProp !== void 0 ? disabledProp : ctx.disabled ?? false;
|
|
5057
5285
|
const size = sizeProp ?? ctx.size ?? "medium";
|
|
@@ -5069,7 +5297,7 @@ var Radio = React78.forwardRef(function Radio2(props, ref) {
|
|
|
5069
5297
|
isDisabled ? "rf-radio--disabled" : "",
|
|
5070
5298
|
sxClass
|
|
5071
5299
|
].filter(Boolean).join(" ");
|
|
5072
|
-
return /* @__PURE__ */
|
|
5300
|
+
return /* @__PURE__ */ React79.createElement("label", { ref, className: rootClasses, htmlFor: inputId }, /* @__PURE__ */ React79.createElement(
|
|
5073
5301
|
"input",
|
|
5074
5302
|
{
|
|
5075
5303
|
id: inputId,
|
|
@@ -5082,10 +5310,10 @@ var Radio = React78.forwardRef(function Radio2(props, ref) {
|
|
|
5082
5310
|
name,
|
|
5083
5311
|
"aria-checked": isChecked
|
|
5084
5312
|
}
|
|
5085
|
-
), /* @__PURE__ */
|
|
5313
|
+
), /* @__PURE__ */ React79.createElement("div", { className: "rf-radio__control", "aria-hidden": "true" }, /* @__PURE__ */ React79.createElement("div", { className: "rf-radio__ripple" }), /* @__PURE__ */ React79.createElement("div", { className: "rf-radio__outer" }, /* @__PURE__ */ React79.createElement("div", { className: "rf-radio__inner" }))), label && /* @__PURE__ */ React79.createElement("span", { className: "rf-radio__label" }, label));
|
|
5086
5314
|
});
|
|
5087
5315
|
Radio.displayName = "Radio";
|
|
5088
|
-
var RadioGroup =
|
|
5316
|
+
var RadioGroup = React79.forwardRef(function RadioGroup2(props, ref) {
|
|
5089
5317
|
const {
|
|
5090
5318
|
value,
|
|
5091
5319
|
onChange,
|
|
@@ -5101,7 +5329,7 @@ var RadioGroup = React78.forwardRef(function RadioGroup2(props, ref) {
|
|
|
5101
5329
|
sx
|
|
5102
5330
|
} = props;
|
|
5103
5331
|
const sxClass = useSx(sx);
|
|
5104
|
-
const groupName =
|
|
5332
|
+
const groupName = useRef13(name ?? `rf-rg-${Math.random().toString(36).slice(2, 9)}`).current;
|
|
5105
5333
|
const rootClasses = [
|
|
5106
5334
|
"rf-radio-group",
|
|
5107
5335
|
row ? "rf-radio-group--row" : "",
|
|
@@ -5109,7 +5337,7 @@ var RadioGroup = React78.forwardRef(function RadioGroup2(props, ref) {
|
|
|
5109
5337
|
sxClass,
|
|
5110
5338
|
className
|
|
5111
5339
|
].filter(Boolean).join(" ");
|
|
5112
|
-
return /* @__PURE__ */
|
|
5340
|
+
return /* @__PURE__ */ React79.createElement(RadioGroupContext.Provider, { value: { value, onChange, name: groupName, disabled, size } }, /* @__PURE__ */ React79.createElement(
|
|
5113
5341
|
"div",
|
|
5114
5342
|
{
|
|
5115
5343
|
ref,
|
|
@@ -5118,8 +5346,8 @@ var RadioGroup = React78.forwardRef(function RadioGroup2(props, ref) {
|
|
|
5118
5346
|
role: "radiogroup",
|
|
5119
5347
|
"aria-label": label
|
|
5120
5348
|
},
|
|
5121
|
-
label && /* @__PURE__ */
|
|
5122
|
-
options ? options.map((opt) => /* @__PURE__ */
|
|
5349
|
+
label && /* @__PURE__ */ React79.createElement("div", { className: "rf-radio-group__label" }, label),
|
|
5350
|
+
options ? options.map((opt) => /* @__PURE__ */ React79.createElement(
|
|
5123
5351
|
Radio,
|
|
5124
5352
|
{
|
|
5125
5353
|
key: opt.value,
|
|
@@ -5133,12 +5361,12 @@ var RadioGroup = React78.forwardRef(function RadioGroup2(props, ref) {
|
|
|
5133
5361
|
RadioGroup.displayName = "RadioGroup";
|
|
5134
5362
|
|
|
5135
5363
|
// lib/Rating/Rating.tsx
|
|
5136
|
-
import
|
|
5137
|
-
useState as
|
|
5138
|
-
useRef as
|
|
5364
|
+
import React80, {
|
|
5365
|
+
useState as useState12,
|
|
5366
|
+
useRef as useRef14
|
|
5139
5367
|
} from "react";
|
|
5140
5368
|
var starSize = { small: 18, medium: 24, large: 32 };
|
|
5141
|
-
var FilledStarIcon = ({ size }) => /* @__PURE__ */
|
|
5369
|
+
var FilledStarIcon = ({ size }) => /* @__PURE__ */ React80.createElement(
|
|
5142
5370
|
"svg",
|
|
5143
5371
|
{
|
|
5144
5372
|
width: size,
|
|
@@ -5147,9 +5375,9 @@ var FilledStarIcon = ({ size }) => /* @__PURE__ */ React79.createElement(
|
|
|
5147
5375
|
fill: "currentColor",
|
|
5148
5376
|
"aria-hidden": "true"
|
|
5149
5377
|
},
|
|
5150
|
-
/* @__PURE__ */
|
|
5378
|
+
/* @__PURE__ */ React80.createElement("path", { d: "M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z" })
|
|
5151
5379
|
);
|
|
5152
|
-
var EmptyStarIcon = ({ size }) => /* @__PURE__ */
|
|
5380
|
+
var EmptyStarIcon = ({ size }) => /* @__PURE__ */ React80.createElement(
|
|
5153
5381
|
"svg",
|
|
5154
5382
|
{
|
|
5155
5383
|
width: size,
|
|
@@ -5160,9 +5388,9 @@ var EmptyStarIcon = ({ size }) => /* @__PURE__ */ React79.createElement(
|
|
|
5160
5388
|
strokeWidth: "1.6",
|
|
5161
5389
|
"aria-hidden": "true"
|
|
5162
5390
|
},
|
|
5163
|
-
/* @__PURE__ */
|
|
5391
|
+
/* @__PURE__ */ React80.createElement("path", { d: "M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z" })
|
|
5164
5392
|
);
|
|
5165
|
-
var Rating =
|
|
5393
|
+
var Rating = React80.forwardRef(function Rating2(props, ref) {
|
|
5166
5394
|
const {
|
|
5167
5395
|
value,
|
|
5168
5396
|
onChange,
|
|
@@ -5180,13 +5408,13 @@ var Rating = React79.forwardRef(function Rating2(props, ref) {
|
|
|
5180
5408
|
sx
|
|
5181
5409
|
} = props;
|
|
5182
5410
|
const sxClass = useSx(sx);
|
|
5183
|
-
const [hoverValue, setHoverValue] =
|
|
5184
|
-
const starsRef =
|
|
5411
|
+
const [hoverValue, setHoverValue] = useState12(null);
|
|
5412
|
+
const starsRef = useRef14(null);
|
|
5185
5413
|
const currentValue = value ?? 0;
|
|
5186
5414
|
const displayValue = hoverValue !== null ? hoverValue : currentValue;
|
|
5187
5415
|
const iconSize = starSize[size] ?? 24;
|
|
5188
|
-
const renderedFilledIcon = icon ?? /* @__PURE__ */
|
|
5189
|
-
const renderedEmptyIcon = emptyIcon ?? /* @__PURE__ */
|
|
5416
|
+
const renderedFilledIcon = icon ?? /* @__PURE__ */ React80.createElement(FilledStarIcon, { size: iconSize });
|
|
5417
|
+
const renderedEmptyIcon = emptyIcon ?? /* @__PURE__ */ React80.createElement(EmptyStarIcon, { size: iconSize });
|
|
5190
5418
|
const isFilled = (pos) => {
|
|
5191
5419
|
if (highlightSelectedOnly) return displayValue === pos;
|
|
5192
5420
|
return displayValue >= pos - (precision < 1 ? 0.25 : 0);
|
|
@@ -5247,7 +5475,7 @@ var Rating = React79.forwardRef(function Rating2(props, ref) {
|
|
|
5247
5475
|
sxClass,
|
|
5248
5476
|
className
|
|
5249
5477
|
].filter(Boolean).join(" ");
|
|
5250
|
-
return /* @__PURE__ */
|
|
5478
|
+
return /* @__PURE__ */ React80.createElement("div", { ref, className: rootClasses, style }, label && /* @__PURE__ */ React80.createElement("div", { className: "rf-rating__label" }, label), /* @__PURE__ */ React80.createElement(
|
|
5251
5479
|
"div",
|
|
5252
5480
|
{
|
|
5253
5481
|
ref: starsRef,
|
|
@@ -5264,7 +5492,7 @@ var Rating = React79.forwardRef(function Rating2(props, ref) {
|
|
|
5264
5492
|
"rf-rating__item",
|
|
5265
5493
|
isHovered ? "rf-rating__item--hovered" : ""
|
|
5266
5494
|
].filter(Boolean).join(" ");
|
|
5267
|
-
return /* @__PURE__ */
|
|
5495
|
+
return /* @__PURE__ */ React80.createElement(
|
|
5268
5496
|
"button",
|
|
5269
5497
|
{
|
|
5270
5498
|
key: pos,
|
|
@@ -5279,15 +5507,15 @@ var Rating = React79.forwardRef(function Rating2(props, ref) {
|
|
|
5279
5507
|
},
|
|
5280
5508
|
halfFilled ? (
|
|
5281
5509
|
// Half-star: show half filled + half empty
|
|
5282
|
-
/* @__PURE__ */
|
|
5510
|
+
/* @__PURE__ */ React80.createElement("div", { className: "rf-rating__icon-container", style: { position: "relative" } }, /* @__PURE__ */ React80.createElement("span", { className: "rf-rating__icon--empty" }, renderedEmptyIcon), /* @__PURE__ */ React80.createElement(
|
|
5283
5511
|
"span",
|
|
5284
5512
|
{
|
|
5285
5513
|
className: "rf-rating__half-left",
|
|
5286
5514
|
style: { position: "absolute", inset: 0, width: "50%", overflow: "hidden" }
|
|
5287
5515
|
},
|
|
5288
|
-
/* @__PURE__ */
|
|
5516
|
+
/* @__PURE__ */ React80.createElement("span", { className: "rf-rating__icon--filled" }, renderedFilledIcon)
|
|
5289
5517
|
))
|
|
5290
|
-
) : /* @__PURE__ */
|
|
5518
|
+
) : /* @__PURE__ */ React80.createElement("div", { className: "rf-rating__icon-container" }, /* @__PURE__ */ React80.createElement("span", { className: filled ? "rf-rating__icon--filled" : "rf-rating__icon--empty" }, filled ? renderedFilledIcon : renderedEmptyIcon))
|
|
5291
5519
|
);
|
|
5292
5520
|
})
|
|
5293
5521
|
));
|
|
@@ -5295,12 +5523,12 @@ var Rating = React79.forwardRef(function Rating2(props, ref) {
|
|
|
5295
5523
|
Rating.displayName = "Rating";
|
|
5296
5524
|
|
|
5297
5525
|
// lib/ToggleButton/ToggleButton.tsx
|
|
5298
|
-
import
|
|
5526
|
+
import React81, {
|
|
5299
5527
|
createContext as createContext4,
|
|
5300
5528
|
useContext as useContext4
|
|
5301
5529
|
} from "react";
|
|
5302
5530
|
var ToggleGroupContext = createContext4({});
|
|
5303
|
-
var ToggleButton =
|
|
5531
|
+
var ToggleButton = React81.forwardRef(
|
|
5304
5532
|
function ToggleButton2(props, ref) {
|
|
5305
5533
|
const ctx = useContext4(ToggleGroupContext);
|
|
5306
5534
|
const { value, children, disabled: disabledProp, selected: selectedProp, sx } = props;
|
|
@@ -5333,7 +5561,7 @@ var ToggleButton = React80.forwardRef(
|
|
|
5333
5561
|
}
|
|
5334
5562
|
}
|
|
5335
5563
|
};
|
|
5336
|
-
const isIconOnly =
|
|
5564
|
+
const isIconOnly = React81.Children.count(children) === 1 && React81.isValidElement(children) && children.type === "svg";
|
|
5337
5565
|
const btnClasses = [
|
|
5338
5566
|
"rf-toggle-btn",
|
|
5339
5567
|
isSelected ? "rf-toggle-btn--selected" : "",
|
|
@@ -5341,7 +5569,7 @@ var ToggleButton = React80.forwardRef(
|
|
|
5341
5569
|
isIconOnly ? "rf-toggle-btn--icon-only" : "",
|
|
5342
5570
|
sxClass
|
|
5343
5571
|
].filter(Boolean).join(" ");
|
|
5344
|
-
return /* @__PURE__ */
|
|
5572
|
+
return /* @__PURE__ */ React81.createElement(
|
|
5345
5573
|
"button",
|
|
5346
5574
|
{
|
|
5347
5575
|
ref,
|
|
@@ -5356,7 +5584,7 @@ var ToggleButton = React80.forwardRef(
|
|
|
5356
5584
|
}
|
|
5357
5585
|
);
|
|
5358
5586
|
ToggleButton.displayName = "ToggleButton";
|
|
5359
|
-
var ToggleButtonGroup =
|
|
5587
|
+
var ToggleButtonGroup = React81.forwardRef(
|
|
5360
5588
|
function ToggleButtonGroup2(props, ref) {
|
|
5361
5589
|
const {
|
|
5362
5590
|
value,
|
|
@@ -5383,7 +5611,7 @@ var ToggleButtonGroup = React80.forwardRef(
|
|
|
5383
5611
|
sxClass,
|
|
5384
5612
|
className
|
|
5385
5613
|
].filter(Boolean).join(" ");
|
|
5386
|
-
return /* @__PURE__ */
|
|
5614
|
+
return /* @__PURE__ */ React81.createElement(ToggleGroupContext.Provider, { value: { value, onChange, exclusive, size, disabled, color } }, /* @__PURE__ */ React81.createElement(
|
|
5387
5615
|
"div",
|
|
5388
5616
|
{
|
|
5389
5617
|
ref,
|
|
@@ -5399,7 +5627,7 @@ var ToggleButtonGroup = React80.forwardRef(
|
|
|
5399
5627
|
ToggleButtonGroup.displayName = "ToggleButtonGroup";
|
|
5400
5628
|
|
|
5401
5629
|
// lib/Avatar/Avatar.tsx
|
|
5402
|
-
import
|
|
5630
|
+
import React82, { useState as useState13 } from "react";
|
|
5403
5631
|
var DEFAULT_PALETTE = [
|
|
5404
5632
|
"#a41b06",
|
|
5405
5633
|
"#8b1605",
|
|
@@ -5434,7 +5662,7 @@ function getInitials(alt) {
|
|
|
5434
5662
|
}
|
|
5435
5663
|
return words[0][0].toUpperCase();
|
|
5436
5664
|
}
|
|
5437
|
-
var Avatar =
|
|
5665
|
+
var Avatar = React82.forwardRef(
|
|
5438
5666
|
({
|
|
5439
5667
|
src,
|
|
5440
5668
|
alt,
|
|
@@ -5449,7 +5677,7 @@ var Avatar = React81.forwardRef(
|
|
|
5449
5677
|
sx
|
|
5450
5678
|
}, ref) => {
|
|
5451
5679
|
const sxClass = useSx(sx);
|
|
5452
|
-
const [imgError, setImgError] =
|
|
5680
|
+
const [imgError, setImgError] = useState13(false);
|
|
5453
5681
|
const { className: sizeClass, style: sizeStyle } = getSizeStyle(size);
|
|
5454
5682
|
const bgColor = color || DEFAULT_PALETTE[_avatarColorIndex % DEFAULT_PALETTE.length];
|
|
5455
5683
|
const classes = [
|
|
@@ -5469,7 +5697,7 @@ var Avatar = React81.forwardRef(
|
|
|
5469
5697
|
inlineStyle.backgroundColor = bgColor;
|
|
5470
5698
|
inlineStyle.color = "#ffffff";
|
|
5471
5699
|
}
|
|
5472
|
-
return /* @__PURE__ */
|
|
5700
|
+
return /* @__PURE__ */ React82.createElement("div", { ref, className: classes, style: inlineStyle, "aria-label": alt, role: alt ? "img" : void 0, onClick, tabIndex: onClick ? 0 : void 0 }, showImage ? /* @__PURE__ */ React82.createElement(
|
|
5473
5701
|
"img",
|
|
5474
5702
|
{
|
|
5475
5703
|
src,
|
|
@@ -5478,7 +5706,7 @@ var Avatar = React81.forwardRef(
|
|
|
5478
5706
|
onError: () => setImgError(true),
|
|
5479
5707
|
...imgProps
|
|
5480
5708
|
}
|
|
5481
|
-
) : /* @__PURE__ */
|
|
5709
|
+
) : /* @__PURE__ */ React82.createElement("span", { className: "rf-avatar__initials" }, content));
|
|
5482
5710
|
}
|
|
5483
5711
|
);
|
|
5484
5712
|
Avatar.displayName = "Avatar";
|
|
@@ -5491,7 +5719,7 @@ var AvatarGroup = ({
|
|
|
5491
5719
|
sx
|
|
5492
5720
|
}) => {
|
|
5493
5721
|
const sxClass = useSx(sx);
|
|
5494
|
-
const childArray =
|
|
5722
|
+
const childArray = React82.Children.toArray(children);
|
|
5495
5723
|
const totalCount = childArray.length;
|
|
5496
5724
|
const overflowCount = totalCount > max ? totalCount - (max - 1) : 0;
|
|
5497
5725
|
const visibleChildren = overflowCount > 0 ? childArray.slice(0, max - 1) : childArray;
|
|
@@ -5505,7 +5733,7 @@ var AvatarGroup = ({
|
|
|
5505
5733
|
}
|
|
5506
5734
|
const classes = ["rf-avatar-group", spacingClass, sxClass, className].filter(Boolean).join(" ");
|
|
5507
5735
|
const avatarsToRender = [...visibleChildren].reverse();
|
|
5508
|
-
return /* @__PURE__ */
|
|
5736
|
+
return /* @__PURE__ */ React82.createElement("div", { className: classes, style, role: "group" }, overflowCount > 0 && /* @__PURE__ */ React82.createElement(
|
|
5509
5737
|
Avatar,
|
|
5510
5738
|
{
|
|
5511
5739
|
className: "rf-avatar-group__overflow",
|
|
@@ -5517,7 +5745,7 @@ var AvatarGroup = ({
|
|
|
5517
5745
|
), avatarsToRender.map((child, i) => {
|
|
5518
5746
|
if (typeof spacing === "number") {
|
|
5519
5747
|
const typedChild = child;
|
|
5520
|
-
return
|
|
5748
|
+
return React82.cloneElement(typedChild, {
|
|
5521
5749
|
key: i,
|
|
5522
5750
|
style: {
|
|
5523
5751
|
marginLeft: i < avatarsToRender.length - 1 ? -spacing : 0,
|
|
@@ -5531,7 +5759,7 @@ var AvatarGroup = ({
|
|
|
5531
5759
|
AvatarGroup.displayName = "AvatarGroup";
|
|
5532
5760
|
|
|
5533
5761
|
// lib/Chip/Chip.tsx
|
|
5534
|
-
import
|
|
5762
|
+
import React83 from "react";
|
|
5535
5763
|
var Chip = ({
|
|
5536
5764
|
label,
|
|
5537
5765
|
onDelete,
|
|
@@ -5569,7 +5797,7 @@ var Chip = ({
|
|
|
5569
5797
|
onDelete();
|
|
5570
5798
|
}
|
|
5571
5799
|
};
|
|
5572
|
-
return /* @__PURE__ */
|
|
5800
|
+
return /* @__PURE__ */ React83.createElement(
|
|
5573
5801
|
"div",
|
|
5574
5802
|
{
|
|
5575
5803
|
className: classes,
|
|
@@ -5580,10 +5808,10 @@ var Chip = ({
|
|
|
5580
5808
|
onKeyDown: !disabled ? handleKeyDown : void 0,
|
|
5581
5809
|
"aria-disabled": disabled || void 0
|
|
5582
5810
|
},
|
|
5583
|
-
avatar && /* @__PURE__ */
|
|
5584
|
-
!avatar && icon && /* @__PURE__ */
|
|
5585
|
-
/* @__PURE__ */
|
|
5586
|
-
onDelete && /* @__PURE__ */
|
|
5811
|
+
avatar && /* @__PURE__ */ React83.createElement("span", { className: "rf-chip__avatar" }, avatar),
|
|
5812
|
+
!avatar && icon && /* @__PURE__ */ React83.createElement("span", { className: "rf-chip__icon", "aria-hidden": "true" }, icon),
|
|
5813
|
+
/* @__PURE__ */ React83.createElement("span", { className: "rf-chip__label" }, label),
|
|
5814
|
+
onDelete && /* @__PURE__ */ React83.createElement(
|
|
5587
5815
|
"button",
|
|
5588
5816
|
{
|
|
5589
5817
|
className: "rf-chip__delete",
|
|
@@ -5604,7 +5832,7 @@ var Chip = ({
|
|
|
5604
5832
|
Chip.displayName = "Chip";
|
|
5605
5833
|
|
|
5606
5834
|
// lib/Divider/Divider.tsx
|
|
5607
|
-
import
|
|
5835
|
+
import React84 from "react";
|
|
5608
5836
|
var Divider = ({
|
|
5609
5837
|
orientation = "horizontal",
|
|
5610
5838
|
variant = "fullWidth",
|
|
@@ -5618,7 +5846,7 @@ var Divider = ({
|
|
|
5618
5846
|
sx
|
|
5619
5847
|
}) => {
|
|
5620
5848
|
const sxClass = useSx(sx);
|
|
5621
|
-
const hasChildren =
|
|
5849
|
+
const hasChildren = React84.Children.count(children) > 0;
|
|
5622
5850
|
const variantClass = variant === "inset" ? "rf-divider--inset" : variant === "middle" ? "rf-divider--middle" : "";
|
|
5623
5851
|
const classes = [
|
|
5624
5852
|
"rf-divider",
|
|
@@ -5634,7 +5862,7 @@ var Divider = ({
|
|
|
5634
5862
|
].filter(Boolean).join(" ");
|
|
5635
5863
|
const Tag = component || (hasChildren ? "div" : "hr");
|
|
5636
5864
|
if (!hasChildren) {
|
|
5637
|
-
return /* @__PURE__ */
|
|
5865
|
+
return /* @__PURE__ */ React84.createElement(
|
|
5638
5866
|
Tag,
|
|
5639
5867
|
{
|
|
5640
5868
|
className: classes,
|
|
@@ -5643,7 +5871,7 @@ var Divider = ({
|
|
|
5643
5871
|
}
|
|
5644
5872
|
);
|
|
5645
5873
|
}
|
|
5646
|
-
return /* @__PURE__ */
|
|
5874
|
+
return /* @__PURE__ */ React84.createElement(
|
|
5647
5875
|
Tag,
|
|
5648
5876
|
{
|
|
5649
5877
|
className: classes,
|
|
@@ -5651,13 +5879,13 @@ var Divider = ({
|
|
|
5651
5879
|
role: "separator",
|
|
5652
5880
|
"aria-orientation": orientation
|
|
5653
5881
|
},
|
|
5654
|
-
/* @__PURE__ */
|
|
5882
|
+
/* @__PURE__ */ React84.createElement("span", { className: "rf-divider__text" }, children)
|
|
5655
5883
|
);
|
|
5656
5884
|
};
|
|
5657
5885
|
Divider.displayName = "Divider";
|
|
5658
5886
|
|
|
5659
5887
|
// lib/List/List.tsx
|
|
5660
|
-
import
|
|
5888
|
+
import React85 from "react";
|
|
5661
5889
|
var List = ({
|
|
5662
5890
|
dense = false,
|
|
5663
5891
|
disablePadding = false,
|
|
@@ -5675,7 +5903,7 @@ var List = ({
|
|
|
5675
5903
|
sxClass,
|
|
5676
5904
|
className
|
|
5677
5905
|
].filter(Boolean).join(" ");
|
|
5678
|
-
return /* @__PURE__ */
|
|
5906
|
+
return /* @__PURE__ */ React85.createElement("ul", { className: classes, style }, subheader, children);
|
|
5679
5907
|
};
|
|
5680
5908
|
List.displayName = "List";
|
|
5681
5909
|
var ListItem = ({
|
|
@@ -5699,7 +5927,7 @@ var ListItem = ({
|
|
|
5699
5927
|
sxClass,
|
|
5700
5928
|
className
|
|
5701
5929
|
].filter(Boolean).join(" ");
|
|
5702
|
-
return /* @__PURE__ */
|
|
5930
|
+
return /* @__PURE__ */ React85.createElement("li", { className: classes, style }, /* @__PURE__ */ React85.createElement("div", { className: "rf-list-item__content" }, children), secondaryAction && /* @__PURE__ */ React85.createElement("div", { className: "rf-list-item__secondary-action" }, secondaryAction));
|
|
5703
5931
|
};
|
|
5704
5932
|
ListItem.displayName = "ListItem";
|
|
5705
5933
|
var ListItemText = ({
|
|
@@ -5716,12 +5944,12 @@ var ListItemText = ({
|
|
|
5716
5944
|
inset ? "rf-list-item-text--inset" : "",
|
|
5717
5945
|
sxClass
|
|
5718
5946
|
].filter(Boolean).join(" ");
|
|
5719
|
-
return /* @__PURE__ */
|
|
5947
|
+
return /* @__PURE__ */ React85.createElement("div", { className: classes }, /* @__PURE__ */ React85.createElement("p", { className: "rf-list-item-text__primary", ...primaryTypographyProps }, primary), secondary && /* @__PURE__ */ React85.createElement("p", { className: "rf-list-item-text__secondary", ...secondaryTypographyProps }, secondary));
|
|
5720
5948
|
};
|
|
5721
5949
|
ListItemText.displayName = "ListItemText";
|
|
5722
5950
|
var ListItemIcon = ({ children, sx }) => {
|
|
5723
5951
|
const sxClass = useSx(sx);
|
|
5724
|
-
return /* @__PURE__ */
|
|
5952
|
+
return /* @__PURE__ */ React85.createElement("div", { className: ["rf-list-item-icon", sxClass].filter(Boolean).join(" "), "aria-hidden": "true" }, children);
|
|
5725
5953
|
};
|
|
5726
5954
|
ListItemIcon.displayName = "ListItemIcon";
|
|
5727
5955
|
var ListItemButton = ({
|
|
@@ -5753,7 +5981,7 @@ var ListItemButton = ({
|
|
|
5753
5981
|
"aria-disabled": disabled || void 0
|
|
5754
5982
|
};
|
|
5755
5983
|
if (href) {
|
|
5756
|
-
return /* @__PURE__ */
|
|
5984
|
+
return /* @__PURE__ */ React85.createElement(
|
|
5757
5985
|
"a",
|
|
5758
5986
|
{
|
|
5759
5987
|
href,
|
|
@@ -5764,7 +5992,7 @@ var ListItemButton = ({
|
|
|
5764
5992
|
children
|
|
5765
5993
|
);
|
|
5766
5994
|
}
|
|
5767
|
-
return /* @__PURE__ */
|
|
5995
|
+
return /* @__PURE__ */ React85.createElement(
|
|
5768
5996
|
"button",
|
|
5769
5997
|
{
|
|
5770
5998
|
type: "button",
|
|
@@ -5793,12 +6021,12 @@ var ListSubheader = ({
|
|
|
5793
6021
|
color !== "default" ? `rf-list-subheader--color-${color}` : "",
|
|
5794
6022
|
sxClass
|
|
5795
6023
|
].filter(Boolean).join(" ");
|
|
5796
|
-
return /* @__PURE__ */
|
|
6024
|
+
return /* @__PURE__ */ React85.createElement("li", { className: classes, role: "presentation", "aria-label": typeof children === "string" ? children : void 0 }, children);
|
|
5797
6025
|
};
|
|
5798
6026
|
ListSubheader.displayName = "ListSubheader";
|
|
5799
6027
|
|
|
5800
6028
|
// lib/Typography/Typography.tsx
|
|
5801
|
-
import
|
|
6029
|
+
import React86 from "react";
|
|
5802
6030
|
var VARIANT_ELEMENT_MAP = {
|
|
5803
6031
|
h1: "h1",
|
|
5804
6032
|
h2: "h2",
|
|
@@ -5807,353 +6035,123 @@ var VARIANT_ELEMENT_MAP = {
|
|
|
5807
6035
|
h5: "h5",
|
|
5808
6036
|
h6: "h6",
|
|
5809
6037
|
subtitle1: "h6",
|
|
5810
|
-
subtitle2: "h6",
|
|
5811
|
-
body1: "p",
|
|
5812
|
-
body2: "p",
|
|
5813
|
-
caption: "span",
|
|
5814
|
-
overline: "span",
|
|
5815
|
-
button: "span"
|
|
5816
|
-
};
|
|
5817
|
-
var COLOR_CLASSES = {
|
|
5818
|
-
primary: "rf-typography--color-primary",
|
|
5819
|
-
secondary: "rf-typography--color-secondary",
|
|
5820
|
-
textPrimary: "rf-typography--color-textPrimary",
|
|
5821
|
-
textSecondary: "rf-typography--color-textSecondary",
|
|
5822
|
-
error: "rf-typography--color-error"
|
|
5823
|
-
};
|
|
5824
|
-
var WEIGHT_CLASSES = {
|
|
5825
|
-
light: "rf-typography--weight-light",
|
|
5826
|
-
regular: "rf-typography--weight-regular",
|
|
5827
|
-
medium: "rf-typography--weight-medium",
|
|
5828
|
-
bold: "rf-typography--weight-bold"
|
|
5829
|
-
};
|
|
5830
|
-
var Typography = ({
|
|
5831
|
-
variant = "body1",
|
|
5832
|
-
component,
|
|
5833
|
-
align = "inherit",
|
|
5834
|
-
color,
|
|
5835
|
-
noWrap = false,
|
|
5836
|
-
gutterBottom = false,
|
|
5837
|
-
paragraph = false,
|
|
5838
|
-
fontWeight,
|
|
5839
|
-
children,
|
|
5840
|
-
className = "",
|
|
5841
|
-
style,
|
|
5842
|
-
sx
|
|
5843
|
-
}) => {
|
|
5844
|
-
const sxClass = useSx(sx);
|
|
5845
|
-
const Tag = component || (paragraph ? "p" : VARIANT_ELEMENT_MAP[variant] || "span");
|
|
5846
|
-
const colorClass = color ? COLOR_CLASSES[color] : "";
|
|
5847
|
-
const colorStyle = color && !COLOR_CLASSES[color] ? { color } : {};
|
|
5848
|
-
let weightClass = "";
|
|
5849
|
-
let weightStyle = {};
|
|
5850
|
-
if (fontWeight !== void 0) {
|
|
5851
|
-
if (typeof fontWeight === "string") {
|
|
5852
|
-
weightClass = WEIGHT_CLASSES[fontWeight] || "";
|
|
5853
|
-
} else {
|
|
5854
|
-
weightStyle = { fontWeight };
|
|
5855
|
-
}
|
|
5856
|
-
}
|
|
5857
|
-
const alignClass = align !== "inherit" ? `rf-typography--align-${align}` : "";
|
|
5858
|
-
const classes = [
|
|
5859
|
-
"rf-typography",
|
|
5860
|
-
`rf-typography--${variant}`,
|
|
5861
|
-
alignClass,
|
|
5862
|
-
colorClass,
|
|
5863
|
-
weightClass,
|
|
5864
|
-
noWrap ? "rf-typography--no-wrap" : "",
|
|
5865
|
-
gutterBottom ? "rf-typography--gutter-bottom" : "",
|
|
5866
|
-
paragraph ? "rf-typography--paragraph" : "",
|
|
5867
|
-
sxClass,
|
|
5868
|
-
className
|
|
5869
|
-
].filter(Boolean).join(" ");
|
|
5870
|
-
const inlineStyle = {
|
|
5871
|
-
...colorStyle,
|
|
5872
|
-
...weightStyle,
|
|
5873
|
-
...style
|
|
5874
|
-
};
|
|
5875
|
-
return /* @__PURE__ */ React85.createElement(Tag, { className: classes, style: Object.keys(inlineStyle).length > 0 ? inlineStyle : void 0 }, children);
|
|
5876
|
-
};
|
|
5877
|
-
Typography.displayName = "Typography";
|
|
5878
|
-
|
|
5879
|
-
// lib/Skeleton/Skeleton.tsx
|
|
5880
|
-
import React86 from "react";
|
|
5881
|
-
var Skeleton = ({
|
|
5882
|
-
variant = "text",
|
|
5883
|
-
width,
|
|
5884
|
-
height,
|
|
5885
|
-
animation = "pulse",
|
|
5886
|
-
className = "",
|
|
5887
|
-
style,
|
|
5888
|
-
sx
|
|
5889
|
-
}) => {
|
|
5890
|
-
const sxClass = useSx(sx);
|
|
5891
|
-
const animationClass = animation === "pulse" ? "rf-skeleton--pulse" : animation === "wave" ? "rf-skeleton--wave" : "rf-skeleton--no-animation";
|
|
5892
|
-
const classes = [
|
|
5893
|
-
"rf-skeleton",
|
|
5894
|
-
`rf-skeleton--${variant}`,
|
|
5895
|
-
animationClass,
|
|
5896
|
-
sxClass,
|
|
5897
|
-
className
|
|
5898
|
-
].filter(Boolean).join(" ");
|
|
5899
|
-
const inlineStyle = {
|
|
5900
|
-
...width !== void 0 ? { width: typeof width === "number" ? width : width } : {},
|
|
5901
|
-
...height !== void 0 ? { height: typeof height === "number" ? height : height } : {},
|
|
5902
|
-
...style
|
|
5903
|
-
};
|
|
5904
|
-
if (variant === "text" && !height) {
|
|
5905
|
-
}
|
|
5906
|
-
if (variant === "circular" && !width && !height) {
|
|
5907
|
-
inlineStyle.width = 40;
|
|
5908
|
-
inlineStyle.height = 40;
|
|
5909
|
-
}
|
|
5910
|
-
if (variant === "rectangular" && !height) {
|
|
5911
|
-
inlineStyle.height = 140;
|
|
5912
|
-
}
|
|
5913
|
-
if (variant === "rounded" && !height) {
|
|
5914
|
-
inlineStyle.height = 140;
|
|
5915
|
-
}
|
|
5916
|
-
return /* @__PURE__ */ React86.createElement(
|
|
5917
|
-
"span",
|
|
5918
|
-
{
|
|
5919
|
-
className: classes,
|
|
5920
|
-
style: Object.keys(inlineStyle).length > 0 ? inlineStyle : void 0,
|
|
5921
|
-
"aria-busy": "true",
|
|
5922
|
-
"aria-live": "polite"
|
|
5923
|
-
}
|
|
5924
|
-
);
|
|
5925
|
-
};
|
|
5926
|
-
Skeleton.displayName = "Skeleton";
|
|
5927
|
-
|
|
5928
|
-
// lib/Tooltip/Tooltip.tsx
|
|
5929
|
-
import React87, {
|
|
5930
|
-
useCallback as useCallback5,
|
|
5931
|
-
useEffect as useEffect11,
|
|
5932
|
-
useRef as useRef14,
|
|
5933
|
-
useState as useState13
|
|
5934
|
-
} from "react";
|
|
5935
|
-
import ReactDOM4 from "react-dom";
|
|
5936
|
-
var GAP = 8;
|
|
5937
|
-
function computePosition(anchor, tooltip, placement) {
|
|
5938
|
-
const { top: aTop, left: aLeft, width: aW, height: aH } = anchor;
|
|
5939
|
-
const { width: tW, height: tH } = tooltip;
|
|
5940
|
-
let top = 0;
|
|
5941
|
-
let left = 0;
|
|
5942
|
-
let arrowLeft;
|
|
5943
|
-
let arrowTop;
|
|
5944
|
-
switch (placement) {
|
|
5945
|
-
case "top":
|
|
5946
|
-
top = aTop - tH - GAP;
|
|
5947
|
-
left = aLeft + aW / 2 - tW / 2;
|
|
5948
|
-
arrowLeft = tW / 2 - 4;
|
|
5949
|
-
break;
|
|
5950
|
-
case "top-start":
|
|
5951
|
-
top = aTop - tH - GAP;
|
|
5952
|
-
left = aLeft;
|
|
5953
|
-
arrowLeft = Math.min(aW / 2, tW - 16);
|
|
5954
|
-
break;
|
|
5955
|
-
case "top-end":
|
|
5956
|
-
top = aTop - tH - GAP;
|
|
5957
|
-
left = aLeft + aW - tW;
|
|
5958
|
-
arrowLeft = Math.max(tW - aW / 2 - 4, 8);
|
|
5959
|
-
break;
|
|
5960
|
-
case "bottom":
|
|
5961
|
-
top = aTop + aH + GAP;
|
|
5962
|
-
left = aLeft + aW / 2 - tW / 2;
|
|
5963
|
-
arrowLeft = tW / 2 - 4;
|
|
5964
|
-
break;
|
|
5965
|
-
case "bottom-start":
|
|
5966
|
-
top = aTop + aH + GAP;
|
|
5967
|
-
left = aLeft;
|
|
5968
|
-
arrowLeft = Math.min(aW / 2, tW - 16);
|
|
5969
|
-
break;
|
|
5970
|
-
case "bottom-end":
|
|
5971
|
-
top = aTop + aH + GAP;
|
|
5972
|
-
left = aLeft + aW - tW;
|
|
5973
|
-
arrowLeft = Math.max(tW - aW / 2 - 4, 8);
|
|
5974
|
-
break;
|
|
5975
|
-
case "left":
|
|
5976
|
-
top = aTop + aH / 2 - tH / 2;
|
|
5977
|
-
left = aLeft - tW - GAP;
|
|
5978
|
-
arrowTop = tH / 2 - 4;
|
|
5979
|
-
break;
|
|
5980
|
-
case "left-start":
|
|
5981
|
-
top = aTop;
|
|
5982
|
-
left = aLeft - tW - GAP;
|
|
5983
|
-
arrowTop = Math.min(aH / 2, tH - 16);
|
|
5984
|
-
break;
|
|
5985
|
-
case "left-end":
|
|
5986
|
-
top = aTop + aH - tH;
|
|
5987
|
-
left = aLeft - tW - GAP;
|
|
5988
|
-
arrowTop = Math.max(tH - aH / 2 - 4, 8);
|
|
5989
|
-
break;
|
|
5990
|
-
case "right":
|
|
5991
|
-
top = aTop + aH / 2 - tH / 2;
|
|
5992
|
-
left = aLeft + aW + GAP;
|
|
5993
|
-
arrowTop = tH / 2 - 4;
|
|
5994
|
-
break;
|
|
5995
|
-
case "right-start":
|
|
5996
|
-
top = aTop;
|
|
5997
|
-
left = aLeft + aW + GAP;
|
|
5998
|
-
arrowTop = Math.min(aH / 2, tH - 16);
|
|
5999
|
-
break;
|
|
6000
|
-
case "right-end":
|
|
6001
|
-
top = aTop + aH - tH;
|
|
6002
|
-
left = aLeft + aW + GAP;
|
|
6003
|
-
arrowTop = Math.max(tH - aH / 2 - 4, 8);
|
|
6004
|
-
break;
|
|
6005
|
-
default:
|
|
6006
|
-
top = aTop - tH - GAP;
|
|
6007
|
-
left = aLeft + aW / 2 - tW / 2;
|
|
6008
|
-
}
|
|
6009
|
-
const vw = window.innerWidth;
|
|
6010
|
-
const vh = window.innerHeight;
|
|
6011
|
-
left = Math.max(8, Math.min(left, vw - tW - 8));
|
|
6012
|
-
top = Math.max(8, Math.min(top, vh - tH - 8));
|
|
6013
|
-
return { top, left, arrowLeft, arrowTop };
|
|
6014
|
-
}
|
|
6015
|
-
var Tooltip = ({
|
|
6016
|
-
title,
|
|
6017
|
-
placement = "top",
|
|
6018
|
-
arrow = false,
|
|
6019
|
-
open: controlledOpen,
|
|
6020
|
-
disableHoverListener = false,
|
|
6021
|
-
disableFocusListener = false,
|
|
6022
|
-
enterDelay = 100,
|
|
6023
|
-
leaveDelay = 0,
|
|
6038
|
+
subtitle2: "h6",
|
|
6039
|
+
body1: "p",
|
|
6040
|
+
body2: "p",
|
|
6041
|
+
caption: "span",
|
|
6042
|
+
overline: "span",
|
|
6043
|
+
button: "span"
|
|
6044
|
+
};
|
|
6045
|
+
var COLOR_CLASSES = {
|
|
6046
|
+
primary: "rf-typography--color-primary",
|
|
6047
|
+
secondary: "rf-typography--color-secondary",
|
|
6048
|
+
textPrimary: "rf-typography--color-textPrimary",
|
|
6049
|
+
textSecondary: "rf-typography--color-textSecondary",
|
|
6050
|
+
error: "rf-typography--color-error"
|
|
6051
|
+
};
|
|
6052
|
+
var WEIGHT_CLASSES = {
|
|
6053
|
+
light: "rf-typography--weight-light",
|
|
6054
|
+
regular: "rf-typography--weight-regular",
|
|
6055
|
+
medium: "rf-typography--weight-medium",
|
|
6056
|
+
bold: "rf-typography--weight-bold"
|
|
6057
|
+
};
|
|
6058
|
+
var Typography = ({
|
|
6059
|
+
variant = "body1",
|
|
6060
|
+
component,
|
|
6061
|
+
align = "inherit",
|
|
6062
|
+
color,
|
|
6063
|
+
noWrap = false,
|
|
6064
|
+
gutterBottom = false,
|
|
6065
|
+
paragraph = false,
|
|
6066
|
+
fontWeight,
|
|
6024
6067
|
children,
|
|
6025
|
-
followCursor = false,
|
|
6026
6068
|
className = "",
|
|
6027
6069
|
style,
|
|
6028
6070
|
sx
|
|
6029
6071
|
}) => {
|
|
6030
6072
|
const sxClass = useSx(sx);
|
|
6031
|
-
const [
|
|
6032
|
-
const
|
|
6033
|
-
const
|
|
6034
|
-
|
|
6035
|
-
|
|
6036
|
-
|
|
6037
|
-
|
|
6038
|
-
|
|
6039
|
-
const clearTimers = useCallback5(() => {
|
|
6040
|
-
if (enterTimer.current) clearTimeout(enterTimer.current);
|
|
6041
|
-
if (leaveTimer.current) clearTimeout(leaveTimer.current);
|
|
6042
|
-
}, []);
|
|
6043
|
-
const updatePosition = useCallback5(() => {
|
|
6044
|
-
if (!anchorRef.current || !tooltipRef.current) return;
|
|
6045
|
-
const anchorRect = anchorRef.current.getBoundingClientRect();
|
|
6046
|
-
const tooltipRect = tooltipRef.current.getBoundingClientRect();
|
|
6047
|
-
if (followCursor) {
|
|
6048
|
-
const fakeRect = {
|
|
6049
|
-
top: cursorPos.current.y,
|
|
6050
|
-
left: cursorPos.current.x,
|
|
6051
|
-
right: cursorPos.current.x,
|
|
6052
|
-
bottom: cursorPos.current.y,
|
|
6053
|
-
width: 0,
|
|
6054
|
-
height: 0,
|
|
6055
|
-
x: cursorPos.current.x,
|
|
6056
|
-
y: cursorPos.current.y,
|
|
6057
|
-
toJSON: () => ({})
|
|
6058
|
-
};
|
|
6059
|
-
setPosition(computePosition(fakeRect, tooltipRect, placement));
|
|
6060
|
-
} else {
|
|
6061
|
-
setPosition(computePosition(anchorRect, tooltipRect, placement));
|
|
6062
|
-
}
|
|
6063
|
-
}, [placement, followCursor]);
|
|
6064
|
-
useEffect11(() => {
|
|
6065
|
-
if (isOpen) {
|
|
6066
|
-
requestAnimationFrame(() => {
|
|
6067
|
-
updatePosition();
|
|
6068
|
-
});
|
|
6069
|
-
}
|
|
6070
|
-
}, [isOpen, updatePosition]);
|
|
6071
|
-
const handleOpen = useCallback5(() => {
|
|
6072
|
-
clearTimers();
|
|
6073
|
-
if (enterDelay > 0) {
|
|
6074
|
-
enterTimer.current = setTimeout(() => {
|
|
6075
|
-
setInternalOpen(true);
|
|
6076
|
-
}, enterDelay);
|
|
6077
|
-
} else {
|
|
6078
|
-
setInternalOpen(true);
|
|
6079
|
-
}
|
|
6080
|
-
}, [enterDelay, clearTimers]);
|
|
6081
|
-
const handleClose = useCallback5(() => {
|
|
6082
|
-
clearTimers();
|
|
6083
|
-
if (leaveDelay > 0) {
|
|
6084
|
-
leaveTimer.current = setTimeout(() => {
|
|
6085
|
-
setInternalOpen(false);
|
|
6086
|
-
}, leaveDelay);
|
|
6073
|
+
const Tag = component || (paragraph ? "p" : VARIANT_ELEMENT_MAP[variant] || "span");
|
|
6074
|
+
const colorClass = color ? COLOR_CLASSES[color] : "";
|
|
6075
|
+
const colorStyle = color && !COLOR_CLASSES[color] ? { color } : {};
|
|
6076
|
+
let weightClass = "";
|
|
6077
|
+
let weightStyle = {};
|
|
6078
|
+
if (fontWeight !== void 0) {
|
|
6079
|
+
if (typeof fontWeight === "string") {
|
|
6080
|
+
weightClass = WEIGHT_CLASSES[fontWeight] || "";
|
|
6087
6081
|
} else {
|
|
6088
|
-
|
|
6082
|
+
weightStyle = { fontWeight };
|
|
6089
6083
|
}
|
|
6090
|
-
}, [leaveDelay, clearTimers]);
|
|
6091
|
-
const handleMouseMove = useCallback5(
|
|
6092
|
-
(e) => {
|
|
6093
|
-
cursorPos.current = { x: e.clientX, y: e.clientY };
|
|
6094
|
-
if (isOpen && followCursor) {
|
|
6095
|
-
updatePosition();
|
|
6096
|
-
}
|
|
6097
|
-
},
|
|
6098
|
-
[isOpen, followCursor, updatePosition]
|
|
6099
|
-
);
|
|
6100
|
-
useEffect11(() => {
|
|
6101
|
-
return () => clearTimers();
|
|
6102
|
-
}, [clearTimers]);
|
|
6103
|
-
const childProps = {};
|
|
6104
|
-
if (!disableHoverListener) {
|
|
6105
|
-
childProps.onMouseEnter = handleOpen;
|
|
6106
|
-
childProps.onMouseLeave = handleClose;
|
|
6107
|
-
childProps.onMouseMove = followCursor ? handleMouseMove : void 0;
|
|
6108
|
-
}
|
|
6109
|
-
if (!disableFocusListener) {
|
|
6110
|
-
childProps.onFocus = handleOpen;
|
|
6111
|
-
childProps.onBlur = handleClose;
|
|
6112
6084
|
}
|
|
6113
|
-
const
|
|
6114
|
-
|
|
6115
|
-
|
|
6116
|
-
|
|
6085
|
+
const alignClass = align !== "inherit" ? `rf-typography--align-${align}` : "";
|
|
6086
|
+
const classes = [
|
|
6087
|
+
"rf-typography",
|
|
6088
|
+
`rf-typography--${variant}`,
|
|
6089
|
+
alignClass,
|
|
6090
|
+
colorClass,
|
|
6091
|
+
weightClass,
|
|
6092
|
+
noWrap ? "rf-typography--no-wrap" : "",
|
|
6093
|
+
gutterBottom ? "rf-typography--gutter-bottom" : "",
|
|
6094
|
+
paragraph ? "rf-typography--paragraph" : "",
|
|
6117
6095
|
sxClass,
|
|
6118
6096
|
className
|
|
6119
6097
|
].filter(Boolean).join(" ");
|
|
6120
|
-
const
|
|
6121
|
-
|
|
6122
|
-
|
|
6123
|
-
|
|
6124
|
-
|
|
6125
|
-
|
|
6126
|
-
|
|
6127
|
-
|
|
6128
|
-
|
|
6129
|
-
|
|
6130
|
-
|
|
6131
|
-
|
|
6132
|
-
|
|
6133
|
-
|
|
6134
|
-
|
|
6135
|
-
|
|
6136
|
-
|
|
6137
|
-
|
|
6138
|
-
|
|
6139
|
-
|
|
6140
|
-
|
|
6141
|
-
|
|
6142
|
-
|
|
6143
|
-
|
|
6144
|
-
|
|
6145
|
-
|
|
6098
|
+
const inlineStyle = {
|
|
6099
|
+
...colorStyle,
|
|
6100
|
+
...weightStyle,
|
|
6101
|
+
...style
|
|
6102
|
+
};
|
|
6103
|
+
return /* @__PURE__ */ React86.createElement(Tag, { className: classes, style: Object.keys(inlineStyle).length > 0 ? inlineStyle : void 0 }, children);
|
|
6104
|
+
};
|
|
6105
|
+
Typography.displayName = "Typography";
|
|
6106
|
+
|
|
6107
|
+
// lib/Skeleton/Skeleton.tsx
|
|
6108
|
+
import React87 from "react";
|
|
6109
|
+
var Skeleton = ({
|
|
6110
|
+
variant = "text",
|
|
6111
|
+
width,
|
|
6112
|
+
height,
|
|
6113
|
+
animation = "pulse",
|
|
6114
|
+
className = "",
|
|
6115
|
+
style,
|
|
6116
|
+
sx
|
|
6117
|
+
}) => {
|
|
6118
|
+
const sxClass = useSx(sx);
|
|
6119
|
+
const animationClass = animation === "pulse" ? "rf-skeleton--pulse" : animation === "wave" ? "rf-skeleton--wave" : "rf-skeleton--no-animation";
|
|
6120
|
+
const classes = [
|
|
6121
|
+
"rf-skeleton",
|
|
6122
|
+
`rf-skeleton--${variant}`,
|
|
6123
|
+
animationClass,
|
|
6124
|
+
sxClass,
|
|
6125
|
+
className
|
|
6126
|
+
].filter(Boolean).join(" ");
|
|
6127
|
+
const inlineStyle = {
|
|
6128
|
+
...width !== void 0 ? { width: typeof width === "number" ? width : width } : {},
|
|
6129
|
+
...height !== void 0 ? { height: typeof height === "number" ? height : height } : {},
|
|
6130
|
+
...style
|
|
6131
|
+
};
|
|
6132
|
+
if (variant === "text" && !height) {
|
|
6133
|
+
}
|
|
6134
|
+
if (variant === "circular" && !width && !height) {
|
|
6135
|
+
inlineStyle.width = 40;
|
|
6136
|
+
inlineStyle.height = 40;
|
|
6137
|
+
}
|
|
6138
|
+
if (variant === "rectangular" && !height) {
|
|
6139
|
+
inlineStyle.height = 140;
|
|
6140
|
+
}
|
|
6141
|
+
if (variant === "rounded" && !height) {
|
|
6142
|
+
inlineStyle.height = 140;
|
|
6143
|
+
}
|
|
6144
|
+
return /* @__PURE__ */ React87.createElement(
|
|
6146
6145
|
"span",
|
|
6147
6146
|
{
|
|
6148
|
-
|
|
6149
|
-
style:
|
|
6150
|
-
"aria-
|
|
6151
|
-
|
|
6152
|
-
}
|
|
6153
|
-
|
|
6154
|
-
), ReactDOM4.createPortal(tooltipElement, document.body));
|
|
6147
|
+
className: classes,
|
|
6148
|
+
style: Object.keys(inlineStyle).length > 0 ? inlineStyle : void 0,
|
|
6149
|
+
"aria-busy": "true",
|
|
6150
|
+
"aria-live": "polite"
|
|
6151
|
+
}
|
|
6152
|
+
);
|
|
6155
6153
|
};
|
|
6156
|
-
|
|
6154
|
+
Skeleton.displayName = "Skeleton";
|
|
6157
6155
|
|
|
6158
6156
|
// lib/Box/Box.tsx
|
|
6159
6157
|
import * as React88 from "react";
|
|
@@ -8646,7 +8644,7 @@ var TextToSpeech = forwardRef12(({ editor, onTextToSpeech }, ref) => {
|
|
|
8646
8644
|
setPaused(false);
|
|
8647
8645
|
}, []);
|
|
8648
8646
|
useImperativeHandle2(ref, () => ({ stop: handleStop }), [handleStop]);
|
|
8649
|
-
return /* @__PURE__ */ React107.createElement("div", { className: "tts-wrapper", ref: panelRef }, /* @__PURE__ */ React107.createElement(
|
|
8647
|
+
return /* @__PURE__ */ React107.createElement("div", { className: "tts-wrapper", ref: panelRef }, /* @__PURE__ */ React107.createElement(Tooltip, { title: "Text to Speech", placement: "top" }, /* @__PURE__ */ React107.createElement(
|
|
8650
8648
|
"button",
|
|
8651
8649
|
{
|
|
8652
8650
|
className: `toolbar-btn ${speaking ? "is-active" : ""}`,
|
|
@@ -8656,11 +8654,10 @@ var TextToSpeech = forwardRef12(({ editor, onTextToSpeech }, ref) => {
|
|
|
8656
8654
|
} else {
|
|
8657
8655
|
setShowPanel(!showPanel);
|
|
8658
8656
|
}
|
|
8659
|
-
}
|
|
8660
|
-
title: "Text to Speech"
|
|
8657
|
+
}
|
|
8661
8658
|
},
|
|
8662
8659
|
speaking ? "\u23F9" : "\u{1F50A}"
|
|
8663
|
-
), showPanel && !speaking && /* @__PURE__ */ React107.createElement("div", { className: "tts-panel" }, /* @__PURE__ */ React107.createElement("div", { className: "tts-panel-header" }, "Text to Speech"), /* @__PURE__ */ React107.createElement("label", { className: "tts-label" }, "Voice"), /* @__PURE__ */ React107.createElement(
|
|
8660
|
+
)), showPanel && !speaking && /* @__PURE__ */ React107.createElement("div", { className: "tts-panel" }, /* @__PURE__ */ React107.createElement("div", { className: "tts-panel-header" }, "Text to Speech"), /* @__PURE__ */ React107.createElement("label", { className: "tts-label" }, "Voice"), /* @__PURE__ */ React107.createElement(
|
|
8664
8661
|
"select",
|
|
8665
8662
|
{
|
|
8666
8663
|
className: "tts-select",
|
|
@@ -8682,7 +8679,7 @@ var TextToSpeech = forwardRef12(({ editor, onTextToSpeech }, ref) => {
|
|
|
8682
8679
|
), /* @__PURE__ */ React107.createElement("div", { className: "tts-info" }, editor && !editor.state.selection.empty ? "Will read selected text" : "Will read all editor text"), /* @__PURE__ */ React107.createElement("button", { className: "tts-speak-btn", onClick: () => {
|
|
8683
8680
|
handleSpeak();
|
|
8684
8681
|
setShowPanel(false);
|
|
8685
|
-
} }, "\u25B6 Speak")), speaking && /* @__PURE__ */ React107.createElement("div", { className: "tts-controls" }, paused ? /* @__PURE__ */ React107.createElement("button", { className: "toolbar-btn", onClick: handleResume, title: "
|
|
8682
|
+
} }, "\u25B6 Speak")), speaking && /* @__PURE__ */ React107.createElement("div", { className: "tts-controls" }, paused ? /* @__PURE__ */ React107.createElement(Tooltip, { title: "Resume", placement: "top" }, /* @__PURE__ */ React107.createElement("button", { className: "toolbar-btn", onClick: handleResume }, "\u25B6")) : /* @__PURE__ */ React107.createElement(Tooltip, { title: "Pause", placement: "top" }, /* @__PURE__ */ React107.createElement("button", { className: "toolbar-btn", onClick: handlePause }, "\u275A\u275A")), /* @__PURE__ */ React107.createElement(Tooltip, { title: "Stop", placement: "top" }, /* @__PURE__ */ React107.createElement("button", { className: "toolbar-btn", onClick: handleStop }, "\u25A0"))));
|
|
8686
8683
|
});
|
|
8687
8684
|
var TextToSpeech_default = TextToSpeech;
|
|
8688
8685
|
|
|
@@ -8801,7 +8798,7 @@ var SpeechToText = forwardRef13(({ editor, onSpeechToText }, ref) => {
|
|
|
8801
8798
|
}, []);
|
|
8802
8799
|
useImperativeHandle3(ref, () => ({ stop: stopListening }), [stopListening]);
|
|
8803
8800
|
if (!supported) {
|
|
8804
|
-
return /* @__PURE__ */ React108.createElement(
|
|
8801
|
+
return /* @__PURE__ */ React108.createElement(Tooltip, { title: "Speech recognition not supported in this browser", placement: "top" }, /* @__PURE__ */ React108.createElement("button", { className: "toolbar-btn", disabled: true }, "\u{1F3A4}"));
|
|
8805
8802
|
}
|
|
8806
8803
|
const LANGUAGES2 = [
|
|
8807
8804
|
{ code: "en-US", label: "English (US)" },
|
|
@@ -8823,7 +8820,7 @@ var SpeechToText = forwardRef13(({ editor, onSpeechToText }, ref) => {
|
|
|
8823
8820
|
{ code: "kn-IN", label: "Kannada" },
|
|
8824
8821
|
{ code: "ml-IN", label: "Malayalam" }
|
|
8825
8822
|
];
|
|
8826
|
-
return /* @__PURE__ */ React108.createElement("div", { className: "stt-wrapper", ref: panelRef }, /* @__PURE__ */ React108.createElement(
|
|
8823
|
+
return /* @__PURE__ */ React108.createElement("div", { className: "stt-wrapper", ref: panelRef }, /* @__PURE__ */ React108.createElement(Tooltip, { title: listening ? "Stop recording" : "Speech to Text", placement: "top" }, /* @__PURE__ */ React108.createElement(
|
|
8827
8824
|
"button",
|
|
8828
8825
|
{
|
|
8829
8826
|
className: `toolbar-btn ${listening ? "is-active stt-recording" : ""}`,
|
|
@@ -8833,11 +8830,10 @@ var SpeechToText = forwardRef13(({ editor, onSpeechToText }, ref) => {
|
|
|
8833
8830
|
} else {
|
|
8834
8831
|
setShowPanel(!showPanel);
|
|
8835
8832
|
}
|
|
8836
|
-
}
|
|
8837
|
-
title: listening ? "Stop recording" : "Speech to Text"
|
|
8833
|
+
}
|
|
8838
8834
|
},
|
|
8839
8835
|
"\u{1F3A4}"
|
|
8840
|
-
), showPanel && !listening && /* @__PURE__ */ React108.createElement("div", { className: "stt-panel" }, /* @__PURE__ */ React108.createElement("div", { className: "stt-panel-header" }, "Speech to Text"), /* @__PURE__ */ React108.createElement("label", { className: "stt-label" }, "Language"), /* @__PURE__ */ React108.createElement(
|
|
8836
|
+
)), showPanel && !listening && /* @__PURE__ */ React108.createElement("div", { className: "stt-panel" }, /* @__PURE__ */ React108.createElement("div", { className: "stt-panel-header" }, "Speech to Text"), /* @__PURE__ */ React108.createElement("label", { className: "stt-label" }, "Language"), /* @__PURE__ */ React108.createElement(
|
|
8841
8837
|
"select",
|
|
8842
8838
|
{
|
|
8843
8839
|
className: "stt-select",
|
|
@@ -8991,16 +8987,15 @@ var AICommands = ({ editor, onAICommand }) => {
|
|
|
8991
8987
|
setPreviousResults([]);
|
|
8992
8988
|
}, []);
|
|
8993
8989
|
if (!editor) return null;
|
|
8994
|
-
return /* @__PURE__ */ React109.createElement(React109.Fragment, null, /* @__PURE__ */ React109.createElement("div", { className: "ai-commands-wrapper", ref: panelRef }, /* @__PURE__ */ React109.createElement(
|
|
8990
|
+
return /* @__PURE__ */ React109.createElement(React109.Fragment, null, /* @__PURE__ */ React109.createElement("div", { className: "ai-commands-wrapper", ref: panelRef }, /* @__PURE__ */ React109.createElement(Tooltip, { title: "AI Commands", placement: "top" }, /* @__PURE__ */ React109.createElement(
|
|
8995
8991
|
"button",
|
|
8996
8992
|
{
|
|
8997
8993
|
className: `toolbar-btn ${open ? "is-active" : ""}`,
|
|
8998
|
-
onClick: () => setOpen(!open)
|
|
8999
|
-
title: "AI Commands"
|
|
8994
|
+
onClick: () => setOpen(!open)
|
|
9000
8995
|
},
|
|
9001
8996
|
/* @__PURE__ */ React109.createElement("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "currentColor", stroke: "none" }, /* @__PURE__ */ React109.createElement("path", { d: "M9 2l1.5 3L14 6.5 10.5 8 9 11 7.5 8 4 6.5 7.5 5zM18 10l1 2 2 1-2 1-1 2-1-2-2-1 2-1zM5 17l1.5 3L10 21.5 6.5 23 5 26 3.5 23 0 21.5 3.5 20z" })),
|
|
9002
8997
|
/* @__PURE__ */ React109.createElement("span", { className: "dropdown-arrow" }, "\u25BE")
|
|
9003
|
-
), open && /* @__PURE__ */ React109.createElement("div", { className: "ai-commands-panel" }, /* @__PURE__ */ React109.createElement("div", { className: "ai-commands-header" }, "AI Commands"), /* @__PURE__ */ React109.createElement("div", { className: "ai-commands-list" }, AI_COMMANDS.map((cmd) => /* @__PURE__ */ React109.createElement(
|
|
8998
|
+
)), open && /* @__PURE__ */ React109.createElement("div", { className: "ai-commands-panel" }, /* @__PURE__ */ React109.createElement("div", { className: "ai-commands-header" }, "AI Commands"), /* @__PURE__ */ React109.createElement("div", { className: "ai-commands-list" }, AI_COMMANDS.map((cmd) => /* @__PURE__ */ React109.createElement(
|
|
9004
8999
|
"button",
|
|
9005
9000
|
{
|
|
9006
9001
|
key: cmd.id,
|
|
@@ -9017,16 +9012,15 @@ var AICommands = ({ editor, onAICommand }) => {
|
|
|
9017
9012
|
onChange: (e) => setPromptText(e.target.value),
|
|
9018
9013
|
rows: 3
|
|
9019
9014
|
}
|
|
9020
|
-
), /* @__PURE__ */ React109.createElement(
|
|
9015
|
+
), /* @__PURE__ */ React109.createElement(Tooltip, { title: "Run with custom prompt", placement: "top" }, /* @__PURE__ */ React109.createElement(
|
|
9021
9016
|
"button",
|
|
9022
9017
|
{
|
|
9023
9018
|
className: "ai-modal-robot-btn",
|
|
9024
9019
|
onClick: () => fetchAIResult(promptText, originalText),
|
|
9025
|
-
disabled: loading
|
|
9026
|
-
title: "Run with custom prompt"
|
|
9020
|
+
disabled: loading
|
|
9027
9021
|
},
|
|
9028
9022
|
/* @__PURE__ */ React109.createElement("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React109.createElement("rect", { x: "3", y: "11", width: "18", height: "10", rx: "2" }), /* @__PURE__ */ React109.createElement("circle", { cx: "9", cy: "16", r: "1" }), /* @__PURE__ */ React109.createElement("circle", { cx: "15", cy: "16", r: "1" }), /* @__PURE__ */ React109.createElement("path", { d: "M12 2v4" }), /* @__PURE__ */ React109.createElement("path", { d: "M8 7h8" }))
|
|
9029
|
-
))), /* @__PURE__ */ React109.createElement("div", { className: "ai-modal-actions" }, /* @__PURE__ */ React109.createElement(
|
|
9023
|
+
)))), /* @__PURE__ */ React109.createElement("div", { className: "ai-modal-actions" }, /* @__PURE__ */ React109.createElement(
|
|
9030
9024
|
"button",
|
|
9031
9025
|
{
|
|
9032
9026
|
className: "ai-modal-action-btn ai-modal-insert-btn",
|
|
@@ -9042,16 +9036,15 @@ var AICommands = ({ editor, onAICommand }) => {
|
|
|
9042
9036
|
disabled: loading || !resultText
|
|
9043
9037
|
},
|
|
9044
9038
|
"Insert After"
|
|
9045
|
-
), /* @__PURE__ */ React109.createElement(
|
|
9039
|
+
), /* @__PURE__ */ React109.createElement(Tooltip, { title: "Generate another response", placement: "top" }, /* @__PURE__ */ React109.createElement(
|
|
9046
9040
|
"button",
|
|
9047
9041
|
{
|
|
9048
9042
|
className: "ai-modal-action-btn ai-modal-refresh-btn",
|
|
9049
9043
|
onClick: handleRefresh,
|
|
9050
|
-
disabled: loading
|
|
9051
|
-
title: "Generate another response"
|
|
9044
|
+
disabled: loading
|
|
9052
9045
|
},
|
|
9053
9046
|
/* @__PURE__ */ React109.createElement("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React109.createElement("path", { d: "M21 2v6h-6" }), /* @__PURE__ */ React109.createElement("path", { d: "M3 12a9 9 0 0 1 15-6.7L21 8" }), /* @__PURE__ */ React109.createElement("path", { d: "M3 22v-6h6" }), /* @__PURE__ */ React109.createElement("path", { d: "M21 12a9 9 0 0 1-15 6.7L3 16" }))
|
|
9054
|
-
)), /* @__PURE__ */ React109.createElement("div", { className: "ai-modal-result-section" }, loading ? /* @__PURE__ */ React109.createElement("div", { className: "ai-modal-loading" }, /* @__PURE__ */ React109.createElement("span", { className: "ai-spinner" }), /* @__PURE__ */ React109.createElement("span", null, "Generating response...")) : /* @__PURE__ */ React109.createElement("div", { className: "ai-modal-result" }, resultText)), /* @__PURE__ */ React109.createElement("div", { className: "ai-modal-footer" }, /* @__PURE__ */ React109.createElement("button", { className: "ai-modal-cancel-btn", onClick: handleCancel }, "CANCEL")))),
|
|
9047
|
+
))), /* @__PURE__ */ React109.createElement("div", { className: "ai-modal-result-section" }, loading ? /* @__PURE__ */ React109.createElement("div", { className: "ai-modal-loading" }, /* @__PURE__ */ React109.createElement("span", { className: "ai-spinner" }), /* @__PURE__ */ React109.createElement("span", null, "Generating response...")) : /* @__PURE__ */ React109.createElement("div", { className: "ai-modal-result" }, resultText)), /* @__PURE__ */ React109.createElement("div", { className: "ai-modal-footer" }, /* @__PURE__ */ React109.createElement("button", { className: "ai-modal-cancel-btn", onClick: handleCancel }, "CANCEL")))),
|
|
9055
9048
|
document.body
|
|
9056
9049
|
));
|
|
9057
9050
|
};
|
|
@@ -9269,7 +9262,7 @@ var TranslateModal = ({ editor, onClose, onTranslate, initialSource, initialTarg
|
|
|
9269
9262
|
},
|
|
9270
9263
|
/* @__PURE__ */ React110.createElement("span", { className: "translate-code" }, lang.code),
|
|
9271
9264
|
/* @__PURE__ */ React110.createElement("span", { className: "translate-name" }, lang.name)
|
|
9272
|
-
)))), /* @__PURE__ */ React110.createElement("div", { className: "translate-swap" }, /* @__PURE__ */ React110.createElement("button", { className: "translate-swap-btn", onClick: handleSwap
|
|
9265
|
+
)))), /* @__PURE__ */ React110.createElement("div", { className: "translate-swap" }, /* @__PURE__ */ React110.createElement(Tooltip, { title: "Swap languages", placement: "top" }, /* @__PURE__ */ React110.createElement("button", { className: "translate-swap-btn", onClick: handleSwap }, "\u21C4"))), /* @__PURE__ */ React110.createElement("div", { className: "translate-col" }, /* @__PURE__ */ React110.createElement("div", { className: "translate-filter" }, /* @__PURE__ */ React110.createElement(
|
|
9273
9266
|
"input",
|
|
9274
9267
|
{
|
|
9275
9268
|
type: "text",
|
|
@@ -10151,16 +10144,15 @@ var Dropdown = ({ trigger, children, className = "", keepOpen = false }) => {
|
|
|
10151
10144
|
};
|
|
10152
10145
|
position();
|
|
10153
10146
|
}, [open]);
|
|
10154
|
-
return /* @__PURE__ */ React112.createElement("div", { className: `dropdown ${className}`, ref }, /* @__PURE__ */ React112.createElement(
|
|
10147
|
+
return /* @__PURE__ */ React112.createElement("div", { className: `dropdown ${className}`, ref }, /* @__PURE__ */ React112.createElement(Tooltip, { title: trigger.title || "", placement: "top" }, /* @__PURE__ */ React112.createElement(
|
|
10155
10148
|
"button",
|
|
10156
10149
|
{
|
|
10157
10150
|
className: `toolbar-btn ${trigger.className || ""}`,
|
|
10158
|
-
onClick: () => setOpen(!open)
|
|
10159
|
-
title: trigger.title
|
|
10151
|
+
onClick: () => setOpen(!open)
|
|
10160
10152
|
},
|
|
10161
10153
|
trigger.label,
|
|
10162
10154
|
/* @__PURE__ */ React112.createElement("span", { className: "dropdown-arrow" }, "\u25BE")
|
|
10163
|
-
), open && createPortal4(
|
|
10155
|
+
)), open && createPortal4(
|
|
10164
10156
|
/* @__PURE__ */ React112.createElement("div", { className: "rf-rte-wrapper rf-rte-dropdown-portal" }, /* @__PURE__ */ React112.createElement("div", { ref: menuRef, className: "dropdown-menu dropdown-menu-fixed", onClick: keepOpen ? void 0 : () => setOpen(false) }, typeof children === "function" ? children(() => setOpen(false)) : children)),
|
|
10165
10157
|
document.body
|
|
10166
10158
|
));
|
|
@@ -10406,16 +10398,14 @@ var ColorPickerPanel = ({ editor, onClose }) => {
|
|
|
10406
10398
|
onClick: () => setTab("text")
|
|
10407
10399
|
},
|
|
10408
10400
|
"Text"
|
|
10409
|
-
)), /* @__PURE__ */ React112.createElement("div", { className: "color-picker-grid" }, COLOR_PALETTE.map((color, i) => /* @__PURE__ */ React112.createElement(
|
|
10401
|
+
)), /* @__PURE__ */ React112.createElement("div", { className: "color-picker-grid" }, COLOR_PALETTE.map((color, i) => /* @__PURE__ */ React112.createElement(Tooltip, { key: i, title: color, placement: "top" }, /* @__PURE__ */ React112.createElement(
|
|
10410
10402
|
"button",
|
|
10411
10403
|
{
|
|
10412
|
-
key: i,
|
|
10413
10404
|
className: `color-picker-swatch ${color === "#ffffff" ? "white-swatch" : ""}${activeColor && activeColor.toLowerCase() === color.toLowerCase() ? " swatch-active" : ""}`,
|
|
10414
10405
|
style: { background: color },
|
|
10415
|
-
onClick: () => applyColor(color)
|
|
10416
|
-
title: color
|
|
10406
|
+
onClick: () => applyColor(color)
|
|
10417
10407
|
}
|
|
10418
|
-
))), /* @__PURE__ */ React112.createElement("div", { className: "color-picker-footer" }, /* @__PURE__ */ React112.createElement("div", { className: "color-picker-preview", style: { background: activeColor || "#000" } }), /* @__PURE__ */ React112.createElement("button", { className: "color-picker-remove", onClick: removeColor
|
|
10408
|
+
)))), /* @__PURE__ */ React112.createElement("div", { className: "color-picker-footer" }, /* @__PURE__ */ React112.createElement("div", { className: "color-picker-preview", style: { background: activeColor || "#000" } }), /* @__PURE__ */ React112.createElement(Tooltip, { title: "Remove color", placement: "top" }, /* @__PURE__ */ React112.createElement("button", { className: "color-picker-remove", onClick: removeColor }, "\u2713"))));
|
|
10419
10409
|
};
|
|
10420
10410
|
var Toolbar = ({ editor, setLink, onAICommand, onTranslate, onSpeechToText, onTextToSpeech, onClose, onImageUpload, visibleButtons, isFullscreen, onToggleFullscreen }) => {
|
|
10421
10411
|
const [, setEditorState] = useState30(0);
|
|
@@ -10496,25 +10486,23 @@ var Toolbar = ({ editor, setLink, onAICommand, onTranslate, onSpeechToText, onTe
|
|
|
10496
10486
|
setTimeout(() => setTranslateStatus(""), 2e3);
|
|
10497
10487
|
}, [editor, translateSource, translateTarget, onTranslate]);
|
|
10498
10488
|
if (!editor) return null;
|
|
10499
|
-
return /* @__PURE__ */ React112.createElement("div", { className: "toolbar" }, /* @__PURE__ */ React112.createElement("div", { className: `toolbar-row ${onClose ? "with-close" : ""}` }, (show("undo") || show("redo")) && /* @__PURE__ */ React112.createElement("div", { className: "toolbar-group" }, show("undo") && /* @__PURE__ */ React112.createElement(
|
|
10489
|
+
return /* @__PURE__ */ React112.createElement("div", { className: "toolbar" }, /* @__PURE__ */ React112.createElement("div", { className: `toolbar-row ${onClose ? "with-close" : ""}` }, (show("undo") || show("redo")) && /* @__PURE__ */ React112.createElement("div", { className: "toolbar-group" }, show("undo") && /* @__PURE__ */ React112.createElement(Tooltip, { title: "Undo (Ctrl+Z)", placement: "top" }, /* @__PURE__ */ React112.createElement(
|
|
10500
10490
|
"button",
|
|
10501
10491
|
{
|
|
10502
10492
|
className: "toolbar-btn",
|
|
10503
10493
|
onClick: () => editor.chain().focus().undo().run(),
|
|
10504
|
-
disabled: !editor.can().undo()
|
|
10505
|
-
title: "Undo (Ctrl+Z)"
|
|
10494
|
+
disabled: !editor.can().undo()
|
|
10506
10495
|
},
|
|
10507
10496
|
/* @__PURE__ */ React112.createElement(IconUndo, null)
|
|
10508
|
-
), show("redo") && /* @__PURE__ */ React112.createElement(
|
|
10497
|
+
)), show("redo") && /* @__PURE__ */ React112.createElement(Tooltip, { title: "Redo (Ctrl+Y)", placement: "top" }, /* @__PURE__ */ React112.createElement(
|
|
10509
10498
|
"button",
|
|
10510
10499
|
{
|
|
10511
10500
|
className: "toolbar-btn",
|
|
10512
10501
|
onClick: () => editor.chain().focus().redo().run(),
|
|
10513
|
-
disabled: !editor.can().redo()
|
|
10514
|
-
title: "Redo (Ctrl+Y)"
|
|
10502
|
+
disabled: !editor.can().redo()
|
|
10515
10503
|
},
|
|
10516
10504
|
/* @__PURE__ */ React112.createElement(IconRedo, null)
|
|
10517
|
-
)), show("ai") && /* @__PURE__ */ React112.createElement("div", { className: "toolbar-group" }, /* @__PURE__ */ React112.createElement(AICommands_default, { editor, onAICommand })), /* @__PURE__ */ React112.createElement("div", { className: "toolbar-group" }, show("paragraph") && /* @__PURE__ */ React112.createElement(
|
|
10505
|
+
))), show("ai") && /* @__PURE__ */ React112.createElement("div", { className: "toolbar-group" }, /* @__PURE__ */ React112.createElement(AICommands_default, { editor, onAICommand })), /* @__PURE__ */ React112.createElement("div", { className: "toolbar-group" }, show("paragraph") && /* @__PURE__ */ React112.createElement(
|
|
10518
10506
|
Dropdown,
|
|
10519
10507
|
{
|
|
10520
10508
|
trigger: {
|
|
@@ -10645,23 +10633,21 @@ var Toolbar = ({ editor, setLink, onAICommand, onTranslate, onSpeechToText, onTe
|
|
|
10645
10633
|
keepOpen: true
|
|
10646
10634
|
},
|
|
10647
10635
|
(close) => /* @__PURE__ */ React112.createElement(ColorPickerPanel, { editor, onClose: close })
|
|
10648
|
-
), show("bold") && /* @__PURE__ */ React112.createElement(
|
|
10636
|
+
), show("bold") && /* @__PURE__ */ React112.createElement(Tooltip, { title: "Bold (Ctrl+B)", placement: "top" }, /* @__PURE__ */ React112.createElement(
|
|
10649
10637
|
"button",
|
|
10650
10638
|
{
|
|
10651
10639
|
className: `toolbar-btn ${editor.isActive("bold") ? "is-active" : ""}`,
|
|
10652
|
-
onClick: () => editor.chain().focus().toggleBold().run()
|
|
10653
|
-
title: "Bold (Ctrl+B)"
|
|
10640
|
+
onClick: () => editor.chain().focus().toggleBold().run()
|
|
10654
10641
|
},
|
|
10655
10642
|
/* @__PURE__ */ React112.createElement(IconBold, null)
|
|
10656
|
-
), show("italic") && /* @__PURE__ */ React112.createElement(
|
|
10643
|
+
)), show("italic") && /* @__PURE__ */ React112.createElement(Tooltip, { title: "Italic (Ctrl+I)", placement: "top" }, /* @__PURE__ */ React112.createElement(
|
|
10657
10644
|
"button",
|
|
10658
10645
|
{
|
|
10659
10646
|
className: `toolbar-btn ${editor.isActive("italic") ? "is-active" : ""}`,
|
|
10660
|
-
onClick: () => editor.chain().focus().toggleItalic().run()
|
|
10661
|
-
title: "Italic (Ctrl+I)"
|
|
10647
|
+
onClick: () => editor.chain().focus().toggleItalic().run()
|
|
10662
10648
|
},
|
|
10663
10649
|
/* @__PURE__ */ React112.createElement(IconItalic, null)
|
|
10664
|
-
), show("strike") && /* @__PURE__ */ React112.createElement(
|
|
10650
|
+
)), show("strike") && /* @__PURE__ */ React112.createElement(
|
|
10665
10651
|
Dropdown,
|
|
10666
10652
|
{
|
|
10667
10653
|
trigger: { label: /* @__PURE__ */ React112.createElement(IconStrike, null), title: "Text decoration", className: editor.isActive("strike") ? "is-active" : "" }
|
|
@@ -10686,15 +10672,14 @@ var Toolbar = ({ editor, setLink, onAICommand, onTranslate, onSpeechToText, onTe
|
|
|
10686
10672
|
c.run();
|
|
10687
10673
|
}
|
|
10688
10674
|
} }, "\u2715 Clear formatting")
|
|
10689
|
-
), show("link") && /* @__PURE__ */ React112.createElement(
|
|
10675
|
+
), show("link") && /* @__PURE__ */ React112.createElement(Tooltip, { title: "Insert Link", placement: "top" }, /* @__PURE__ */ React112.createElement(
|
|
10690
10676
|
"button",
|
|
10691
10677
|
{
|
|
10692
10678
|
className: `toolbar-btn ${editor.isActive("link") ? "is-active" : ""}`,
|
|
10693
|
-
onClick: setLink
|
|
10694
|
-
title: "Insert Link"
|
|
10679
|
+
onClick: setLink
|
|
10695
10680
|
},
|
|
10696
10681
|
/* @__PURE__ */ React112.createElement(IconLink, null)
|
|
10697
|
-
), show("lineheight") && /* @__PURE__ */ React112.createElement(
|
|
10682
|
+
)), show("lineheight") && /* @__PURE__ */ React112.createElement(
|
|
10698
10683
|
Dropdown,
|
|
10699
10684
|
{
|
|
10700
10685
|
trigger: {
|
|
@@ -10721,15 +10706,14 @@ var Toolbar = ({ editor, setLink, onAICommand, onTranslate, onSpeechToText, onTe
|
|
|
10721
10706
|
lh
|
|
10722
10707
|
);
|
|
10723
10708
|
})
|
|
10724
|
-
)), (show("ul") || show("ol")) && /* @__PURE__ */ React112.createElement("div", { className: "toolbar-group" }, show("ul") && /* @__PURE__ */ React112.createElement("div", { className: "list-split-btn" }, /* @__PURE__ */ React112.createElement(
|
|
10709
|
+
)), (show("ul") || show("ol")) && /* @__PURE__ */ React112.createElement("div", { className: "toolbar-group" }, show("ul") && /* @__PURE__ */ React112.createElement("div", { className: "list-split-btn" }, /* @__PURE__ */ React112.createElement(Tooltip, { title: editor.isActive("bulletList") ? "Disable Bullet List" : "Enable Bullet List", placement: "top" }, /* @__PURE__ */ React112.createElement(
|
|
10725
10710
|
"button",
|
|
10726
10711
|
{
|
|
10727
10712
|
className: `toolbar-btn ${editor.isActive("bulletList") ? "is-active" : ""}`,
|
|
10728
|
-
onClick: () => editor.chain().focus().toggleBulletList().run()
|
|
10729
|
-
title: editor.isActive("bulletList") ? "Disable Bullet List" : "Enable Bullet List"
|
|
10713
|
+
onClick: () => editor.chain().focus().toggleBulletList().run()
|
|
10730
10714
|
},
|
|
10731
10715
|
/* @__PURE__ */ React112.createElement(IconBulletList, null)
|
|
10732
|
-
), /* @__PURE__ */ React112.createElement(Dropdown, { trigger: { label: "", title: "List style", className: "list-arrow-btn" }, keepOpen: true }, [
|
|
10716
|
+
)), /* @__PURE__ */ React112.createElement(Dropdown, { trigger: { label: "", title: "List style", className: "list-arrow-btn" }, keepOpen: true }, [
|
|
10733
10717
|
{ label: "Default", style: null, icon: "\u2022" },
|
|
10734
10718
|
{ label: "Circle", style: "circle", icon: "\u25CB" },
|
|
10735
10719
|
{ label: "Dot", style: "disc", icon: "\u2219" },
|
|
@@ -10762,15 +10746,14 @@ var Toolbar = ({ editor, setLink, onAICommand, onTranslate, onSpeechToText, onTe
|
|
|
10762
10746
|
/* @__PURE__ */ React112.createElement("span", { className: "bullet-style-icon" }, item.icon),
|
|
10763
10747
|
" ",
|
|
10764
10748
|
item.label
|
|
10765
|
-
)))), show("ol") && /* @__PURE__ */ React112.createElement("div", { className: "list-split-btn" }, /* @__PURE__ */ React112.createElement(
|
|
10749
|
+
)))), show("ol") && /* @__PURE__ */ React112.createElement("div", { className: "list-split-btn" }, /* @__PURE__ */ React112.createElement(Tooltip, { title: editor.isActive("orderedList") ? "Disable Ordered List" : "Enable Ordered List", placement: "top" }, /* @__PURE__ */ React112.createElement(
|
|
10766
10750
|
"button",
|
|
10767
10751
|
{
|
|
10768
10752
|
className: `toolbar-btn ${editor.isActive("orderedList") ? "is-active" : ""}`,
|
|
10769
|
-
onClick: () => editor.chain().focus().toggleOrderedList().run()
|
|
10770
|
-
title: editor.isActive("orderedList") ? "Disable Ordered List" : "Enable Ordered List"
|
|
10753
|
+
onClick: () => editor.chain().focus().toggleOrderedList().run()
|
|
10771
10754
|
},
|
|
10772
10755
|
/* @__PURE__ */ React112.createElement(IconOrderedList, null)
|
|
10773
|
-
), /* @__PURE__ */ React112.createElement(Dropdown, { trigger: { label: "", title: "List style", className: "list-arrow-btn" }, keepOpen: true }, [
|
|
10756
|
+
)), /* @__PURE__ */ React112.createElement(Dropdown, { trigger: { label: "", title: "List style", className: "list-arrow-btn" }, keepOpen: true }, [
|
|
10774
10757
|
{ label: "Default", style: "decimal", icon: "1." },
|
|
10775
10758
|
{ label: "Lower Alpha", style: "lower-alpha", icon: "a." },
|
|
10776
10759
|
{ label: "Lower Greek", style: "lower-greek", icon: "\u03B1." },
|
|
@@ -10830,7 +10813,7 @@ var Toolbar = ({ editor, setLink, onAICommand, onTranslate, onSpeechToText, onTe
|
|
|
10830
10813
|
" ",
|
|
10831
10814
|
item.label
|
|
10832
10815
|
))
|
|
10833
|
-
), show("indent") && /* @__PURE__ */ React112.createElement(
|
|
10816
|
+
), show("indent") && /* @__PURE__ */ React112.createElement(Tooltip, { title: "Increase Indent", placement: "top" }, /* @__PURE__ */ React112.createElement(
|
|
10834
10817
|
"button",
|
|
10835
10818
|
{
|
|
10836
10819
|
className: "toolbar-btn",
|
|
@@ -10847,11 +10830,10 @@ var Toolbar = ({ editor, setLink, onAICommand, onTranslate, onSpeechToText, onTe
|
|
|
10847
10830
|
});
|
|
10848
10831
|
return true;
|
|
10849
10832
|
}).run();
|
|
10850
|
-
}
|
|
10851
|
-
title: "Increase Indent"
|
|
10833
|
+
}
|
|
10852
10834
|
},
|
|
10853
10835
|
/* @__PURE__ */ React112.createElement(IconIndentIncrease, null)
|
|
10854
|
-
), show("outdent") && /* @__PURE__ */ React112.createElement(
|
|
10836
|
+
)), show("outdent") && /* @__PURE__ */ React112.createElement(Tooltip, { title: "Decrease Indent", placement: "top" }, /* @__PURE__ */ React112.createElement(
|
|
10855
10837
|
"button",
|
|
10856
10838
|
{
|
|
10857
10839
|
className: "toolbar-btn",
|
|
@@ -10868,35 +10850,31 @@ var Toolbar = ({ editor, setLink, onAICommand, onTranslate, onSpeechToText, onTe
|
|
|
10868
10850
|
});
|
|
10869
10851
|
return true;
|
|
10870
10852
|
}).run();
|
|
10871
|
-
}
|
|
10872
|
-
title: "Decrease Indent"
|
|
10853
|
+
}
|
|
10873
10854
|
},
|
|
10874
10855
|
/* @__PURE__ */ React112.createElement(IconIndentDecrease, null)
|
|
10875
|
-
)), show("table") && /* @__PURE__ */ React112.createElement(Dropdown, { trigger: { label: /* @__PURE__ */ React112.createElement(IconTable, null), title: "Insert Table" }, keepOpen: true }, (close) => /* @__PURE__ */ React112.createElement(TableGridSelector, { editor, onClose: close })), show("image") && /* @__PURE__ */ React112.createElement(Dropdown, { trigger: { label: /* @__PURE__ */ React112.createElement(IconImage, null), title: "Insert Image" }, keepOpen: true }, (close) => /* @__PURE__ */ React112.createElement(ImagePanel, { editor, onClose: close, onImageUpload })), show("video") && /* @__PURE__ */ React112.createElement(Dropdown, { trigger: { label: /* @__PURE__ */ React112.createElement(IconVideo, null), title: "Insert Video" }, keepOpen: true }, (close) => /* @__PURE__ */ React112.createElement(InsertPanel, { editor, onClose: close, mode: "video" })), show("cut") && /* @__PURE__ */ React112.createElement(
|
|
10856
|
+
))), show("table") && /* @__PURE__ */ React112.createElement(Dropdown, { trigger: { label: /* @__PURE__ */ React112.createElement(IconTable, null), title: "Insert Table" }, keepOpen: true }, (close) => /* @__PURE__ */ React112.createElement(TableGridSelector, { editor, onClose: close })), show("image") && /* @__PURE__ */ React112.createElement(Dropdown, { trigger: { label: /* @__PURE__ */ React112.createElement(IconImage, null), title: "Insert Image" }, keepOpen: true }, (close) => /* @__PURE__ */ React112.createElement(ImagePanel, { editor, onClose: close, onImageUpload })), show("video") && /* @__PURE__ */ React112.createElement(Dropdown, { trigger: { label: /* @__PURE__ */ React112.createElement(IconVideo, null), title: "Insert Video" }, keepOpen: true }, (close) => /* @__PURE__ */ React112.createElement(InsertPanel, { editor, onClose: close, mode: "video" })), show("cut") && /* @__PURE__ */ React112.createElement(Tooltip, { title: "Cut (Ctrl+X)", placement: "top" }, /* @__PURE__ */ React112.createElement(
|
|
10876
10857
|
"button",
|
|
10877
10858
|
{
|
|
10878
10859
|
className: "toolbar-btn",
|
|
10879
|
-
onClick: () => document.execCommand("cut")
|
|
10880
|
-
title: "Cut (Ctrl+X)"
|
|
10860
|
+
onClick: () => document.execCommand("cut")
|
|
10881
10861
|
},
|
|
10882
10862
|
/* @__PURE__ */ React112.createElement(IconCut, null)
|
|
10883
|
-
), show("copy") && /* @__PURE__ */ React112.createElement(
|
|
10863
|
+
)), show("copy") && /* @__PURE__ */ React112.createElement(Tooltip, { title: "Copy selected text", placement: "top" }, /* @__PURE__ */ React112.createElement(
|
|
10884
10864
|
"button",
|
|
10885
10865
|
{
|
|
10886
10866
|
className: "toolbar-btn",
|
|
10887
|
-
onClick: handleCopy
|
|
10888
|
-
title: "Copy selected text"
|
|
10867
|
+
onClick: handleCopy
|
|
10889
10868
|
},
|
|
10890
10869
|
copySuccess ? /* @__PURE__ */ React112.createElement(IconCheck, null) : /* @__PURE__ */ React112.createElement(IconCopy, null)
|
|
10891
|
-
), show("paste") && /* @__PURE__ */ React112.createElement(
|
|
10870
|
+
)), show("paste") && /* @__PURE__ */ React112.createElement(Tooltip, { title: "Paste (Ctrl+V)", placement: "top" }, /* @__PURE__ */ React112.createElement(
|
|
10892
10871
|
"button",
|
|
10893
10872
|
{
|
|
10894
10873
|
className: "toolbar-btn",
|
|
10895
|
-
onClick: handlePaste
|
|
10896
|
-
title: "Paste (Ctrl+V)"
|
|
10874
|
+
onClick: handlePaste
|
|
10897
10875
|
},
|
|
10898
10876
|
/* @__PURE__ */ React112.createElement(IconPaste, null)
|
|
10899
|
-
), show("specialchars") && /* @__PURE__ */ React112.createElement(Dropdown, { trigger: { label: "\u03A9", title: "Special characters", className: "special-characters-btn" } }, /* @__PURE__ */ React112.createElement("div", { className: "char-grid" }, SPECIAL_CHARS.map((char) => /* @__PURE__ */ React112.createElement(
|
|
10877
|
+
)), show("specialchars") && /* @__PURE__ */ React112.createElement(Dropdown, { trigger: { label: "\u03A9", title: "Special characters", className: "special-characters-btn" } }, /* @__PURE__ */ React112.createElement("div", { className: "char-grid" }, SPECIAL_CHARS.map((char) => /* @__PURE__ */ React112.createElement(
|
|
10900
10878
|
"button",
|
|
10901
10879
|
{
|
|
10902
10880
|
key: char,
|
|
@@ -10928,23 +10906,21 @@ var Toolbar = ({ editor, setLink, onAICommand, onTranslate, onSpeechToText, onTe
|
|
|
10928
10906
|
}
|
|
10929
10907
|
} }, "</>", " Inline Code"),
|
|
10930
10908
|
/* @__PURE__ */ React112.createElement("button", { className: "dropdown-item", onClick: () => editor.chain().focus().toggleCodeBlock().run() }, "{ }", " Code Block")
|
|
10931
|
-
), show("fullscreen") && /* @__PURE__ */ React112.createElement(
|
|
10909
|
+
), show("fullscreen") && /* @__PURE__ */ React112.createElement(Tooltip, { title: "Toggle Fullscreen", placement: "top" }, /* @__PURE__ */ React112.createElement(
|
|
10932
10910
|
"button",
|
|
10933
10911
|
{
|
|
10934
10912
|
className: `toolbar-btn ${isFullscreen ? "is-active" : ""}`,
|
|
10935
|
-
onClick: onToggleFullscreen
|
|
10936
|
-
title: "Toggle Fullscreen"
|
|
10913
|
+
onClick: onToggleFullscreen
|
|
10937
10914
|
},
|
|
10938
10915
|
/* @__PURE__ */ React112.createElement(IconFullscreen, null)
|
|
10939
|
-
), show("tts") && /* @__PURE__ */ React112.createElement(TextToSpeech_default, { ref: ttsRef, editor, onTextToSpeech }), show("stt") && /* @__PURE__ */ React112.createElement(SpeechToText_default, { ref: sttRef, editor, onSpeechToText }), show("translate") && /* @__PURE__ */ React112.createElement("div", { className: "translate-split-btn" }, /* @__PURE__ */ React112.createElement(
|
|
10916
|
+
)), show("tts") && /* @__PURE__ */ React112.createElement(TextToSpeech_default, { ref: ttsRef, editor, onTextToSpeech }), show("stt") && /* @__PURE__ */ React112.createElement(SpeechToText_default, { ref: sttRef, editor, onSpeechToText }), show("translate") && /* @__PURE__ */ React112.createElement("div", { className: "translate-split-btn" }, /* @__PURE__ */ React112.createElement(Tooltip, { title: "Translate selected text", placement: "top" }, /* @__PURE__ */ React112.createElement(
|
|
10940
10917
|
"button",
|
|
10941
10918
|
{
|
|
10942
10919
|
className: "toolbar-btn",
|
|
10943
|
-
onClick: handleQuickTranslate
|
|
10944
|
-
title: "Translate selected text"
|
|
10920
|
+
onClick: handleQuickTranslate
|
|
10945
10921
|
},
|
|
10946
10922
|
/* @__PURE__ */ React112.createElement(IconTranslate, null)
|
|
10947
|
-
), /* @__PURE__ */ React112.createElement(Dropdown, { trigger: { label: "", title: "Translate options", className: "translate-arrow-btn" } }, /* @__PURE__ */ React112.createElement("button", { className: "dropdown-item", onClick: () => setShowTranslateModal(true) }, "Options")), translateStatus && /* @__PURE__ */ React112.createElement("span", { className: `translate-toast-popup ${translateStatus === "Please select the text" || translateStatus === "Translation failed" ? "error" : ""}` }, translateStatus)), show("todo") && /* @__PURE__ */ React112.createElement("div", { className: "todo-split-btn" }, /* @__PURE__ */ React112.createElement(
|
|
10923
|
+
)), /* @__PURE__ */ React112.createElement(Dropdown, { trigger: { label: "", title: "Translate options", className: "translate-arrow-btn" } }, /* @__PURE__ */ React112.createElement("button", { className: "dropdown-item", onClick: () => setShowTranslateModal(true) }, "Options")), translateStatus && /* @__PURE__ */ React112.createElement("span", { className: `translate-toast-popup ${translateStatus === "Please select the text" || translateStatus === "Translation failed" ? "error" : ""}` }, translateStatus)), show("todo") && /* @__PURE__ */ React112.createElement("div", { className: "todo-split-btn" }, /* @__PURE__ */ React112.createElement(Tooltip, { title: todoEnabled ? "Disable Task List" : "Enable Task List", placement: "top" }, /* @__PURE__ */ React112.createElement(
|
|
10948
10924
|
"button",
|
|
10949
10925
|
{
|
|
10950
10926
|
className: `toolbar-btn ${todoEnabled ? "is-active" : ""}`,
|
|
@@ -10985,11 +10961,10 @@ var Toolbar = ({ editor, setLink, onAICommand, onTranslate, onSpeechToText, onTe
|
|
|
10985
10961
|
}).run();
|
|
10986
10962
|
}
|
|
10987
10963
|
}
|
|
10988
|
-
}
|
|
10989
|
-
title: todoEnabled ? "Disable Task List" : "Enable Task List"
|
|
10964
|
+
}
|
|
10990
10965
|
},
|
|
10991
10966
|
/* @__PURE__ */ React112.createElement(IconTaskList, null)
|
|
10992
|
-
), /* @__PURE__ */ React112.createElement(Dropdown, { trigger: { label: "", title: "Task status", className: "todo-arrow-btn" }, keepOpen: true }, ["todo", "working", "blocked", "resolved"].map((status) => {
|
|
10967
|
+
)), /* @__PURE__ */ React112.createElement(Dropdown, { trigger: { label: "", title: "Task status", className: "todo-arrow-btn" }, keepOpen: true }, ["todo", "working", "blocked", "resolved"].map((status) => {
|
|
10993
10968
|
const images = { todo: "https://storage.googleapis.com/rufous-com-bucket-1/static/images/todo-blank.svg", working: "https://storage.googleapis.com/rufous-com-bucket-1/static/images/working.svg", blocked: "https://storage.googleapis.com/rufous-com-bucket-1/static/images/blocked.svg", resolved: "https://storage.googleapis.com/rufous-com-bucket-1/static/images/closed.svg" };
|
|
10994
10969
|
const labels = { todo: "Todo", working: "Working", blocked: "Blocked", resolved: "Resolved" };
|
|
10995
10970
|
return /* @__PURE__ */ React112.createElement("button", { key: status, className: "dropdown-item task-status-item", onClick: () => {
|
|
@@ -11026,7 +11001,7 @@ var Toolbar = ({ editor, setLink, onAICommand, onTranslate, onSpeechToText, onTe
|
|
|
11026
11001
|
return true;
|
|
11027
11002
|
}).run();
|
|
11028
11003
|
} }, /* @__PURE__ */ React112.createElement("span", { className: `task-icon task-${status}` }, /* @__PURE__ */ React112.createElement("img", { src: images[status], alt: status })), " ", labels[status]);
|
|
11029
|
-
})))), onClose && /* @__PURE__ */ React112.createElement("div", { className: "toolbar-row-right" }, /* @__PURE__ */ React112.createElement(
|
|
11004
|
+
})))), onClose && /* @__PURE__ */ React112.createElement("div", { className: "toolbar-row-right" }, /* @__PURE__ */ React112.createElement(Tooltip, { title: "Close", placement: "top" }, /* @__PURE__ */ React112.createElement(
|
|
11030
11005
|
"button",
|
|
11031
11006
|
{
|
|
11032
11007
|
className: "toolbar-btn btn-cross",
|
|
@@ -11040,11 +11015,10 @@ var Toolbar = ({ editor, setLink, onAICommand, onTranslate, onSpeechToText, onTe
|
|
|
11040
11015
|
} catch {
|
|
11041
11016
|
}
|
|
11042
11017
|
onClose();
|
|
11043
|
-
}
|
|
11044
|
-
title: "Close"
|
|
11018
|
+
}
|
|
11045
11019
|
},
|
|
11046
11020
|
/* @__PURE__ */ React112.createElement(closeIcon_default, { color: "#a81c08" })
|
|
11047
|
-
)), showTranslateModal && /* @__PURE__ */ React112.createElement(
|
|
11021
|
+
))), showTranslateModal && /* @__PURE__ */ React112.createElement(
|
|
11048
11022
|
TranslateModal_default,
|
|
11049
11023
|
{
|
|
11050
11024
|
editor,
|
|
@@ -11128,15 +11102,14 @@ var ImagePropertiesModal = ({ editor, node, onClose }) => {
|
|
|
11128
11102
|
value: width,
|
|
11129
11103
|
onChange: (e) => handleWidthChange(e.target.value)
|
|
11130
11104
|
}
|
|
11131
|
-
), /* @__PURE__ */ React113.createElement(
|
|
11105
|
+
), /* @__PURE__ */ React113.createElement(Tooltip, { title: lockRatio ? "Unlock aspect ratio" : "Lock aspect ratio", placement: "top" }, /* @__PURE__ */ React113.createElement(
|
|
11132
11106
|
"button",
|
|
11133
11107
|
{
|
|
11134
11108
|
className: `lock-btn ${lockRatio ? "locked" : ""}`,
|
|
11135
|
-
onClick: () => setLockRatio(!lockRatio)
|
|
11136
|
-
title: lockRatio ? "Unlock aspect ratio" : "Lock aspect ratio"
|
|
11109
|
+
onClick: () => setLockRatio(!lockRatio)
|
|
11137
11110
|
},
|
|
11138
11111
|
lockRatio ? "\u{1F512}" : "\u{1F513}"
|
|
11139
|
-
), /* @__PURE__ */ React113.createElement(
|
|
11112
|
+
)), /* @__PURE__ */ React113.createElement(
|
|
11140
11113
|
"input",
|
|
11141
11114
|
{
|
|
11142
11115
|
type: "number",
|
|
@@ -11321,13 +11294,13 @@ var ImageToolbar = ({ editor }) => {
|
|
|
11321
11294
|
style: { position: "absolute", top: pos.top, left: pos.left, zIndex: 1e3 },
|
|
11322
11295
|
onMouseDown: (e) => e.preventDefault()
|
|
11323
11296
|
},
|
|
11324
|
-
/* @__PURE__ */ React113.createElement("button", { className: "img-tool-btn", onClick: handleDelete
|
|
11325
|
-
/* @__PURE__ */ React113.createElement("button", { className: "img-tool-btn", onClick: () => setShowModal(true)
|
|
11326
|
-
/* @__PURE__ */ React113.createElement("div", { className: "img-tool-copy-wrapper" }, /* @__PURE__ */ React113.createElement("button", { className: "img-tool-btn", onClick: handleCopy
|
|
11327
|
-
/* @__PURE__ */ React113.createElement("div", { className: "img-tool-dropdown" }, /* @__PURE__ */ React113.createElement("button", { className: "img-tool-btn", onClick: () => {
|
|
11297
|
+
/* @__PURE__ */ React113.createElement(Tooltip, { title: "Delete", placement: "top" }, /* @__PURE__ */ React113.createElement("button", { className: "img-tool-btn", onClick: handleDelete }, "\u{1F5D1}")),
|
|
11298
|
+
/* @__PURE__ */ React113.createElement(Tooltip, { title: "Edit properties", placement: "top" }, /* @__PURE__ */ React113.createElement("button", { className: "img-tool-btn", onClick: () => setShowModal(true) }, "\u270E")),
|
|
11299
|
+
/* @__PURE__ */ React113.createElement("div", { className: "img-tool-copy-wrapper" }, /* @__PURE__ */ React113.createElement(Tooltip, { title: "Copy image", placement: "top" }, /* @__PURE__ */ React113.createElement("button", { className: "img-tool-btn", onClick: handleCopy }, copyStatus ? "\u2713" : "\u{1F4CB}")), copyStatus && /* @__PURE__ */ React113.createElement("span", { className: "img-copy-toast" }, copyStatus)),
|
|
11300
|
+
/* @__PURE__ */ React113.createElement("div", { className: "img-tool-dropdown" }, /* @__PURE__ */ React113.createElement(Tooltip, { title: "Horizontal alignment", placement: "top" }, /* @__PURE__ */ React113.createElement("button", { className: "img-tool-btn", onClick: () => {
|
|
11328
11301
|
setShowAlign(!showAlign);
|
|
11329
11302
|
setShowVAlign(false);
|
|
11330
|
-
}
|
|
11303
|
+
} }, "\u2630 ", /* @__PURE__ */ React113.createElement("span", { className: "dropdown-arrow" }, "\u25BE"))), showAlign && /* @__PURE__ */ React113.createElement("div", { className: "img-tool-menu" }, ALIGNMENTS.map((a) => /* @__PURE__ */ React113.createElement("button", { key: a.value, className: "dropdown-item", onClick: () => setAlignmentVal(a.value) }, a.icon, " ", a.label))))
|
|
11331
11304
|
), showModal && /* @__PURE__ */ React113.createElement(
|
|
11332
11305
|
ImagePropertiesModal,
|
|
11333
11306
|
{
|
|
@@ -11410,15 +11383,14 @@ var VideoPropertiesModal = ({ editor, node, nodeType, onClose }) => {
|
|
|
11410
11383
|
value: width,
|
|
11411
11384
|
onChange: (e) => handleWidthChange(e.target.value)
|
|
11412
11385
|
}
|
|
11413
|
-
), /* @__PURE__ */ React114.createElement(
|
|
11386
|
+
), /* @__PURE__ */ React114.createElement(Tooltip, { title: lockRatio ? "Unlock aspect ratio" : "Lock aspect ratio", placement: "top" }, /* @__PURE__ */ React114.createElement(
|
|
11414
11387
|
"button",
|
|
11415
11388
|
{
|
|
11416
11389
|
className: `lock-btn ${lockRatio ? "locked" : ""}`,
|
|
11417
|
-
onClick: () => setLockRatio(!lockRatio)
|
|
11418
|
-
title: lockRatio ? "Unlock aspect ratio" : "Lock aspect ratio"
|
|
11390
|
+
onClick: () => setLockRatio(!lockRatio)
|
|
11419
11391
|
},
|
|
11420
11392
|
lockRatio ? "\u{1F512}" : "\u{1F513}"
|
|
11421
|
-
), /* @__PURE__ */ React114.createElement(
|
|
11393
|
+
)), /* @__PURE__ */ React114.createElement(
|
|
11422
11394
|
"input",
|
|
11423
11395
|
{
|
|
11424
11396
|
type: "number",
|
|
@@ -11545,13 +11517,13 @@ var VideoToolbar = ({ editor }) => {
|
|
|
11545
11517
|
style: { position: "absolute", top: pos.top, left: pos.left, zIndex: 1e3 },
|
|
11546
11518
|
onMouseDown: (e) => e.preventDefault()
|
|
11547
11519
|
},
|
|
11548
|
-
/* @__PURE__ */ React114.createElement("button", { className: "img-tool-btn", onClick: handleDelete
|
|
11549
|
-
/* @__PURE__ */ React114.createElement("button", { className: "img-tool-btn", onClick: () => setShowModal(true)
|
|
11550
|
-
/* @__PURE__ */ React114.createElement("div", { className: "img-tool-copy-wrapper" }, /* @__PURE__ */ React114.createElement("button", { className: "img-tool-btn", onClick: handleCopy
|
|
11551
|
-
/* @__PURE__ */ React114.createElement("div", { className: "img-tool-dropdown" }, /* @__PURE__ */ React114.createElement("button", { className: "img-tool-btn", onClick: () => {
|
|
11520
|
+
/* @__PURE__ */ React114.createElement(Tooltip, { title: "Delete", placement: "top" }, /* @__PURE__ */ React114.createElement("button", { className: "img-tool-btn", onClick: handleDelete }, "\u{1F5D1}")),
|
|
11521
|
+
/* @__PURE__ */ React114.createElement(Tooltip, { title: "Edit properties", placement: "top" }, /* @__PURE__ */ React114.createElement("button", { className: "img-tool-btn", onClick: () => setShowModal(true) }, "\u270E")),
|
|
11522
|
+
/* @__PURE__ */ React114.createElement("div", { className: "img-tool-copy-wrapper" }, /* @__PURE__ */ React114.createElement(Tooltip, { title: "Copy URL", placement: "top" }, /* @__PURE__ */ React114.createElement("button", { className: "img-tool-btn", onClick: handleCopy }, copyStatus ? "\u2713" : "\u{1F4CB}")), copyStatus && /* @__PURE__ */ React114.createElement("span", { className: "img-copy-toast" }, copyStatus)),
|
|
11523
|
+
/* @__PURE__ */ React114.createElement("div", { className: "img-tool-dropdown" }, /* @__PURE__ */ React114.createElement(Tooltip, { title: "Size presets", placement: "top" }, /* @__PURE__ */ React114.createElement("button", { className: "img-tool-btn", onClick: () => {
|
|
11552
11524
|
setShowSize(!showSize);
|
|
11553
11525
|
setShowAlign(false);
|
|
11554
|
-
}
|
|
11526
|
+
} }, /* @__PURE__ */ React114.createElement("span", { style: { fontSize: "11px" } }, node.attrs.width || 640, "x", node.attrs.height || 360), /* @__PURE__ */ React114.createElement("span", { className: "dropdown-arrow" }, "\u25BE"))), showSize && /* @__PURE__ */ React114.createElement("div", { className: "img-tool-menu" }, /* @__PURE__ */ React114.createElement("button", { className: "dropdown-item", onClick: () => {
|
|
11555
11527
|
handleResize("small");
|
|
11556
11528
|
setShowSize(false);
|
|
11557
11529
|
} }, "Small (320x180)"), /* @__PURE__ */ React114.createElement("button", { className: "dropdown-item", onClick: () => {
|
|
@@ -11564,10 +11536,10 @@ var VideoToolbar = ({ editor }) => {
|
|
|
11564
11536
|
handleResize("full");
|
|
11565
11537
|
setShowSize(false);
|
|
11566
11538
|
} }, "Full (854x480)"))),
|
|
11567
|
-
/* @__PURE__ */ React114.createElement("div", { className: "img-tool-dropdown" }, /* @__PURE__ */ React114.createElement("button", { className: "img-tool-btn", onClick: () => {
|
|
11539
|
+
/* @__PURE__ */ React114.createElement("div", { className: "img-tool-dropdown" }, /* @__PURE__ */ React114.createElement(Tooltip, { title: "Horizontal alignment", placement: "top" }, /* @__PURE__ */ React114.createElement("button", { className: "img-tool-btn", onClick: () => {
|
|
11568
11540
|
setShowAlign(!showAlign);
|
|
11569
11541
|
setShowSize(false);
|
|
11570
|
-
}
|
|
11542
|
+
} }, "\u2630 ", /* @__PURE__ */ React114.createElement("span", { className: "dropdown-arrow" }, "\u25BE"))), showAlign && /* @__PURE__ */ React114.createElement("div", { className: "img-tool-menu" }, ALIGNMENTS2.map((a) => /* @__PURE__ */ React114.createElement("button", { key: a.value, className: "dropdown-item", onClick: () => setAlignmentVal(a.value) }, a.icon, " ", a.label))))
|
|
11571
11543
|
), showModal && /* @__PURE__ */ React114.createElement(
|
|
11572
11544
|
VideoPropertiesModal,
|
|
11573
11545
|
{
|
|
@@ -11650,101 +11622,19 @@ var TableToolbar = ({ editor }) => {
|
|
|
11650
11622
|
style: { top: pos.top, left: pos.left },
|
|
11651
11623
|
onMouseDown: prevent
|
|
11652
11624
|
},
|
|
11653
|
-
/* @__PURE__ */ React115.createElement(
|
|
11654
|
-
|
|
11655
|
-
|
|
11656
|
-
className: "rf-table-toolbar-btn",
|
|
11657
|
-
onClick: () => editor.chain().focus().addRowBefore().run(),
|
|
11658
|
-
title: "Insert row above"
|
|
11659
|
-
},
|
|
11660
|
-
/* @__PURE__ */ React115.createElement(IconAddRowBefore, null)
|
|
11661
|
-
),
|
|
11662
|
-
/* @__PURE__ */ React115.createElement(
|
|
11663
|
-
"button",
|
|
11664
|
-
{
|
|
11665
|
-
className: "rf-table-toolbar-btn",
|
|
11666
|
-
onClick: () => editor.chain().focus().addRowAfter().run(),
|
|
11667
|
-
title: "Insert row below"
|
|
11668
|
-
},
|
|
11669
|
-
/* @__PURE__ */ React115.createElement(IconAddRowAfter, null)
|
|
11670
|
-
),
|
|
11671
|
-
/* @__PURE__ */ React115.createElement(
|
|
11672
|
-
"button",
|
|
11673
|
-
{
|
|
11674
|
-
className: "rf-table-toolbar-btn rf-table-toolbar-btn-danger",
|
|
11675
|
-
onClick: () => editor.chain().focus().deleteRow().run(),
|
|
11676
|
-
title: "Delete row"
|
|
11677
|
-
},
|
|
11678
|
-
/* @__PURE__ */ React115.createElement(IconDeleteRow, null)
|
|
11679
|
-
),
|
|
11625
|
+
/* @__PURE__ */ React115.createElement(Tooltip, { title: "Insert row above", placement: "top" }, /* @__PURE__ */ React115.createElement("button", { className: "rf-table-toolbar-btn", onClick: () => editor.chain().focus().addRowBefore().run() }, /* @__PURE__ */ React115.createElement(IconAddRowBefore, null))),
|
|
11626
|
+
/* @__PURE__ */ React115.createElement(Tooltip, { title: "Insert row below", placement: "top" }, /* @__PURE__ */ React115.createElement("button", { className: "rf-table-toolbar-btn", onClick: () => editor.chain().focus().addRowAfter().run() }, /* @__PURE__ */ React115.createElement(IconAddRowAfter, null))),
|
|
11627
|
+
/* @__PURE__ */ React115.createElement(Tooltip, { title: "Delete row", placement: "top" }, /* @__PURE__ */ React115.createElement("button", { className: "rf-table-toolbar-btn rf-table-toolbar-btn-danger", onClick: () => editor.chain().focus().deleteRow().run() }, /* @__PURE__ */ React115.createElement(IconDeleteRow, null))),
|
|
11680
11628
|
/* @__PURE__ */ React115.createElement("span", { className: "rf-table-toolbar-sep" }),
|
|
11681
|
-
/* @__PURE__ */ React115.createElement(
|
|
11682
|
-
|
|
11683
|
-
|
|
11684
|
-
className: "rf-table-toolbar-btn",
|
|
11685
|
-
onClick: () => editor.chain().focus().addColumnBefore().run(),
|
|
11686
|
-
title: "Insert column left"
|
|
11687
|
-
},
|
|
11688
|
-
/* @__PURE__ */ React115.createElement(IconAddColBefore, null)
|
|
11689
|
-
),
|
|
11690
|
-
/* @__PURE__ */ React115.createElement(
|
|
11691
|
-
"button",
|
|
11692
|
-
{
|
|
11693
|
-
className: "rf-table-toolbar-btn",
|
|
11694
|
-
onClick: () => editor.chain().focus().addColumnAfter().run(),
|
|
11695
|
-
title: "Insert column right"
|
|
11696
|
-
},
|
|
11697
|
-
/* @__PURE__ */ React115.createElement(IconAddColAfter, null)
|
|
11698
|
-
),
|
|
11699
|
-
/* @__PURE__ */ React115.createElement(
|
|
11700
|
-
"button",
|
|
11701
|
-
{
|
|
11702
|
-
className: "rf-table-toolbar-btn rf-table-toolbar-btn-danger",
|
|
11703
|
-
onClick: () => editor.chain().focus().deleteColumn().run(),
|
|
11704
|
-
title: "Delete column"
|
|
11705
|
-
},
|
|
11706
|
-
/* @__PURE__ */ React115.createElement(IconDeleteCol, null)
|
|
11707
|
-
),
|
|
11629
|
+
/* @__PURE__ */ React115.createElement(Tooltip, { title: "Insert column left", placement: "top" }, /* @__PURE__ */ React115.createElement("button", { className: "rf-table-toolbar-btn", onClick: () => editor.chain().focus().addColumnBefore().run() }, /* @__PURE__ */ React115.createElement(IconAddColBefore, null))),
|
|
11630
|
+
/* @__PURE__ */ React115.createElement(Tooltip, { title: "Insert column right", placement: "top" }, /* @__PURE__ */ React115.createElement("button", { className: "rf-table-toolbar-btn", onClick: () => editor.chain().focus().addColumnAfter().run() }, /* @__PURE__ */ React115.createElement(IconAddColAfter, null))),
|
|
11631
|
+
/* @__PURE__ */ React115.createElement(Tooltip, { title: "Delete column", placement: "top" }, /* @__PURE__ */ React115.createElement("button", { className: "rf-table-toolbar-btn rf-table-toolbar-btn-danger", onClick: () => editor.chain().focus().deleteColumn().run() }, /* @__PURE__ */ React115.createElement(IconDeleteCol, null))),
|
|
11708
11632
|
/* @__PURE__ */ React115.createElement("span", { className: "rf-table-toolbar-sep" }),
|
|
11709
|
-
/* @__PURE__ */ React115.createElement(
|
|
11710
|
-
|
|
11711
|
-
{
|
|
11712
|
-
className: "rf-table-toolbar-btn",
|
|
11713
|
-
onClick: () => editor.chain().focus().mergeCells().run(),
|
|
11714
|
-
disabled: !canMerge,
|
|
11715
|
-
title: "Merge cells"
|
|
11716
|
-
},
|
|
11717
|
-
/* @__PURE__ */ React115.createElement(IconMergeCells, null)
|
|
11718
|
-
),
|
|
11719
|
-
/* @__PURE__ */ React115.createElement(
|
|
11720
|
-
"button",
|
|
11721
|
-
{
|
|
11722
|
-
className: "rf-table-toolbar-btn",
|
|
11723
|
-
onClick: () => editor.chain().focus().splitCell().run(),
|
|
11724
|
-
disabled: !canSplit,
|
|
11725
|
-
title: "Split cell"
|
|
11726
|
-
},
|
|
11727
|
-
/* @__PURE__ */ React115.createElement(IconSplitCell, null)
|
|
11728
|
-
),
|
|
11633
|
+
/* @__PURE__ */ React115.createElement(Tooltip, { title: "Merge cells", placement: "top" }, /* @__PURE__ */ React115.createElement("button", { className: "rf-table-toolbar-btn", onClick: () => editor.chain().focus().mergeCells().run(), disabled: !canMerge }, /* @__PURE__ */ React115.createElement(IconMergeCells, null))),
|
|
11634
|
+
/* @__PURE__ */ React115.createElement(Tooltip, { title: "Split cell", placement: "top" }, /* @__PURE__ */ React115.createElement("button", { className: "rf-table-toolbar-btn", onClick: () => editor.chain().focus().splitCell().run(), disabled: !canSplit }, /* @__PURE__ */ React115.createElement(IconSplitCell, null))),
|
|
11729
11635
|
/* @__PURE__ */ React115.createElement("span", { className: "rf-table-toolbar-sep" }),
|
|
11730
|
-
/* @__PURE__ */ React115.createElement(
|
|
11731
|
-
|
|
11732
|
-
{
|
|
11733
|
-
className: `rf-table-toolbar-btn ${editor.isActive("tableHeader") ? "active" : ""}`,
|
|
11734
|
-
onClick: () => editor.chain().focus().toggleHeaderRow().run(),
|
|
11735
|
-
title: "Toggle header row"
|
|
11736
|
-
},
|
|
11737
|
-
/* @__PURE__ */ React115.createElement(IconToggleHeader, null)
|
|
11738
|
-
),
|
|
11739
|
-
/* @__PURE__ */ React115.createElement(
|
|
11740
|
-
"button",
|
|
11741
|
-
{
|
|
11742
|
-
className: "rf-table-toolbar-btn rf-table-toolbar-btn-danger",
|
|
11743
|
-
onClick: () => editor.chain().focus().deleteTable().run(),
|
|
11744
|
-
title: "Delete table"
|
|
11745
|
-
},
|
|
11746
|
-
/* @__PURE__ */ React115.createElement(IconDeleteTable, null)
|
|
11747
|
-
)
|
|
11636
|
+
/* @__PURE__ */ React115.createElement(Tooltip, { title: "Toggle header row", placement: "top" }, /* @__PURE__ */ React115.createElement("button", { className: `rf-table-toolbar-btn ${editor.isActive("tableHeader") ? "active" : ""}`, onClick: () => editor.chain().focus().toggleHeaderRow().run() }, /* @__PURE__ */ React115.createElement(IconToggleHeader, null))),
|
|
11637
|
+
/* @__PURE__ */ React115.createElement(Tooltip, { title: "Delete table", placement: "top" }, /* @__PURE__ */ React115.createElement("button", { className: "rf-table-toolbar-btn rf-table-toolbar-btn-danger", onClick: () => editor.chain().focus().deleteTable().run() }, /* @__PURE__ */ React115.createElement(IconDeleteTable, null)))
|
|
11748
11638
|
),
|
|
11749
11639
|
document.body
|
|
11750
11640
|
);
|