@rufous/ui 0.1.82 → 0.1.84
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 +198 -69
- package/dist/main.css +88 -0
- package/dist/main.d.cts +29 -1
- package/dist/main.d.ts +29 -1
- package/dist/main.js +526 -399
- package/package.json +3 -2
package/dist/main.js
CHANGED
|
@@ -1061,8 +1061,23 @@ import * as React56 from "react";
|
|
|
1061
1061
|
var QualificationsIcon = ({ color = "#3a3a3a", ...props }) => /* @__PURE__ */ React56.createElement("svg", { width: "24", height: "17", viewBox: "0 0 24 17", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props }, /* @__PURE__ */ React56.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M11.096 0.920005L1.422 5.25601C1.29964 5.31928 1.18771 5.40089 1.09003 5.49801C0.982986 5.61801 0.923828 5.7732 0.923828 5.934C0.923828 6.09481 0.982986 6.25 1.09003 6.37001C1.18134 6.47434 1.29472 6.55701 1.422 6.61201L5.35498 8.29801V12.829C5.35246 12.8915 5.36648 12.9535 5.39563 13.0088C5.42478 13.0641 5.46804 13.1108 5.521 13.144L11.909 16.23C11.9351 16.2419 11.9634 16.248 11.992 16.248C12.0206 16.248 12.049 16.2419 12.075 16.23L18.482 13.144C18.5377 13.1137 18.5831 13.0677 18.6127 13.0116C18.6422 12.9556 18.6545 12.892 18.648 12.829V8.29901L21.842 7.04001C21.6965 8.80938 21.6882 10.5874 21.817 12.358C21.817 12.843 22.217 12.843 22.217 12.358C22.4317 10.5206 22.4729 8.66711 22.34 6.82201C22.5425 6.68685 22.7337 6.5357 22.912 6.37001C23.019 6.25 23.0782 6.09481 23.0782 5.934C23.0782 5.7732 23.019 5.61801 22.912 5.49801C22.8142 5.40101 22.7023 5.31941 22.58 5.25601L12.905 0.919005C12.3228 0.692932 11.6771 0.692932 11.095 0.919005L11.096 0.920005ZM12.696 1.86701L21.785 5.94101C21.837 5.96401 21.837 5.98601 21.872 6.00901C21.838 6.03201 21.838 6.05501 21.785 6.07701L17.485 8.01201C17.451 8.01201 17.398 8.01201 17.385 8.05701L12.702 10.151C12.253 10.3102 11.763 10.3102 11.314 10.151L6.62201 8.03401C6.58701 8.03401 6.56998 8.01101 6.55298 8.01101L2.22198 6.07601C2.16898 6.05301 2.16901 6.03101 2.13501 6.00801C2.16901 5.98501 2.16898 5.962 2.22198 5.962L11.31 1.86201C11.5331 1.78448 11.7678 1.74624 12.004 1.74901C12.239 1.7475 12.4725 1.78709 12.694 1.866L12.696 1.86701ZM17.665 8.657V12.482L12.002 15.272L6.33899 12.728V8.90301L11.156 10.926C11.4239 11.0384 11.7115 11.0963 12.002 11.0963C12.2925 11.0963 12.5801 11.0384 12.848 10.926L17.248 8.95501L17.665 8.657Z", fill: color, stroke: color, strokeWidth: "0.2" }));
|
|
1062
1062
|
var qualificationsIcon_default = QualificationsIcon;
|
|
1063
1063
|
|
|
1064
|
-
// lib/
|
|
1064
|
+
// lib/icons/cameraIcon.tsx
|
|
1065
1065
|
import * as React57 from "react";
|
|
1066
|
+
var CameraIcon = ({ color = "#ffffff", ...props }) => /* @__PURE__ */ React57.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", ...props }, /* @__PURE__ */ React57.createElement(
|
|
1067
|
+
"path",
|
|
1068
|
+
{
|
|
1069
|
+
d: "M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z",
|
|
1070
|
+
stroke: color,
|
|
1071
|
+
strokeWidth: "2",
|
|
1072
|
+
strokeLinecap: "round",
|
|
1073
|
+
strokeLinejoin: "round",
|
|
1074
|
+
fill: "none"
|
|
1075
|
+
}
|
|
1076
|
+
), /* @__PURE__ */ React57.createElement("circle", { cx: "12", cy: "13", r: "4", stroke: color, strokeWidth: "2", fill: "none" }));
|
|
1077
|
+
var cameraIcon_default = CameraIcon;
|
|
1078
|
+
|
|
1079
|
+
// lib/Buttons/addButton.tsx
|
|
1080
|
+
import * as React58 from "react";
|
|
1066
1081
|
|
|
1067
1082
|
// lib/utils/sx.ts
|
|
1068
1083
|
import { useRef, useEffect } from "react";
|
|
@@ -1111,15 +1126,15 @@ function useSx(sx) {
|
|
|
1111
1126
|
// lib/Buttons/addButton.tsx
|
|
1112
1127
|
var AddButton = ({ children, sx, className, ...props }) => {
|
|
1113
1128
|
const sxClass = useSx(sx);
|
|
1114
|
-
return /* @__PURE__ */
|
|
1129
|
+
return /* @__PURE__ */ React58.createElement("button", { className: ["btn add-btn", sxClass, className].filter(Boolean).join(" "), ...props }, "+ ", children);
|
|
1115
1130
|
};
|
|
1116
1131
|
var addButton_default = AddButton;
|
|
1117
1132
|
|
|
1118
1133
|
// lib/Buttons/submitButton.tsx
|
|
1119
|
-
import * as
|
|
1134
|
+
import * as React60 from "react";
|
|
1120
1135
|
|
|
1121
1136
|
// lib/Progress/circularProgress.tsx
|
|
1122
|
-
import * as
|
|
1137
|
+
import * as React59 from "react";
|
|
1123
1138
|
var CircularProgress = ({
|
|
1124
1139
|
size = 50,
|
|
1125
1140
|
color = "#a81c08",
|
|
@@ -1128,14 +1143,14 @@ var CircularProgress = ({
|
|
|
1128
1143
|
...props
|
|
1129
1144
|
}) => {
|
|
1130
1145
|
const sxClass = useSx(sx);
|
|
1131
|
-
return /* @__PURE__ */
|
|
1146
|
+
return /* @__PURE__ */ React59.createElement(
|
|
1132
1147
|
"div",
|
|
1133
1148
|
{
|
|
1134
1149
|
className: ["rufous-loader", sxClass, className].filter(Boolean).join(" "),
|
|
1135
1150
|
style: { width: size, height: size },
|
|
1136
1151
|
...props
|
|
1137
1152
|
},
|
|
1138
|
-
/* @__PURE__ */
|
|
1153
|
+
/* @__PURE__ */ React59.createElement("svg", { viewBox: "0 0 100 100" }, /* @__PURE__ */ React59.createElement(
|
|
1139
1154
|
"circle",
|
|
1140
1155
|
{
|
|
1141
1156
|
className: "rufous-loader-circle",
|
|
@@ -1157,7 +1172,7 @@ var CircularProgressIcon = ({
|
|
|
1157
1172
|
className
|
|
1158
1173
|
}) => {
|
|
1159
1174
|
const sxClass = useSx(sx);
|
|
1160
|
-
return /* @__PURE__ */
|
|
1175
|
+
return /* @__PURE__ */ React59.createElement("div", { className: ["rufous-loader rufous-loader--with-icon", sxClass, className].filter(Boolean).join(" "), style: { width: size, height: size } }, /* @__PURE__ */ React59.createElement("svg", { viewBox: "0 0 100 100" }, /* @__PURE__ */ React59.createElement(
|
|
1161
1176
|
"circle",
|
|
1162
1177
|
{
|
|
1163
1178
|
className: "rufous-loader-circle",
|
|
@@ -1166,7 +1181,7 @@ var CircularProgressIcon = ({
|
|
|
1166
1181
|
r: "45",
|
|
1167
1182
|
stroke: color
|
|
1168
1183
|
}
|
|
1169
|
-
)), /* @__PURE__ */
|
|
1184
|
+
)), /* @__PURE__ */ React59.createElement("div", { className: "rufous-loader__icon-wrap" }, /* @__PURE__ */ React59.createElement("div", { className: spinIcon ? "rufous-loader__icon--spin-y" : void 0 }, icon)));
|
|
1170
1185
|
};
|
|
1171
1186
|
|
|
1172
1187
|
// lib/Buttons/submitButton.tsx
|
|
@@ -1182,8 +1197,8 @@ var SubmitButton = ({
|
|
|
1182
1197
|
...props
|
|
1183
1198
|
}) => {
|
|
1184
1199
|
const sxClass = useSx(sx);
|
|
1185
|
-
const [loading, setLoading] =
|
|
1186
|
-
const clickTimeout =
|
|
1200
|
+
const [loading, setLoading] = React60.useState(false);
|
|
1201
|
+
const clickTimeout = React60.useRef(null);
|
|
1187
1202
|
const handleClick = async (e) => {
|
|
1188
1203
|
const currentTarget = e.currentTarget;
|
|
1189
1204
|
if (loading) return;
|
|
@@ -1218,7 +1233,7 @@ var SubmitButton = ({
|
|
|
1218
1233
|
}
|
|
1219
1234
|
}
|
|
1220
1235
|
};
|
|
1221
|
-
return /* @__PURE__ */
|
|
1236
|
+
return /* @__PURE__ */ React60.createElement(
|
|
1222
1237
|
"button",
|
|
1223
1238
|
{
|
|
1224
1239
|
...props,
|
|
@@ -1228,29 +1243,29 @@ var SubmitButton = ({
|
|
|
1228
1243
|
onClick: handleClick,
|
|
1229
1244
|
onDoubleClick: handleDoubleClick
|
|
1230
1245
|
},
|
|
1231
|
-
/* @__PURE__ */
|
|
1246
|
+
/* @__PURE__ */ React60.createElement("span", { className: "btn-content" }, children, (loading || isLoading) && /* @__PURE__ */ React60.createElement("span", { className: "btn-loader" }, /* @__PURE__ */ React60.createElement(circularProgress_default, { size: 18, color: props.disabled || loading || isLoading ? "#00000042" : void 0 })))
|
|
1232
1247
|
);
|
|
1233
1248
|
};
|
|
1234
1249
|
var submitButton_default = SubmitButton;
|
|
1235
1250
|
|
|
1236
1251
|
// lib/Buttons/cancelButton.tsx
|
|
1237
|
-
import * as
|
|
1252
|
+
import * as React61 from "react";
|
|
1238
1253
|
var CancelButton = ({ children, sx, className, ...props }) => {
|
|
1239
1254
|
const sxClass = useSx(sx);
|
|
1240
|
-
return /* @__PURE__ */
|
|
1255
|
+
return /* @__PURE__ */ React61.createElement("button", { className: ["btn cancel-btn", sxClass, className].filter(Boolean).join(" "), ...props }, children);
|
|
1241
1256
|
};
|
|
1242
1257
|
var cancelButton_default = CancelButton;
|
|
1243
1258
|
|
|
1244
1259
|
// lib/Buttons/stdButton.tsx
|
|
1245
|
-
import * as
|
|
1260
|
+
import * as React62 from "react";
|
|
1246
1261
|
var StandardButton = ({ children, sx, className, ...props }) => {
|
|
1247
1262
|
const sxClass = useSx(sx);
|
|
1248
|
-
return /* @__PURE__ */
|
|
1263
|
+
return /* @__PURE__ */ React62.createElement("button", { className: ["btn standard-btn", sxClass, className].filter(Boolean).join(" "), ...props }, children);
|
|
1249
1264
|
};
|
|
1250
1265
|
var stdButton_default = StandardButton;
|
|
1251
1266
|
|
|
1252
1267
|
// lib/Dialogs/BaseDialog.tsx
|
|
1253
|
-
import * as
|
|
1268
|
+
import * as React63 from "react";
|
|
1254
1269
|
import { useState as useState2 } from "react";
|
|
1255
1270
|
import { X } from "lucide-react";
|
|
1256
1271
|
var BaseDialog = ({
|
|
@@ -1285,7 +1300,7 @@ var BaseDialog = ({
|
|
|
1285
1300
|
const sxClass = useSx(sx);
|
|
1286
1301
|
if (!open) return null;
|
|
1287
1302
|
const isButtonLoading = isSubmitting || loading;
|
|
1288
|
-
const renderButtons = () => /* @__PURE__ */
|
|
1303
|
+
const renderButtons = () => /* @__PURE__ */ React63.createElement("div", { className: "dialog-footer", style: { justifyContent: buttonAlign } }, showCancelButton && /* @__PURE__ */ React63.createElement(
|
|
1289
1304
|
"button",
|
|
1290
1305
|
{
|
|
1291
1306
|
className: "btn-cancel",
|
|
@@ -1293,7 +1308,7 @@ var BaseDialog = ({
|
|
|
1293
1308
|
disabled: isLoading || isButtonLoading
|
|
1294
1309
|
},
|
|
1295
1310
|
cancelText
|
|
1296
|
-
), onConfirm && /* @__PURE__ */
|
|
1311
|
+
), onConfirm && /* @__PURE__ */ React63.createElement(
|
|
1297
1312
|
"button",
|
|
1298
1313
|
{
|
|
1299
1314
|
className: "btn-confirm",
|
|
@@ -1305,10 +1320,10 @@ var BaseDialog = ({
|
|
|
1305
1320
|
setIsSubmitting(false);
|
|
1306
1321
|
}
|
|
1307
1322
|
},
|
|
1308
|
-
/* @__PURE__ */
|
|
1309
|
-
isButtonLoading && /* @__PURE__ */
|
|
1323
|
+
/* @__PURE__ */ React63.createElement("span", { style: { visibility: isButtonLoading ? "hidden" : "visible" } }, confirmText),
|
|
1324
|
+
isButtonLoading && /* @__PURE__ */ React63.createElement("span", { className: "spinner", style: { position: "absolute" } })
|
|
1310
1325
|
));
|
|
1311
|
-
return /* @__PURE__ */
|
|
1326
|
+
return /* @__PURE__ */ React63.createElement("div", { className: `dialog-overlay ${size === "fullScreen" ? "overlay-fullscreen" : ""}` }, /* @__PURE__ */ React63.createElement(
|
|
1312
1327
|
"div",
|
|
1313
1328
|
{
|
|
1314
1329
|
className: ["dialog-container", size ? `size-${size}` : "", sxClass, className].filter(Boolean).join(" "),
|
|
@@ -1317,15 +1332,15 @@ var BaseDialog = ({
|
|
|
1317
1332
|
minHeight
|
|
1318
1333
|
}
|
|
1319
1334
|
},
|
|
1320
|
-
/* @__PURE__ */
|
|
1335
|
+
/* @__PURE__ */ React63.createElement("div", { className: "dialog-title" }, /* @__PURE__ */ React63.createElement("h2", null, formatTitle ? title?.charAt(0).toUpperCase() + title?.slice(1) : title), showCloseButton && /* @__PURE__ */ React63.createElement("button", { className: "btn-close", onClick: onClose }, /* @__PURE__ */ React63.createElement(
|
|
1321
1336
|
X,
|
|
1322
1337
|
{
|
|
1323
1338
|
size: 18,
|
|
1324
1339
|
color: themeConfig?.icon || "#666666"
|
|
1325
1340
|
}
|
|
1326
1341
|
))),
|
|
1327
|
-
/* @__PURE__ */
|
|
1328
|
-
/* @__PURE__ */
|
|
1342
|
+
/* @__PURE__ */ React63.createElement("div", { className: "dialog-divider" }),
|
|
1343
|
+
/* @__PURE__ */ React63.createElement(
|
|
1329
1344
|
"div",
|
|
1330
1345
|
{
|
|
1331
1346
|
className: "dialog-body",
|
|
@@ -1336,14 +1351,14 @@ var BaseDialog = ({
|
|
|
1336
1351
|
},
|
|
1337
1352
|
children
|
|
1338
1353
|
),
|
|
1339
|
-
/* @__PURE__ */
|
|
1354
|
+
/* @__PURE__ */ React63.createElement("div", { className: "dialog-divider" }),
|
|
1340
1355
|
customButtons || renderButtons()
|
|
1341
1356
|
));
|
|
1342
1357
|
};
|
|
1343
1358
|
var BaseDialog_default = BaseDialog;
|
|
1344
1359
|
|
|
1345
1360
|
// lib/Contexts/rufousThemeProvider.tsx
|
|
1346
|
-
import
|
|
1361
|
+
import React64, {
|
|
1347
1362
|
createContext,
|
|
1348
1363
|
useContext,
|
|
1349
1364
|
useEffect as useEffect2,
|
|
@@ -1380,7 +1395,7 @@ var RufousThemeProvider = ({ children }) => {
|
|
|
1380
1395
|
setCommittedThemeKey(key);
|
|
1381
1396
|
};
|
|
1382
1397
|
const cancelTheme = () => setPreviewThemeKey(committedThemeKey);
|
|
1383
|
-
return /* @__PURE__ */
|
|
1398
|
+
return /* @__PURE__ */ React64.createElement(
|
|
1384
1399
|
RufousThemeContext.Provider,
|
|
1385
1400
|
{
|
|
1386
1401
|
value: {
|
|
@@ -1394,7 +1409,7 @@ var RufousThemeProvider = ({ children }) => {
|
|
|
1394
1409
|
updateSettings: (v) => setSettings(v)
|
|
1395
1410
|
}
|
|
1396
1411
|
},
|
|
1397
|
-
/* @__PURE__ */
|
|
1412
|
+
/* @__PURE__ */ React64.createElement(
|
|
1398
1413
|
"div",
|
|
1399
1414
|
{
|
|
1400
1415
|
className: `theme-${previewThemeKey || committedThemeKey || "default"}`
|
|
@@ -1406,7 +1421,7 @@ var RufousThemeProvider = ({ children }) => {
|
|
|
1406
1421
|
var useRufousTheme = () => useContext(RufousThemeContext);
|
|
1407
1422
|
|
|
1408
1423
|
// lib/CheckBoxes/CheckBox.jsx
|
|
1409
|
-
import
|
|
1424
|
+
import React65 from "react";
|
|
1410
1425
|
var Checkbox = ({
|
|
1411
1426
|
id,
|
|
1412
1427
|
label,
|
|
@@ -1421,7 +1436,7 @@ var Checkbox = ({
|
|
|
1421
1436
|
const handleChange = (e) => {
|
|
1422
1437
|
if (onChange) onChange(e.target.checked);
|
|
1423
1438
|
};
|
|
1424
|
-
return /* @__PURE__ */
|
|
1439
|
+
return /* @__PURE__ */ React65.createElement("div", { className: ["checkbox-wrapper-13", sxClass].filter(Boolean).join(" ") }, /* @__PURE__ */ React65.createElement("label", { className: `${className}`, style }, /* @__PURE__ */ React65.createElement(
|
|
1425
1440
|
"input",
|
|
1426
1441
|
{
|
|
1427
1442
|
id,
|
|
@@ -1430,11 +1445,11 @@ var Checkbox = ({
|
|
|
1430
1445
|
onChange: handleChange,
|
|
1431
1446
|
disabled
|
|
1432
1447
|
}
|
|
1433
|
-
), label && /* @__PURE__ */
|
|
1448
|
+
), label && /* @__PURE__ */ React65.createElement("span", { className: "checkbox-label" }, label)));
|
|
1434
1449
|
};
|
|
1435
1450
|
|
|
1436
1451
|
// lib/TextFields/TextField.tsx
|
|
1437
|
-
import
|
|
1452
|
+
import React66, { forwardRef } from "react";
|
|
1438
1453
|
var TextField = forwardRef(({
|
|
1439
1454
|
label,
|
|
1440
1455
|
name,
|
|
@@ -1481,7 +1496,7 @@ var TextField = forwardRef(({
|
|
|
1481
1496
|
sxClass,
|
|
1482
1497
|
className
|
|
1483
1498
|
].filter(Boolean).join(" ");
|
|
1484
|
-
const internalRef =
|
|
1499
|
+
const internalRef = React66.useRef(null);
|
|
1485
1500
|
const triggerChange = () => {
|
|
1486
1501
|
if (internalRef.current) {
|
|
1487
1502
|
const nativeInputValueSetter = Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype, "value")?.set;
|
|
@@ -1529,7 +1544,7 @@ var TextField = forwardRef(({
|
|
|
1529
1544
|
props.onKeyDown(e);
|
|
1530
1545
|
}
|
|
1531
1546
|
};
|
|
1532
|
-
return /* @__PURE__ */
|
|
1547
|
+
return /* @__PURE__ */ React66.createElement("div", { ref, className: rootClasses, style }, /* @__PURE__ */ React66.createElement("div", { className: `rf-text-field__wrapper ${InputProps?.className || ""}`, style: InputProps?.style }, InputProps?.startAdornment && /* @__PURE__ */ React66.createElement("div", { className: "rf-text-field__adornment rf-text-field__adornment--start" }, InputProps.startAdornment), /* @__PURE__ */ React66.createElement(
|
|
1533
1548
|
"input",
|
|
1534
1549
|
{
|
|
1535
1550
|
ref: internalRef,
|
|
@@ -1547,12 +1562,12 @@ var TextField = forwardRef(({
|
|
|
1547
1562
|
...slotProps?.input,
|
|
1548
1563
|
...props
|
|
1549
1564
|
}
|
|
1550
|
-
), InputProps?.endAdornment && /* @__PURE__ */
|
|
1565
|
+
), InputProps?.endAdornment && /* @__PURE__ */ React66.createElement("div", { className: "rf-text-field__adornment rf-text-field__adornment--end" }, InputProps.endAdornment), type === "number" && !disabled && !readOnly && /* @__PURE__ */ React66.createElement("div", { className: "rf-text-field__number-controls" }, /* @__PURE__ */ React66.createElement("button", { type: "button", tabIndex: -1, onClick: handleIncrement, className: "rf-text-field__number-btn" }, /* @__PURE__ */ React66.createElement("svg", { width: "8", height: "5", viewBox: "0 0 8 5", fill: "currentColor" }, /* @__PURE__ */ React66.createElement("path", { d: "M4 0L8 5H0L4 0Z" }))), /* @__PURE__ */ React66.createElement("button", { type: "button", tabIndex: -1, onClick: handleDecrement, className: "rf-text-field__number-btn", style: { marginTop: 2 } }, /* @__PURE__ */ React66.createElement("svg", { width: "8", height: "5", viewBox: "0 0 8 5", fill: "currentColor" }, /* @__PURE__ */ React66.createElement("path", { d: "M4 5L0 0H8L4 5Z" })))), hasLabel && /* @__PURE__ */ React66.createElement("label", { htmlFor: inputId, className: "rf-text-field__label" }, label, " ", required && /* @__PURE__ */ React66.createElement("span", { className: "rf-text-field__asterisk" }, "*")), variant === "outlined" && /* @__PURE__ */ React66.createElement("fieldset", { className: "rf-text-field__notch" }, hasLabel ? /* @__PURE__ */ React66.createElement("legend", { className: "rf-text-field__legend" }, /* @__PURE__ */ React66.createElement("span", null, label, " ", required ? "*" : "")) : /* @__PURE__ */ React66.createElement("legend", { className: "rf-text-field__legend--empty" }))), helperText && /* @__PURE__ */ React66.createElement("div", { className: "rf-text-field__helper-text" }, helperText));
|
|
1551
1566
|
});
|
|
1552
1567
|
TextField.displayName = "TextField";
|
|
1553
1568
|
|
|
1554
1569
|
// lib/TextFields/AddressLookup.tsx
|
|
1555
|
-
import
|
|
1570
|
+
import React67, { useState as useState4, useRef as useRef3, useEffect as useEffect3 } from "react";
|
|
1556
1571
|
import Axios from "axios";
|
|
1557
1572
|
import { Country, State, City } from "country-state-city";
|
|
1558
1573
|
var AddressLookup = ({
|
|
@@ -1727,7 +1742,7 @@ var AddressLookup = ({
|
|
|
1727
1742
|
city: ""
|
|
1728
1743
|
});
|
|
1729
1744
|
};
|
|
1730
|
-
return /* @__PURE__ */
|
|
1745
|
+
return /* @__PURE__ */ React67.createElement("div", { className: "address-lookup-container", style: sx, ref: containerRef }, /* @__PURE__ */ React67.createElement("div", { className: `address-lookup-grid address-lookup-grid-${layout}` }, /* @__PURE__ */ React67.createElement("div", { className: "address-lookup-grid-item col-l1" }, /* @__PURE__ */ React67.createElement(
|
|
1731
1746
|
TextField,
|
|
1732
1747
|
{
|
|
1733
1748
|
label,
|
|
@@ -1760,7 +1775,7 @@ var AddressLookup = ({
|
|
|
1760
1775
|
},
|
|
1761
1776
|
onFocus: () => suggestions.length > 0 && setShowSuggestions(true)
|
|
1762
1777
|
}
|
|
1763
|
-
), loading && /* @__PURE__ */
|
|
1778
|
+
), loading && /* @__PURE__ */ React67.createElement("div", { className: "loading-indicator" }, /* @__PURE__ */ React67.createElement(circularProgress_default, { size: 20 })), showSuggestions && suggestions.length > 0 && /* @__PURE__ */ React67.createElement("div", { className: "autocomplete-dropdown" }, suggestions.map((option, idx) => /* @__PURE__ */ React67.createElement(
|
|
1764
1779
|
"div",
|
|
1765
1780
|
{
|
|
1766
1781
|
key: idx,
|
|
@@ -1771,9 +1786,9 @@ var AddressLookup = ({
|
|
|
1771
1786
|
fetchPlaceDetails(option.placePrediction.placeId, mainText);
|
|
1772
1787
|
}
|
|
1773
1788
|
},
|
|
1774
|
-
/* @__PURE__ */
|
|
1775
|
-
/* @__PURE__ */
|
|
1776
|
-
))), error.addressLine1 && /* @__PURE__ */
|
|
1789
|
+
/* @__PURE__ */ React67.createElement("div", { className: "autocomplete-main-text" }, option?.placePrediction?.structuredFormat?.mainText?.text),
|
|
1790
|
+
/* @__PURE__ */ React67.createElement("div", { className: "autocomplete-secondary-text" }, option?.placePrediction?.structuredFormat?.secondaryText?.text)
|
|
1791
|
+
))), error.addressLine1 && /* @__PURE__ */ React67.createElement("div", { className: "field-error-text" }, error.addressLine1)), layout === "compact" && /* @__PURE__ */ React67.createElement("div", { className: "address-lookup-grid-item col-l2" }, /* @__PURE__ */ React67.createElement(
|
|
1777
1792
|
TextField,
|
|
1778
1793
|
{
|
|
1779
1794
|
label: "Address Line 2",
|
|
@@ -1782,7 +1797,7 @@ var AddressLookup = ({
|
|
|
1782
1797
|
value: value.addressLine2 || "",
|
|
1783
1798
|
onChange: (e) => handleChange("addressLine2", e.target.value)
|
|
1784
1799
|
}
|
|
1785
|
-
)), layout !== "compact" && /* @__PURE__ */
|
|
1800
|
+
)), layout !== "compact" && /* @__PURE__ */ React67.createElement("div", { className: "address-lookup-grid-item col-l2" }, /* @__PURE__ */ React67.createElement(
|
|
1786
1801
|
TextField,
|
|
1787
1802
|
{
|
|
1788
1803
|
label: "Address Line 2",
|
|
@@ -1791,7 +1806,7 @@ var AddressLookup = ({
|
|
|
1791
1806
|
value: value.addressLine2 || "",
|
|
1792
1807
|
onChange: (e) => handleChange("addressLine2", e.target.value)
|
|
1793
1808
|
}
|
|
1794
|
-
)), /* @__PURE__ */
|
|
1809
|
+
)), /* @__PURE__ */ React67.createElement("div", { className: "address-lookup-grid-item col-country" }, /* @__PURE__ */ React67.createElement(
|
|
1795
1810
|
TextField,
|
|
1796
1811
|
{
|
|
1797
1812
|
label: "Country",
|
|
@@ -1804,7 +1819,7 @@ var AddressLookup = ({
|
|
|
1804
1819
|
onChange: (e) => handleCountryChange(e.target.value),
|
|
1805
1820
|
list: "countries-list"
|
|
1806
1821
|
}
|
|
1807
|
-
), /* @__PURE__ */
|
|
1822
|
+
), /* @__PURE__ */ React67.createElement("datalist", { id: "countries-list" }, countries.map((c) => /* @__PURE__ */ React67.createElement("option", { key: c.isoCode, value: c.name }))), error.country && /* @__PURE__ */ React67.createElement("div", { className: "field-error-text" }, error.country)), /* @__PURE__ */ React67.createElement("div", { className: "address-lookup-grid-item col-state" }, /* @__PURE__ */ React67.createElement(
|
|
1808
1823
|
TextField,
|
|
1809
1824
|
{
|
|
1810
1825
|
label: "State",
|
|
@@ -1818,7 +1833,7 @@ var AddressLookup = ({
|
|
|
1818
1833
|
onChange: (e) => handleStateChange(e.target.value),
|
|
1819
1834
|
list: "states-list"
|
|
1820
1835
|
}
|
|
1821
|
-
), /* @__PURE__ */
|
|
1836
|
+
), /* @__PURE__ */ React67.createElement("datalist", { id: "states-list" }, states.map((s) => /* @__PURE__ */ React67.createElement("option", { key: s.isoCode, value: s.name }))), error.state && /* @__PURE__ */ React67.createElement("div", { className: "field-error-text" }, error.state)), /* @__PURE__ */ React67.createElement("div", { className: "address-lookup-grid-item col-city" }, /* @__PURE__ */ React67.createElement(
|
|
1822
1837
|
TextField,
|
|
1823
1838
|
{
|
|
1824
1839
|
label: "City",
|
|
@@ -1832,7 +1847,7 @@ var AddressLookup = ({
|
|
|
1832
1847
|
onChange: (e) => handleChange("city", e.target.value),
|
|
1833
1848
|
list: "cities-list"
|
|
1834
1849
|
}
|
|
1835
|
-
), /* @__PURE__ */
|
|
1850
|
+
), /* @__PURE__ */ React67.createElement("datalist", { id: "cities-list" }, cities.map((c, i) => /* @__PURE__ */ React67.createElement("option", { key: i, value: c.name }))), error.city && /* @__PURE__ */ React67.createElement("div", { className: "field-error-text" }, error.city)), /* @__PURE__ */ React67.createElement("div", { className: "address-lookup-grid-item col-pin" }, /* @__PURE__ */ React67.createElement(
|
|
1836
1851
|
TextField,
|
|
1837
1852
|
{
|
|
1838
1853
|
label: "Pincode",
|
|
@@ -1844,12 +1859,12 @@ var AddressLookup = ({
|
|
|
1844
1859
|
readOnly: googleFields.pincode && !!value.pincode,
|
|
1845
1860
|
onChange: (e) => handleChange("pincode", e.target.value)
|
|
1846
1861
|
}
|
|
1847
|
-
), error.pincode && /* @__PURE__ */
|
|
1862
|
+
), error.pincode && /* @__PURE__ */ React67.createElement("div", { className: "field-error-text" }, error.pincode))));
|
|
1848
1863
|
};
|
|
1849
1864
|
var AddressLookup_default = AddressLookup;
|
|
1850
1865
|
|
|
1851
1866
|
// lib/TextFields/DateField.tsx
|
|
1852
|
-
import
|
|
1867
|
+
import React68, {
|
|
1853
1868
|
useState as useState5,
|
|
1854
1869
|
useRef as useRef4,
|
|
1855
1870
|
useEffect as useEffect4,
|
|
@@ -1949,9 +1964,9 @@ var parseTimeFromISO = (iso) => {
|
|
|
1949
1964
|
if (h === 0) h = 12;
|
|
1950
1965
|
return { h, m, ampm };
|
|
1951
1966
|
};
|
|
1952
|
-
var CalendarIcon = () => /* @__PURE__ */
|
|
1953
|
-
var ChevUp = () => /* @__PURE__ */
|
|
1954
|
-
var ChevDown = () => /* @__PURE__ */
|
|
1967
|
+
var CalendarIcon = () => /* @__PURE__ */ React68.createElement("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React68.createElement("rect", { x: "3", y: "4", width: "18", height: "18", rx: "2", ry: "2" }), /* @__PURE__ */ React68.createElement("line", { x1: "16", y1: "2", x2: "16", y2: "6" }), /* @__PURE__ */ React68.createElement("line", { x1: "8", y1: "2", x2: "8", y2: "6" }), /* @__PURE__ */ React68.createElement("line", { x1: "3", y1: "10", x2: "21", y2: "10" }));
|
|
1968
|
+
var ChevUp = () => /* @__PURE__ */ React68.createElement("svg", { width: "10", height: "7", viewBox: "0 0 10 7", fill: "currentColor" }, /* @__PURE__ */ React68.createElement("path", { d: "M5 0L10 7H0L5 0Z" }));
|
|
1969
|
+
var ChevDown = () => /* @__PURE__ */ React68.createElement("svg", { width: "10", height: "7", viewBox: "0 0 10 7", fill: "currentColor" }, /* @__PURE__ */ React68.createElement("path", { d: "M5 7L0 0H10L5 7Z" }));
|
|
1955
1970
|
var ITEM_H = 36;
|
|
1956
1971
|
var ScrollColumn = ({ items, selected, onSelect, infinite = true }) => {
|
|
1957
1972
|
const listRef = useRef4(null);
|
|
@@ -1999,15 +2014,15 @@ var ScrollColumn = ({ items, selected, onSelect, infinite = true }) => {
|
|
|
1999
2014
|
}
|
|
2000
2015
|
}, 100);
|
|
2001
2016
|
};
|
|
2002
|
-
return /* @__PURE__ */
|
|
2017
|
+
return /* @__PURE__ */ React68.createElement("div", { className: "rf-timescroll__col-wrapper" }, /* @__PURE__ */ React68.createElement(
|
|
2003
2018
|
"div",
|
|
2004
2019
|
{
|
|
2005
2020
|
className: "rf-timescroll__col",
|
|
2006
2021
|
ref: listRef,
|
|
2007
2022
|
onScroll: handleScroll
|
|
2008
2023
|
},
|
|
2009
|
-
!infinite && /* @__PURE__ */
|
|
2010
|
-
virtualItems.map((label, idx) => /* @__PURE__ */
|
|
2024
|
+
!infinite && /* @__PURE__ */ React68.createElement("div", { className: "rf-timescroll__spacer" }),
|
|
2025
|
+
virtualItems.map((label, idx) => /* @__PURE__ */ React68.createElement(
|
|
2011
2026
|
"div",
|
|
2012
2027
|
{
|
|
2013
2028
|
key: `${label}-${idx}`,
|
|
@@ -2015,8 +2030,8 @@ var ScrollColumn = ({ items, selected, onSelect, infinite = true }) => {
|
|
|
2015
2030
|
},
|
|
2016
2031
|
label
|
|
2017
2032
|
)),
|
|
2018
|
-
!infinite && /* @__PURE__ */
|
|
2019
|
-
), /* @__PURE__ */
|
|
2033
|
+
!infinite && /* @__PURE__ */ React68.createElement("div", { className: "rf-timescroll__spacer" })
|
|
2034
|
+
), /* @__PURE__ */ React68.createElement("div", { className: "rf-timescroll__mask rf-timescroll__mask--top" }), /* @__PURE__ */ React68.createElement("div", { className: "rf-timescroll__mask rf-timescroll__mask--bottom" }));
|
|
2020
2035
|
};
|
|
2021
2036
|
var SpinnerPanel = ({
|
|
2022
2037
|
hour,
|
|
@@ -2027,7 +2042,7 @@ var SpinnerPanel = ({
|
|
|
2027
2042
|
onHourInput,
|
|
2028
2043
|
onMinuteInput,
|
|
2029
2044
|
onAmpmToggle
|
|
2030
|
-
}) => /* @__PURE__ */
|
|
2045
|
+
}) => /* @__PURE__ */ React68.createElement("div", { className: "rf-date-picker__time-row" }, /* @__PURE__ */ React68.createElement("div", { className: "rf-date-picker__time-input-wrap" }, /* @__PURE__ */ React68.createElement("button", { type: "button", className: "rf-date-picker__time-spin-btn", onMouseDown: (e) => e.preventDefault(), onClick: () => onHourChange(1) }, /* @__PURE__ */ React68.createElement(ChevUp, null)), /* @__PURE__ */ React68.createElement(
|
|
2031
2046
|
"input",
|
|
2032
2047
|
{
|
|
2033
2048
|
type: "number",
|
|
@@ -2038,7 +2053,7 @@ var SpinnerPanel = ({
|
|
|
2038
2053
|
onChange: onHourInput,
|
|
2039
2054
|
onMouseDown: (e) => e.stopPropagation()
|
|
2040
2055
|
}
|
|
2041
|
-
), /* @__PURE__ */
|
|
2056
|
+
), /* @__PURE__ */ React68.createElement("button", { type: "button", className: "rf-date-picker__time-spin-btn", onMouseDown: (e) => e.preventDefault(), onClick: () => onHourChange(-1) }, /* @__PURE__ */ React68.createElement(ChevDown, null))), /* @__PURE__ */ React68.createElement("div", { className: "rf-date-picker__time-colon" }, ":"), /* @__PURE__ */ React68.createElement("div", { className: "rf-date-picker__time-input-wrap" }, /* @__PURE__ */ React68.createElement("button", { type: "button", className: "rf-date-picker__time-spin-btn", onMouseDown: (e) => e.preventDefault(), onClick: () => onMinuteChange(1) }, /* @__PURE__ */ React68.createElement(ChevUp, null)), /* @__PURE__ */ React68.createElement(
|
|
2042
2057
|
"input",
|
|
2043
2058
|
{
|
|
2044
2059
|
type: "number",
|
|
@@ -2049,7 +2064,7 @@ var SpinnerPanel = ({
|
|
|
2049
2064
|
onChange: onMinuteInput,
|
|
2050
2065
|
onMouseDown: (e) => e.stopPropagation()
|
|
2051
2066
|
}
|
|
2052
|
-
), /* @__PURE__ */
|
|
2067
|
+
), /* @__PURE__ */ React68.createElement("button", { type: "button", className: "rf-date-picker__time-spin-btn", onMouseDown: (e) => e.preventDefault(), onClick: () => onMinuteChange(-1) }, /* @__PURE__ */ React68.createElement(ChevDown, null))), /* @__PURE__ */ React68.createElement("div", { className: "rf-date-picker__ampm" }, /* @__PURE__ */ React68.createElement(
|
|
2053
2068
|
"button",
|
|
2054
2069
|
{
|
|
2055
2070
|
type: "button",
|
|
@@ -2058,7 +2073,7 @@ var SpinnerPanel = ({
|
|
|
2058
2073
|
onClick: () => onAmpmToggle("AM")
|
|
2059
2074
|
},
|
|
2060
2075
|
"AM"
|
|
2061
|
-
), /* @__PURE__ */
|
|
2076
|
+
), /* @__PURE__ */ React68.createElement(
|
|
2062
2077
|
"button",
|
|
2063
2078
|
{
|
|
2064
2079
|
type: "button",
|
|
@@ -2077,12 +2092,12 @@ var CalendarBody = ({
|
|
|
2077
2092
|
onDayClick,
|
|
2078
2093
|
onPrev,
|
|
2079
2094
|
onNext
|
|
2080
|
-
}) => /* @__PURE__ */
|
|
2081
|
-
if (day === null) return /* @__PURE__ */
|
|
2095
|
+
}) => /* @__PURE__ */ React68.createElement(React68.Fragment, null, /* @__PURE__ */ React68.createElement("div", { className: "rf-date-picker__header" }, /* @__PURE__ */ React68.createElement("span", { className: "rf-date-picker__month-label" }, MONTHS[viewMonth], " ", viewYear), /* @__PURE__ */ React68.createElement("div", { className: "rf-date-picker__nav" }, /* @__PURE__ */ React68.createElement("button", { type: "button", className: "rf-date-picker__nav-btn", onClick: onPrev, "aria-label": "Previous month" }, "\u2039"), /* @__PURE__ */ React68.createElement("button", { type: "button", className: "rf-date-picker__nav-btn", onClick: onNext, "aria-label": "Next month" }, "\u203A"))), /* @__PURE__ */ React68.createElement("div", { className: "rf-date-picker__weekdays" }, WEEKDAYS.map((w) => /* @__PURE__ */ React68.createElement("div", { key: w, className: "rf-date-picker__weekday" }, w))), /* @__PURE__ */ React68.createElement("div", { className: "rf-date-picker__grid" }, dayCells.map((day, idx) => {
|
|
2096
|
+
if (day === null) return /* @__PURE__ */ React68.createElement("div", { key: `e-${idx}`, className: "rf-date-picker__day rf-date-picker__day--empty" });
|
|
2082
2097
|
const cellDate = new Date(viewYear, viewMonth, day);
|
|
2083
2098
|
const isSelected = selectedDate ? isSameDay(cellDate, selectedDate) : false;
|
|
2084
2099
|
const isToday = isSameDay(cellDate, todayDate);
|
|
2085
|
-
return /* @__PURE__ */
|
|
2100
|
+
return /* @__PURE__ */ React68.createElement(
|
|
2086
2101
|
"button",
|
|
2087
2102
|
{
|
|
2088
2103
|
key: day,
|
|
@@ -2333,7 +2348,7 @@ var DateField = ({
|
|
|
2333
2348
|
const inputPlaceholder = placeholder || (variant === "outlined" ? " " : void 0);
|
|
2334
2349
|
const todayDate = today();
|
|
2335
2350
|
const isSideVariant = type === "datetime-side" || type === "datetime-scroll";
|
|
2336
|
-
return /* @__PURE__ */
|
|
2351
|
+
return /* @__PURE__ */ React68.createElement("div", { ref: containerRef, className: rootClasses, style }, /* @__PURE__ */ React68.createElement("div", { className: "rf-date-field__anchor" }, /* @__PURE__ */ React68.createElement(
|
|
2337
2352
|
"div",
|
|
2338
2353
|
{
|
|
2339
2354
|
className: "rf-text-field__wrapper",
|
|
@@ -2342,7 +2357,7 @@ var DateField = ({
|
|
|
2342
2357
|
},
|
|
2343
2358
|
style: { cursor: disabled ? "default" : "pointer" }
|
|
2344
2359
|
},
|
|
2345
|
-
/* @__PURE__ */
|
|
2360
|
+
/* @__PURE__ */ React68.createElement(
|
|
2346
2361
|
"input",
|
|
2347
2362
|
{
|
|
2348
2363
|
id: inputId,
|
|
@@ -2358,7 +2373,7 @@ var DateField = ({
|
|
|
2358
2373
|
}
|
|
2359
2374
|
}
|
|
2360
2375
|
),
|
|
2361
|
-
/* @__PURE__ */
|
|
2376
|
+
/* @__PURE__ */ React68.createElement("div", { className: "rf-text-field__adornment rf-text-field__adornment--end" }, /* @__PURE__ */ React68.createElement(
|
|
2362
2377
|
"button",
|
|
2363
2378
|
{
|
|
2364
2379
|
type: "button",
|
|
@@ -2371,11 +2386,11 @@ var DateField = ({
|
|
|
2371
2386
|
},
|
|
2372
2387
|
"aria-label": "Pick date"
|
|
2373
2388
|
},
|
|
2374
|
-
/* @__PURE__ */
|
|
2389
|
+
/* @__PURE__ */ React68.createElement(CalendarIcon, null)
|
|
2375
2390
|
)),
|
|
2376
|
-
label && /* @__PURE__ */
|
|
2377
|
-
variant === "outlined" && /* @__PURE__ */
|
|
2378
|
-
), open && !disabled && /* @__PURE__ */
|
|
2391
|
+
label && /* @__PURE__ */ React68.createElement("label", { htmlFor: inputId, className: "rf-text-field__label" }, label, " ", required && /* @__PURE__ */ React68.createElement("span", { className: "rf-text-field__asterisk" }, "*")),
|
|
2392
|
+
variant === "outlined" && /* @__PURE__ */ React68.createElement("fieldset", { className: "rf-text-field__notch" }, label && /* @__PURE__ */ React68.createElement("legend", { className: "rf-text-field__legend" }, /* @__PURE__ */ React68.createElement("span", null, label, required ? " *" : "")))
|
|
2393
|
+
), open && !disabled && /* @__PURE__ */ React68.createElement(
|
|
2379
2394
|
"div",
|
|
2380
2395
|
{
|
|
2381
2396
|
className: [
|
|
@@ -2384,7 +2399,7 @@ var DateField = ({
|
|
|
2384
2399
|
].filter(Boolean).join(" "),
|
|
2385
2400
|
onMouseDown: (e) => e.preventDefault()
|
|
2386
2401
|
},
|
|
2387
|
-
/* @__PURE__ */
|
|
2402
|
+
/* @__PURE__ */ React68.createElement("div", { className: isSideVariant ? "rf-date-picker__cal-col" : void 0 }, /* @__PURE__ */ React68.createElement(
|
|
2388
2403
|
CalendarBody,
|
|
2389
2404
|
{
|
|
2390
2405
|
viewMonth,
|
|
@@ -2396,7 +2411,7 @@ var DateField = ({
|
|
|
2396
2411
|
onPrev: prevMonth,
|
|
2397
2412
|
onNext: nextMonth
|
|
2398
2413
|
}
|
|
2399
|
-
), type === "datetime" && /* @__PURE__ */
|
|
2414
|
+
), type === "datetime" && /* @__PURE__ */ React68.createElement("div", { className: "rf-date-picker__time-section" }, /* @__PURE__ */ React68.createElement("div", { className: "rf-date-picker__time-label" }, "Time"), /* @__PURE__ */ React68.createElement(
|
|
2400
2415
|
SpinnerPanel,
|
|
2401
2416
|
{
|
|
2402
2417
|
hour,
|
|
@@ -2408,8 +2423,8 @@ var DateField = ({
|
|
|
2408
2423
|
onMinuteInput: handleMinuteInput,
|
|
2409
2424
|
onAmpmToggle: handleAmpmToggle
|
|
2410
2425
|
}
|
|
2411
|
-
)), /* @__PURE__ */
|
|
2412
|
-
type === "datetime-side" && /* @__PURE__ */
|
|
2426
|
+
)), /* @__PURE__ */ React68.createElement("div", { className: "rf-date-picker__divider" }), /* @__PURE__ */ React68.createElement("div", { className: "rf-date-picker__footer" }, /* @__PURE__ */ React68.createElement("button", { type: "button", className: "rf-date-picker__footer-btn", onClick: handleToday }, "Today"), /* @__PURE__ */ React68.createElement("button", { type: "button", className: "rf-date-picker__footer-btn rf-date-picker__footer-btn--clear", onClick: handleClear }, "Clear"))),
|
|
2427
|
+
type === "datetime-side" && /* @__PURE__ */ React68.createElement("div", { className: "rf-date-picker__side-panel" }, /* @__PURE__ */ React68.createElement("div", { className: "rf-date-picker__side-label" }, "Time"), /* @__PURE__ */ React68.createElement("div", { className: "rf-date-picker__side-spinner" }, /* @__PURE__ */ React68.createElement(
|
|
2413
2428
|
SpinnerPanel,
|
|
2414
2429
|
{
|
|
2415
2430
|
hour,
|
|
@@ -2421,22 +2436,22 @@ var DateField = ({
|
|
|
2421
2436
|
onMinuteInput: handleMinuteInput,
|
|
2422
2437
|
onAmpmToggle: handleAmpmToggle
|
|
2423
2438
|
}
|
|
2424
|
-
)), /* @__PURE__ */
|
|
2425
|
-
type === "datetime-scroll" && /* @__PURE__ */
|
|
2439
|
+
)), /* @__PURE__ */ React68.createElement("div", { className: "rf-date-picker__side-time-display" }, String(hour).padStart(2, "0"), ":", String(minute).padStart(2, "0"), " ", ampm)),
|
|
2440
|
+
type === "datetime-scroll" && /* @__PURE__ */ React68.createElement("div", { className: "rf-date-picker__side-panel" }, /* @__PURE__ */ React68.createElement("div", { className: "rf-date-picker__side-label" }, "Time"), /* @__PURE__ */ React68.createElement("div", { className: "rf-timescroll" }, /* @__PURE__ */ React68.createElement(
|
|
2426
2441
|
ScrollColumn,
|
|
2427
2442
|
{
|
|
2428
2443
|
items: HOURS,
|
|
2429
2444
|
selected: hour - 1,
|
|
2430
2445
|
onSelect: handleScrollHour
|
|
2431
2446
|
}
|
|
2432
|
-
), /* @__PURE__ */
|
|
2447
|
+
), /* @__PURE__ */ React68.createElement("div", { className: "rf-timescroll__colon" }, ":"), /* @__PURE__ */ React68.createElement(
|
|
2433
2448
|
ScrollColumn,
|
|
2434
2449
|
{
|
|
2435
2450
|
items: MINUTES,
|
|
2436
2451
|
selected: minute,
|
|
2437
2452
|
onSelect: handleScrollMinute
|
|
2438
2453
|
}
|
|
2439
|
-
), /* @__PURE__ */
|
|
2454
|
+
), /* @__PURE__ */ React68.createElement(
|
|
2440
2455
|
ScrollColumn,
|
|
2441
2456
|
{
|
|
2442
2457
|
items: AMPMS,
|
|
@@ -2444,13 +2459,13 @@ var DateField = ({
|
|
|
2444
2459
|
onSelect: handleScrollAmpm,
|
|
2445
2460
|
infinite: false
|
|
2446
2461
|
}
|
|
2447
|
-
)), /* @__PURE__ */
|
|
2448
|
-
)), helperText && /* @__PURE__ */
|
|
2462
|
+
)), /* @__PURE__ */ React68.createElement("div", { className: "rf-date-picker__side-time-display" }, String(hour).padStart(2, "0"), ":", String(minute).padStart(2, "0"), " ", ampm))
|
|
2463
|
+
)), helperText && /* @__PURE__ */ React68.createElement("div", { className: "rf-text-field__helper-text" }, helperText));
|
|
2449
2464
|
};
|
|
2450
2465
|
DateField.displayName = "DateField";
|
|
2451
2466
|
|
|
2452
2467
|
// lib/TextFields/DateRangeField.tsx
|
|
2453
|
-
import
|
|
2468
|
+
import React69, {
|
|
2454
2469
|
useState as useState6,
|
|
2455
2470
|
useRef as useRef5,
|
|
2456
2471
|
useEffect as useEffect5
|
|
@@ -2579,7 +2594,7 @@ var detectPreset = (start, end) => {
|
|
|
2579
2594
|
if (isSameDay2(start, new Date(2e3, 0, 1)) && isSameDay2(end, today2)) return "all";
|
|
2580
2595
|
return null;
|
|
2581
2596
|
};
|
|
2582
|
-
var CalendarIcon2 = () => /* @__PURE__ */
|
|
2597
|
+
var CalendarIcon2 = () => /* @__PURE__ */ React69.createElement("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React69.createElement("rect", { x: "3", y: "4", width: "18", height: "18", rx: "2", ry: "2" }), /* @__PURE__ */ React69.createElement("line", { x1: "16", y1: "2", x2: "16", y2: "6" }), /* @__PURE__ */ React69.createElement("line", { x1: "8", y1: "2", x2: "8", y2: "6" }), /* @__PURE__ */ React69.createElement("line", { x1: "3", y1: "10", x2: "21", y2: "10" }));
|
|
2583
2598
|
var RangeCalendarBody = ({
|
|
2584
2599
|
viewYear,
|
|
2585
2600
|
viewMonth,
|
|
@@ -2604,7 +2619,7 @@ var RangeCalendarBody = ({
|
|
|
2604
2619
|
const hasRange = startDate != null && effectiveEnd != null && !isSameDay2(startDate, effectiveEnd);
|
|
2605
2620
|
const lo = startDate && effectiveEnd ? startDate <= effectiveEnd ? startDate : effectiveEnd : null;
|
|
2606
2621
|
const hi = startDate && effectiveEnd ? startDate <= effectiveEnd ? effectiveEnd : startDate : null;
|
|
2607
|
-
return /* @__PURE__ */
|
|
2622
|
+
return /* @__PURE__ */ React69.createElement("div", { className: "rf-dr-calendar" }, /* @__PURE__ */ React69.createElement("div", { className: "rf-dr-calendar__header" }, /* @__PURE__ */ React69.createElement(
|
|
2608
2623
|
"button",
|
|
2609
2624
|
{
|
|
2610
2625
|
type: "button",
|
|
@@ -2614,7 +2629,7 @@ var RangeCalendarBody = ({
|
|
|
2614
2629
|
"aria-label": "Previous month"
|
|
2615
2630
|
},
|
|
2616
2631
|
"\u2039"
|
|
2617
|
-
), /* @__PURE__ */
|
|
2632
|
+
), /* @__PURE__ */ React69.createElement("span", { className: "rf-dr-calendar__month-label" }, MONTHS2[viewMonth], " ", viewYear), /* @__PURE__ */ React69.createElement(
|
|
2618
2633
|
"button",
|
|
2619
2634
|
{
|
|
2620
2635
|
type: "button",
|
|
@@ -2624,9 +2639,9 @@ var RangeCalendarBody = ({
|
|
|
2624
2639
|
"aria-label": "Next month"
|
|
2625
2640
|
},
|
|
2626
2641
|
"\u203A"
|
|
2627
|
-
)), /* @__PURE__ */
|
|
2642
|
+
)), /* @__PURE__ */ React69.createElement("div", { className: "rf-dr-calendar__weekdays" }, WEEKDAYS2.map((w) => /* @__PURE__ */ React69.createElement("div", { key: w, className: "rf-dr-calendar__weekday" }, w))), /* @__PURE__ */ React69.createElement("div", { className: "rf-dr-calendar__grid" }, dayCells.map((day, idx) => {
|
|
2628
2643
|
if (day === null) {
|
|
2629
|
-
return /* @__PURE__ */
|
|
2644
|
+
return /* @__PURE__ */ React69.createElement("div", { key: `e-${idx}`, className: "rf-dr-calendar__cell rf-dr-calendar__cell--empty" });
|
|
2630
2645
|
}
|
|
2631
2646
|
const cellDate = new Date(viewYear, viewMonth, day);
|
|
2632
2647
|
const isStart = startDate ? isSameDay2(cellDate, startDate) : false;
|
|
@@ -2646,7 +2661,7 @@ var RangeCalendarBody = ({
|
|
|
2646
2661
|
isStart || isEnd ? "rf-dr-calendar__day--selected" : "",
|
|
2647
2662
|
isToday && !isStart && !isEnd ? "rf-dr-calendar__day--today" : ""
|
|
2648
2663
|
].filter(Boolean).join(" ");
|
|
2649
|
-
return /* @__PURE__ */
|
|
2664
|
+
return /* @__PURE__ */ React69.createElement(
|
|
2650
2665
|
"div",
|
|
2651
2666
|
{
|
|
2652
2667
|
key: day,
|
|
@@ -2654,7 +2669,7 @@ var RangeCalendarBody = ({
|
|
|
2654
2669
|
onMouseEnter: () => onDayHover(cellDate),
|
|
2655
2670
|
onMouseLeave: () => onDayHover(null)
|
|
2656
2671
|
},
|
|
2657
|
-
/* @__PURE__ */
|
|
2672
|
+
/* @__PURE__ */ React69.createElement(
|
|
2658
2673
|
"button",
|
|
2659
2674
|
{
|
|
2660
2675
|
type: "button",
|
|
@@ -2688,14 +2703,14 @@ var MiniCalendar = ({ selectedDate, todayDate, onSelect, onClose }) => {
|
|
|
2688
2703
|
setViewYear((y) => y + 1);
|
|
2689
2704
|
} else setViewMonth((m) => m + 1);
|
|
2690
2705
|
};
|
|
2691
|
-
return /* @__PURE__ */
|
|
2706
|
+
return /* @__PURE__ */ React69.createElement("div", { className: "rf-dr-mini-cal" }, /* @__PURE__ */ React69.createElement("div", { className: "rf-dr-mini-cal__header" }, /* @__PURE__ */ React69.createElement("button", { type: "button", className: "rf-dr-calendar__nav-btn", onClick: prevMonth }, "\u2039"), /* @__PURE__ */ React69.createElement("span", { className: "rf-dr-calendar__month-label", style: { fontSize: "0.88rem" } }, MONTHS2[viewMonth], " ", viewYear), /* @__PURE__ */ React69.createElement("button", { type: "button", className: "rf-dr-calendar__nav-btn", onClick: nextMonth }, "\u203A")), /* @__PURE__ */ React69.createElement("div", { className: "rf-dr-calendar__weekdays" }, WEEKDAYS2.map((w) => /* @__PURE__ */ React69.createElement("div", { key: w, className: "rf-dr-calendar__weekday" }, w))), /* @__PURE__ */ React69.createElement("div", { className: "rf-dr-calendar__grid" }, dayCells.map((day, idx) => {
|
|
2692
2707
|
if (day === null) {
|
|
2693
|
-
return /* @__PURE__ */
|
|
2708
|
+
return /* @__PURE__ */ React69.createElement("div", { key: `e-${idx}`, className: "rf-dr-calendar__cell rf-dr-calendar__cell--empty" });
|
|
2694
2709
|
}
|
|
2695
2710
|
const cellDate = new Date(viewYear, viewMonth, day);
|
|
2696
2711
|
const isSel = selectedDate ? isSameDay2(cellDate, selectedDate) : false;
|
|
2697
2712
|
const isToday = isSameDay2(cellDate, todayDate);
|
|
2698
|
-
return /* @__PURE__ */
|
|
2713
|
+
return /* @__PURE__ */ React69.createElement("div", { key: day, className: "rf-dr-calendar__cell" }, /* @__PURE__ */ React69.createElement(
|
|
2699
2714
|
"button",
|
|
2700
2715
|
{
|
|
2701
2716
|
type: "button",
|
|
@@ -2903,7 +2918,7 @@ var DateRangeField = ({
|
|
|
2903
2918
|
className
|
|
2904
2919
|
].filter(Boolean).join(" ");
|
|
2905
2920
|
const inputPlaceholder = variant === "outlined" ? " " : void 0;
|
|
2906
|
-
return /* @__PURE__ */
|
|
2921
|
+
return /* @__PURE__ */ React69.createElement("div", { ref: containerRef, className: rootClasses, style }, /* @__PURE__ */ React69.createElement("div", { className: "rf-date-field__anchor" }, /* @__PURE__ */ React69.createElement(
|
|
2907
2922
|
"div",
|
|
2908
2923
|
{
|
|
2909
2924
|
className: "rf-text-field__wrapper",
|
|
@@ -2912,7 +2927,7 @@ var DateRangeField = ({
|
|
|
2912
2927
|
},
|
|
2913
2928
|
style: { cursor: disabled ? "default" : "pointer" }
|
|
2914
2929
|
},
|
|
2915
|
-
/* @__PURE__ */
|
|
2930
|
+
/* @__PURE__ */ React69.createElement(
|
|
2916
2931
|
"input",
|
|
2917
2932
|
{
|
|
2918
2933
|
id: inputId,
|
|
@@ -2928,7 +2943,7 @@ var DateRangeField = ({
|
|
|
2928
2943
|
}
|
|
2929
2944
|
}
|
|
2930
2945
|
),
|
|
2931
|
-
/* @__PURE__ */
|
|
2946
|
+
/* @__PURE__ */ React69.createElement("div", { className: "rf-text-field__adornment rf-text-field__adornment--end" }, /* @__PURE__ */ React69.createElement(
|
|
2932
2947
|
"button",
|
|
2933
2948
|
{
|
|
2934
2949
|
type: "button",
|
|
@@ -2941,13 +2956,13 @@ var DateRangeField = ({
|
|
|
2941
2956
|
},
|
|
2942
2957
|
"aria-label": "Pick date range"
|
|
2943
2958
|
},
|
|
2944
|
-
/* @__PURE__ */
|
|
2959
|
+
/* @__PURE__ */ React69.createElement(CalendarIcon2, null)
|
|
2945
2960
|
)),
|
|
2946
|
-
label && /* @__PURE__ */
|
|
2947
|
-
variant === "outlined" && /* @__PURE__ */
|
|
2961
|
+
label && /* @__PURE__ */ React69.createElement("label", { htmlFor: inputId, className: "rf-text-field__label" }, label, " ", required && /* @__PURE__ */ React69.createElement("span", { className: "rf-text-field__asterisk" }, "*")),
|
|
2962
|
+
variant === "outlined" && /* @__PURE__ */ React69.createElement("fieldset", { className: "rf-text-field__notch" }, label ? /* @__PURE__ */ React69.createElement("legend", { className: "rf-text-field__legend" }, /* @__PURE__ */ React69.createElement("span", null, label, required ? " *" : "")) : /* @__PURE__ */ React69.createElement("legend", { className: "rf-text-field__legend--empty" }))
|
|
2948
2963
|
), open && !disabled && (pickerType === "panel" ? (
|
|
2949
2964
|
/* ── Panel Mode ── */
|
|
2950
|
-
/* @__PURE__ */
|
|
2965
|
+
/* @__PURE__ */ React69.createElement("div", { className: "rf-dr-picker rf-dr-picker--panel", onMouseDown: (e) => e.preventDefault() }, /* @__PURE__ */ React69.createElement("div", { className: "rf-dr-picker__presets" }, PRESETS.map((p, i) => /* @__PURE__ */ React69.createElement(React69.Fragment, { key: p.id }, i > 0 && /* @__PURE__ */ React69.createElement("div", { className: "rf-dr-picker__preset-sep" }), /* @__PURE__ */ React69.createElement(
|
|
2951
2966
|
"button",
|
|
2952
2967
|
{
|
|
2953
2968
|
type: "button",
|
|
@@ -2958,7 +2973,7 @@ var DateRangeField = ({
|
|
|
2958
2973
|
onClick: () => handlePreset(p.id)
|
|
2959
2974
|
},
|
|
2960
2975
|
p.label
|
|
2961
|
-
)))), /* @__PURE__ */
|
|
2976
|
+
)))), /* @__PURE__ */ React69.createElement("div", { className: "rf-dr-picker__manual" }, /* @__PURE__ */ React69.createElement("div", { className: "rf-dr-picker__date-field-wrap" }, /* @__PURE__ */ React69.createElement(
|
|
2962
2977
|
"div",
|
|
2963
2978
|
{
|
|
2964
2979
|
className: [
|
|
@@ -2966,8 +2981,8 @@ var DateRangeField = ({
|
|
|
2966
2981
|
inlineCal === "start" ? "rf-dr-picker__date-field--active" : ""
|
|
2967
2982
|
].filter(Boolean).join(" ")
|
|
2968
2983
|
},
|
|
2969
|
-
/* @__PURE__ */
|
|
2970
|
-
/* @__PURE__ */
|
|
2984
|
+
/* @__PURE__ */ React69.createElement("span", { className: "rf-dr-picker__date-floating-label" }, "Start Date"),
|
|
2985
|
+
/* @__PURE__ */ React69.createElement("div", { className: "rf-dr-picker__date-display" }, /* @__PURE__ */ React69.createElement(
|
|
2971
2986
|
"input",
|
|
2972
2987
|
{
|
|
2973
2988
|
type: "text",
|
|
@@ -2978,7 +2993,7 @@ var DateRangeField = ({
|
|
|
2978
2993
|
onBlur: handleStartInputBlur,
|
|
2979
2994
|
onMouseDown: (e) => e.stopPropagation()
|
|
2980
2995
|
}
|
|
2981
|
-
), /* @__PURE__ */
|
|
2996
|
+
), /* @__PURE__ */ React69.createElement(
|
|
2982
2997
|
"button",
|
|
2983
2998
|
{
|
|
2984
2999
|
type: "button",
|
|
@@ -2987,9 +3002,9 @@ var DateRangeField = ({
|
|
|
2987
3002
|
onClick: () => setInlineCal((v) => v === "start" ? null : "start"),
|
|
2988
3003
|
"aria-label": "Pick start date"
|
|
2989
3004
|
},
|
|
2990
|
-
/* @__PURE__ */
|
|
3005
|
+
/* @__PURE__ */ React69.createElement(CalendarIcon2, null)
|
|
2991
3006
|
))
|
|
2992
|
-
), inlineCal === "start" && /* @__PURE__ */
|
|
3007
|
+
), inlineCal === "start" && /* @__PURE__ */ React69.createElement(
|
|
2993
3008
|
MiniCalendar,
|
|
2994
3009
|
{
|
|
2995
3010
|
selectedDate: draftStart,
|
|
@@ -3000,7 +3015,7 @@ var DateRangeField = ({
|
|
|
3000
3015
|
},
|
|
3001
3016
|
onClose: () => setInlineCal(null)
|
|
3002
3017
|
}
|
|
3003
|
-
)), /* @__PURE__ */
|
|
3018
|
+
)), /* @__PURE__ */ React69.createElement("div", { className: "rf-dr-picker__date-field-wrap" }, /* @__PURE__ */ React69.createElement(
|
|
3004
3019
|
"div",
|
|
3005
3020
|
{
|
|
3006
3021
|
className: [
|
|
@@ -3008,8 +3023,8 @@ var DateRangeField = ({
|
|
|
3008
3023
|
inlineCal === "end" ? "rf-dr-picker__date-field--active" : ""
|
|
3009
3024
|
].filter(Boolean).join(" ")
|
|
3010
3025
|
},
|
|
3011
|
-
/* @__PURE__ */
|
|
3012
|
-
/* @__PURE__ */
|
|
3026
|
+
/* @__PURE__ */ React69.createElement("span", { className: "rf-dr-picker__date-floating-label" }, "End Date"),
|
|
3027
|
+
/* @__PURE__ */ React69.createElement("div", { className: "rf-dr-picker__date-display" }, /* @__PURE__ */ React69.createElement(
|
|
3013
3028
|
"input",
|
|
3014
3029
|
{
|
|
3015
3030
|
type: "text",
|
|
@@ -3020,7 +3035,7 @@ var DateRangeField = ({
|
|
|
3020
3035
|
onBlur: handleEndInputBlur,
|
|
3021
3036
|
onMouseDown: (e) => e.stopPropagation()
|
|
3022
3037
|
}
|
|
3023
|
-
), /* @__PURE__ */
|
|
3038
|
+
), /* @__PURE__ */ React69.createElement(
|
|
3024
3039
|
"button",
|
|
3025
3040
|
{
|
|
3026
3041
|
type: "button",
|
|
@@ -3029,9 +3044,9 @@ var DateRangeField = ({
|
|
|
3029
3044
|
onClick: () => setInlineCal((v) => v === "end" ? null : "end"),
|
|
3030
3045
|
"aria-label": "Pick end date"
|
|
3031
3046
|
},
|
|
3032
|
-
/* @__PURE__ */
|
|
3047
|
+
/* @__PURE__ */ React69.createElement(CalendarIcon2, null)
|
|
3033
3048
|
))
|
|
3034
|
-
), inlineCal === "end" && /* @__PURE__ */
|
|
3049
|
+
), inlineCal === "end" && /* @__PURE__ */ React69.createElement(
|
|
3035
3050
|
MiniCalendar,
|
|
3036
3051
|
{
|
|
3037
3052
|
selectedDate: draftEnd,
|
|
@@ -3042,7 +3057,7 @@ var DateRangeField = ({
|
|
|
3042
3057
|
},
|
|
3043
3058
|
onClose: () => setInlineCal(null)
|
|
3044
3059
|
}
|
|
3045
|
-
)), !inlineCal && /* @__PURE__ */
|
|
3060
|
+
)), !inlineCal && /* @__PURE__ */ React69.createElement("div", { className: "rf-dr-picker__days-section" }, /* @__PURE__ */ React69.createElement("div", { className: "rf-dr-picker__days-row" }, /* @__PURE__ */ React69.createElement("span", { className: "rf-dr-picker__days-label" }, "Days until today"), /* @__PURE__ */ React69.createElement(
|
|
3046
3061
|
"input",
|
|
3047
3062
|
{
|
|
3048
3063
|
type: "number",
|
|
@@ -3053,7 +3068,7 @@ var DateRangeField = ({
|
|
|
3053
3068
|
onMouseDown: (e) => e.stopPropagation(),
|
|
3054
3069
|
placeholder: "\u2014"
|
|
3055
3070
|
}
|
|
3056
|
-
)), /* @__PURE__ */
|
|
3071
|
+
)), /* @__PURE__ */ React69.createElement("div", { className: "rf-dr-picker__days-row" }, /* @__PURE__ */ React69.createElement("span", { className: "rf-dr-picker__days-label" }, "Days from today"), /* @__PURE__ */ React69.createElement(
|
|
3057
3072
|
"input",
|
|
3058
3073
|
{
|
|
3059
3074
|
type: "number",
|
|
@@ -3064,10 +3079,10 @@ var DateRangeField = ({
|
|
|
3064
3079
|
onMouseDown: (e) => e.stopPropagation(),
|
|
3065
3080
|
placeholder: "\u2014"
|
|
3066
3081
|
}
|
|
3067
|
-
))), /* @__PURE__ */
|
|
3082
|
+
))), /* @__PURE__ */ React69.createElement("div", { style: { flex: 1 } }), /* @__PURE__ */ React69.createElement("div", { className: "rf-dr-picker__footer" }, /* @__PURE__ */ React69.createElement("button", { type: "button", className: "rf-dr-picker__close-btn", onClick: handleClose }, "CLOSE"), /* @__PURE__ */ React69.createElement("button", { type: "button", className: "rf-dr-picker__apply-btn", onClick: handleApply }, "APPLY"))))
|
|
3068
3083
|
) : (
|
|
3069
3084
|
/* ── Calendar Mode ── */
|
|
3070
|
-
/* @__PURE__ */
|
|
3085
|
+
/* @__PURE__ */ React69.createElement("div", { className: "rf-dr-picker rf-dr-picker--calendar", onMouseDown: (e) => e.preventDefault() }, /* @__PURE__ */ React69.createElement("div", { className: "rf-dr-picker__calendars" }, /* @__PURE__ */ React69.createElement(
|
|
3071
3086
|
RangeCalendarBody,
|
|
3072
3087
|
{
|
|
3073
3088
|
viewYear: leftViewYear,
|
|
@@ -3082,7 +3097,7 @@ var DateRangeField = ({
|
|
|
3082
3097
|
onNext: nextMonth,
|
|
3083
3098
|
showNext: false
|
|
3084
3099
|
}
|
|
3085
|
-
), /* @__PURE__ */
|
|
3100
|
+
), /* @__PURE__ */ React69.createElement("div", { className: "rf-dr-picker__cal-col-divider" }), /* @__PURE__ */ React69.createElement(
|
|
3086
3101
|
RangeCalendarBody,
|
|
3087
3102
|
{
|
|
3088
3103
|
viewYear: rightViewYear,
|
|
@@ -3097,21 +3112,21 @@ var DateRangeField = ({
|
|
|
3097
3112
|
onNext: nextMonth,
|
|
3098
3113
|
showPrev: false
|
|
3099
3114
|
}
|
|
3100
|
-
)), selecting === "end" && draftStart && /* @__PURE__ */
|
|
3101
|
-
))), helperText && /* @__PURE__ */
|
|
3115
|
+
)), selecting === "end" && draftStart && /* @__PURE__ */ React69.createElement("div", { className: "rf-dr-picker__cal-hint" }, /* @__PURE__ */ React69.createElement("span", { className: "rf-dr-picker__cal-hint-dot" }), /* @__PURE__ */ React69.createElement("span", null, "Select end date \xB7 started from ", /* @__PURE__ */ React69.createElement("strong", null, formatShort(draftStart)))), /* @__PURE__ */ React69.createElement("div", { className: "rf-dr-picker__divider" }), /* @__PURE__ */ React69.createElement("div", { className: "rf-dr-picker__cal-footer" }, draftStart && draftEnd && /* @__PURE__ */ React69.createElement("span", { className: "rf-dr-picker__cal-range-label" }, formatShort(draftStart <= draftEnd ? draftStart : draftEnd), " \u2013 ", formatShort(draftStart <= draftEnd ? draftEnd : draftStart), /* @__PURE__ */ React69.createElement("span", { className: "rf-dr-picker__cal-range-days" }, " ", "(", Math.abs(daysBetween(draftStart, draftEnd)) + 1, " days)")), /* @__PURE__ */ React69.createElement("div", { style: { flex: 1 } }), /* @__PURE__ */ React69.createElement("button", { type: "button", className: "rf-dr-picker__close-btn", onClick: handleClose }, "CLOSE"), /* @__PURE__ */ React69.createElement("button", { type: "button", className: "rf-dr-picker__apply-btn", onClick: handleApply }, "APPLY")))
|
|
3116
|
+
))), helperText && /* @__PURE__ */ React69.createElement("div", { className: "rf-text-field__helper-text" }, helperText));
|
|
3102
3117
|
};
|
|
3103
3118
|
DateRangeField.displayName = "DateRangeField";
|
|
3104
3119
|
|
|
3105
3120
|
// lib/TextFields/Autocomplete.tsx
|
|
3106
|
-
import
|
|
3121
|
+
import React70, {
|
|
3107
3122
|
useState as useState7,
|
|
3108
3123
|
useRef as useRef6,
|
|
3109
3124
|
useEffect as useEffect6,
|
|
3110
3125
|
useCallback as useCallback2
|
|
3111
3126
|
} from "react";
|
|
3112
|
-
var ChevronDownIcon = () => /* @__PURE__ */
|
|
3113
|
-
var CloseSmIcon = ({ size = 16 }) => /* @__PURE__ */
|
|
3114
|
-
var CheckIcon = () => /* @__PURE__ */
|
|
3127
|
+
var ChevronDownIcon = () => /* @__PURE__ */ React70.createElement("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React70.createElement("polyline", { points: "6 9 12 15 18 9" }));
|
|
3128
|
+
var CloseSmIcon = ({ size = 16 }) => /* @__PURE__ */ React70.createElement("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round" }, /* @__PURE__ */ React70.createElement("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), /* @__PURE__ */ React70.createElement("line", { x1: "6", y1: "6", x2: "18", y2: "18" }));
|
|
3129
|
+
var CheckIcon = () => /* @__PURE__ */ React70.createElement("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React70.createElement("polyline", { points: "20 6 9 17 4 12" }));
|
|
3115
3130
|
function defaultGetLabel(option) {
|
|
3116
3131
|
if (option === null || option === void 0) return "";
|
|
3117
3132
|
if (typeof option === "string") return option;
|
|
@@ -3337,7 +3352,7 @@ function AutocompleteInner(props, _ref) {
|
|
|
3337
3352
|
className
|
|
3338
3353
|
].filter(Boolean).join(" ");
|
|
3339
3354
|
const inputPlaceholder = placeholder || (variant === "outlined" ? " " : void 0);
|
|
3340
|
-
return /* @__PURE__ */
|
|
3355
|
+
return /* @__PURE__ */ React70.createElement("div", { ref: containerRef, className: rootClasses, style }, /* @__PURE__ */ React70.createElement(
|
|
3341
3356
|
"div",
|
|
3342
3357
|
{
|
|
3343
3358
|
className: "rf-text-field__wrapper",
|
|
@@ -3348,7 +3363,7 @@ function AutocompleteInner(props, _ref) {
|
|
|
3348
3363
|
}
|
|
3349
3364
|
}
|
|
3350
3365
|
},
|
|
3351
|
-
multiple && visibleTags.map((opt, i) => /* @__PURE__ */
|
|
3366
|
+
multiple && visibleTags.map((opt, i) => /* @__PURE__ */ React70.createElement("span", { key: i, className: "rf-autocomplete__tag" }, /* @__PURE__ */ React70.createElement("span", { style: { overflow: "hidden", textOverflow: "ellipsis" } }, getOptionLabel(opt)), /* @__PURE__ */ React70.createElement(
|
|
3352
3367
|
"button",
|
|
3353
3368
|
{
|
|
3354
3369
|
type: "button",
|
|
@@ -3357,10 +3372,10 @@ function AutocompleteInner(props, _ref) {
|
|
|
3357
3372
|
onClick: (e) => removeTag(opt, e),
|
|
3358
3373
|
tabIndex: -1
|
|
3359
3374
|
},
|
|
3360
|
-
/* @__PURE__ */
|
|
3375
|
+
/* @__PURE__ */ React70.createElement(CloseSmIcon, { size: 12 })
|
|
3361
3376
|
))),
|
|
3362
|
-
hiddenCount > 0 && /* @__PURE__ */
|
|
3363
|
-
/* @__PURE__ */
|
|
3377
|
+
hiddenCount > 0 && /* @__PURE__ */ React70.createElement("span", { className: "rf-autocomplete__tag-more" }, "+", hiddenCount, " more"),
|
|
3378
|
+
/* @__PURE__ */ React70.createElement(
|
|
3364
3379
|
"input",
|
|
3365
3380
|
{
|
|
3366
3381
|
ref: inputRef,
|
|
@@ -3382,9 +3397,9 @@ function AutocompleteInner(props, _ref) {
|
|
|
3382
3397
|
"aria-autocomplete": "list"
|
|
3383
3398
|
}
|
|
3384
3399
|
),
|
|
3385
|
-
label && /* @__PURE__ */
|
|
3386
|
-
variant === "outlined" && /* @__PURE__ */
|
|
3387
|
-
/* @__PURE__ */
|
|
3400
|
+
label && /* @__PURE__ */ React70.createElement("label", { htmlFor: inputId, className: "rf-text-field__label" }, label, required && /* @__PURE__ */ React70.createElement("span", { className: "rf-text-field__asterisk" }, " *")),
|
|
3401
|
+
variant === "outlined" && /* @__PURE__ */ React70.createElement("fieldset", { className: "rf-text-field__notch" }, label ? /* @__PURE__ */ React70.createElement("legend", { className: "rf-text-field__legend" }, /* @__PURE__ */ React70.createElement("span", null, label, required ? " *" : "")) : /* @__PURE__ */ React70.createElement("legend", { className: "rf-text-field__legend--empty" })),
|
|
3402
|
+
/* @__PURE__ */ React70.createElement("div", { className: "rf-autocomplete__endgroup" }, hasClearable && /* @__PURE__ */ React70.createElement(
|
|
3388
3403
|
"button",
|
|
3389
3404
|
{
|
|
3390
3405
|
type: "button",
|
|
@@ -3394,8 +3409,8 @@ function AutocompleteInner(props, _ref) {
|
|
|
3394
3409
|
tabIndex: -1,
|
|
3395
3410
|
"aria-label": "Clear"
|
|
3396
3411
|
},
|
|
3397
|
-
/* @__PURE__ */
|
|
3398
|
-
), !freeSolo && /* @__PURE__ */
|
|
3412
|
+
/* @__PURE__ */ React70.createElement(CloseSmIcon, { size: 16 })
|
|
3413
|
+
), !freeSolo && /* @__PURE__ */ React70.createElement(
|
|
3399
3414
|
"button",
|
|
3400
3415
|
{
|
|
3401
3416
|
type: "button",
|
|
@@ -3407,9 +3422,9 @@ function AutocompleteInner(props, _ref) {
|
|
|
3407
3422
|
tabIndex: -1,
|
|
3408
3423
|
"aria-label": open ? "Close" : "Open"
|
|
3409
3424
|
},
|
|
3410
|
-
/* @__PURE__ */
|
|
3425
|
+
/* @__PURE__ */ React70.createElement(ChevronDownIcon, null)
|
|
3411
3426
|
))
|
|
3412
|
-
), helperText && /* @__PURE__ */
|
|
3427
|
+
), helperText && /* @__PURE__ */ React70.createElement("div", { className: `rf-text-field__helper-text${error ? " rf-text-field__helper-text--error" : ""}` }, helperText), open && !disabled && /* @__PURE__ */ React70.createElement("div", { className: "rf-autocomplete__popup", role: "presentation" }, loading ? /* @__PURE__ */ React70.createElement("div", { className: "rf-autocomplete__loading" }, /* @__PURE__ */ React70.createElement("span", { className: "rf-ac-spinner" }), loadingText) : flatEntries.length === 0 ? /* @__PURE__ */ React70.createElement("div", { className: "rf-autocomplete__no-options" }, noOptionsText) : /* @__PURE__ */ React70.createElement("ul", { ref: listRef, className: "rf-autocomplete__listbox", role: "listbox" }, groupBy ? (
|
|
3413
3428
|
// Grouped render
|
|
3414
3429
|
(() => {
|
|
3415
3430
|
const rendered = [];
|
|
@@ -3419,7 +3434,7 @@ function AutocompleteInner(props, _ref) {
|
|
|
3419
3434
|
if (entry.kind === "group") {
|
|
3420
3435
|
if (groupItems.length > 0) {
|
|
3421
3436
|
rendered.push(
|
|
3422
|
-
/* @__PURE__ */
|
|
3437
|
+
/* @__PURE__ */ React70.createElement("li", { key: `g-${currentGroup}`, role: "presentation" }, /* @__PURE__ */ React70.createElement("div", { className: "rf-autocomplete__group-header" }, currentGroup), /* @__PURE__ */ React70.createElement("ul", { className: "rf-autocomplete__group-items", role: "group" }, groupItems))
|
|
3423
3438
|
);
|
|
3424
3439
|
groupItems = [];
|
|
3425
3440
|
}
|
|
@@ -3430,7 +3445,7 @@ function AutocompleteInner(props, _ref) {
|
|
|
3430
3445
|
}
|
|
3431
3446
|
if (ei === flatEntries.length - 1 && groupItems.length > 0) {
|
|
3432
3447
|
rendered.push(
|
|
3433
|
-
/* @__PURE__ */
|
|
3448
|
+
/* @__PURE__ */ React70.createElement("li", { key: `g-${currentGroup}`, role: "presentation" }, /* @__PURE__ */ React70.createElement("div", { className: "rf-autocomplete__group-header" }, currentGroup), /* @__PURE__ */ React70.createElement("ul", { className: "rf-autocomplete__group-items", role: "group" }, groupItems))
|
|
3434
3449
|
);
|
|
3435
3450
|
}
|
|
3436
3451
|
});
|
|
@@ -3442,7 +3457,7 @@ function AutocompleteInner(props, _ref) {
|
|
|
3442
3457
|
const focused = focusedIdx === flatIdx;
|
|
3443
3458
|
const optDisabled = getOptionDisabled?.(option) ?? false;
|
|
3444
3459
|
const label2 = getOptionLabel(option);
|
|
3445
|
-
return /* @__PURE__ */
|
|
3460
|
+
return /* @__PURE__ */ React70.createElement(
|
|
3446
3461
|
"li",
|
|
3447
3462
|
{
|
|
3448
3463
|
key: label2 + flatIdx,
|
|
@@ -3461,22 +3476,22 @@ function AutocompleteInner(props, _ref) {
|
|
|
3461
3476
|
onMouseDown: (e) => e.preventDefault(),
|
|
3462
3477
|
onClick: () => selectOption(option)
|
|
3463
3478
|
},
|
|
3464
|
-
renderOption ? renderOption(option, { selected, focused, index: flatIdx }) : /* @__PURE__ */
|
|
3465
|
-
!renderOption && /* @__PURE__ */
|
|
3479
|
+
renderOption ? renderOption(option, { selected, focused, index: flatIdx }) : /* @__PURE__ */ React70.createElement("span", { style: { flex: 1, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" } }, label2),
|
|
3480
|
+
!renderOption && /* @__PURE__ */ React70.createElement("span", { className: "rf-autocomplete__option-check" }, /* @__PURE__ */ React70.createElement(CheckIcon, null))
|
|
3466
3481
|
);
|
|
3467
3482
|
}
|
|
3468
3483
|
}
|
|
3469
|
-
var Autocomplete =
|
|
3484
|
+
var Autocomplete = React70.forwardRef(AutocompleteInner);
|
|
3470
3485
|
Autocomplete.displayName = "Autocomplete";
|
|
3471
3486
|
|
|
3472
3487
|
// lib/Progress/RufousLogoLoader.tsx
|
|
3473
|
-
import * as
|
|
3488
|
+
import * as React71 from "react";
|
|
3474
3489
|
var _uid = 0;
|
|
3475
3490
|
var RufousLogoLoader = ({ size = 80, sx, className }) => {
|
|
3476
|
-
const clipId =
|
|
3491
|
+
const clipId = React71.useRef(`rll-${++_uid}`).current;
|
|
3477
3492
|
const height = size * (38.795 / 54.585);
|
|
3478
3493
|
const sxClass = useSx(sx);
|
|
3479
|
-
return /* @__PURE__ */
|
|
3494
|
+
return /* @__PURE__ */ React71.createElement("div", { className: ["rufous-logo-loader", sxClass, className].filter(Boolean).join(" "), style: { width: size, height } }, /* @__PURE__ */ React71.createElement(
|
|
3480
3495
|
"svg",
|
|
3481
3496
|
{
|
|
3482
3497
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3485,19 +3500,19 @@ var RufousLogoLoader = ({ size = 80, sx, className }) => {
|
|
|
3485
3500
|
height,
|
|
3486
3501
|
className: "rufous-logo-loader__svg"
|
|
3487
3502
|
},
|
|
3488
|
-
/* @__PURE__ */
|
|
3503
|
+
/* @__PURE__ */ React71.createElement("defs", null, /* @__PURE__ */ React71.createElement("clipPath", { id: clipId }, /* @__PURE__ */ React71.createElement(
|
|
3489
3504
|
"path",
|
|
3490
3505
|
{
|
|
3491
3506
|
transform: "translate(2208 18.205)",
|
|
3492
3507
|
d: "M.7,38.8a3.783,3.783,0,0,1-.5-.045l-.031,0A.26.26,0,0,1,0,38.564a.279.279,0,0,1,.14-.2c.222-.126.45-.251.671-.371l.047-.026c.357-.194.8-.435,1.209-.685.783-.479,1.565-.993,2.32-1.489l.033-.022.218-.143.49-.32c.575-.374,1.226-.8,1.824-1.241.98-.726,1.834-1.407,2.611-2.081a22.444,22.444,0,0,0,1.783-1.774A14.2,14.2,0,0,0,12.5,28.749l.012-.016a15.8,15.8,0,0,0,1.151-1.8,10.351,10.351,0,0,0,.586-1.511l0-.011.092-.278a4.425,4.425,0,0,0,.14-.583l.007-.036c.024-.119.048-.243.079-.363a4.639,4.639,0,0,0-.034-2.566c-.064-.212-.126-.43-.184-.636l-.008-.028c-.111-.391-.225-.8-.369-1.181a8.71,8.71,0,0,0-2.279-3.24,14.363,14.363,0,0,0-3.239-2.326c-.75-.4-1.553-.727-2.329-1.046L6.1,13.114l-.157-.065c-.294-.122-.6-.221-.9-.318l-.025-.008c-.19-.061-.427-.136-.649-.218-.108-.04-.265-.172-.252-.229a.7.7,0,0,1,.235-.4.915.915,0,0,1,.449-.112c.383-.029.77-.063,1.165-.1.969-.085,1.971-.174,2.962-.181h.119a13.145,13.145,0,0,1,2.907.315,11.888,11.888,0,0,1,3.128,1.123,10.286,10.286,0,0,1,2.3,1.554.92.92,0,0,1,.273.4,12.722,12.722,0,0,1,.458,3.3c-.009,1.494-.014,2.867-.014,4.2,0,.309.013.588.039.852a1.013,1.013,0,0,0,.078.26l0,.01c.027.067.051.129.077.207.029-.064.054-.116.076-.161l.009-.017.006-.012a.823.823,0,0,0,.076-.189c.051-.247.1-.494.164-.767.136-.618.276-1.257.359-1.9a24.362,24.362,0,0,0,0-6.777,13.01,13.01,0,0,0-.559-2.1c-.061-.185-.125-.382-.187-.579a9.42,9.42,0,0,0-.583-1.469c-.367-.727-.786-1.449-1.184-2.126a9.376,9.376,0,0,0-.643-.918c-.076-.1-.151-.2-.224-.3L15.548,6.3a8.128,8.128,0,0,0-.865-1.057,32.021,32.021,0,0,0-2.466-2.183,12.673,12.673,0,0,0-1.905-1.188c-.48-.256-1-.485-1.462-.687-.221-.1-.457-.2-.683-.306a.663.663,0,0,1-.11-.071L8.039.795c-.027-.02-.058-.043-.1-.069L8.062.667,8.108.644a1.786,1.786,0,0,1,.27-.12A11.679,11.679,0,0,1,11.866,0a13.332,13.332,0,0,1,1.769.121A13.927,13.927,0,0,1,15.9.693l.471.147a10.775,10.775,0,0,1,1.656.658,9.622,9.622,0,0,1,1.768,1.041,32.024,32.024,0,0,1,3.092,2.717,25.62,25.62,0,0,1,2.245,2.829l.084.117c.617.86,1.171,1.777,1.678,2.641.255.435.484.9.687,1.3.14.281.285.572.436.854.262.491.534.977.835,1.516l.005.01q.169.3.337.6c.064.116.13.232.2.347l.027.047c.12.212.244.431.357.651a8.518,8.518,0,0,0,2.121,2.695c.065.024.137.054.212.086l.013.006a1.268,1.268,0,0,0,.376.123.087.087,0,0,0,.063-.02.209.209,0,0,0,.083-.151c0-.083-.08-.153-.157-.22a.694.694,0,0,1-.135-.142c-.134-.216-.273-.436-.407-.649l-.063-.1c-.373-.587-.8-1.251-1.157-1.923s-.666-1.373-.964-2.057l0-.008q-.123-.284-.247-.564a1.707,1.707,0,0,1,.239-1.554l.026-.046.005-.009A12.918,12.918,0,0,1,31.408,9.3,7.814,7.814,0,0,1,33.75,7.612a5.391,5.391,0,0,1,2.218-.444,11.369,11.369,0,0,1,1.882.186,9.211,9.211,0,0,1,2.845,1.022c.138.071.261.135.373.188a4.155,4.155,0,0,0,1.849.464h.093c1.993-.052,4-.14,5.95-.224l.846-.036c.9-.038,1.808-.066,2.682-.093L52.7,8.67l1.007-.031h.041a1.787,1.787,0,0,1,.73.163c.1.051.109.256.109.318,0,.081-.147.169-.257.175-.466.028-.994.043-1.485.043a37.855,37.855,0,0,0-6.3.577A9.221,9.221,0,0,0,42.7,11.3a7.884,7.884,0,0,0-1.565,1.5c-.593.743-1.116,1.545-1.621,2.321l-.121.185c-.228.35-.435.709-.662,1.109l-.041.071c-.136.236-.276.481-.42.717l-.007.012c-.349.572-.709,1.162-1.1,1.716l-.216.307-.01.014a21.585,21.585,0,0,1-1.451,1.907c-1.317,1.485-2.538,2.8-3.734,4.006a30.822,30.822,0,0,1-2.5,2.207c-.548.446-1.139.86-1.71,1.26l-.01.007q-.254.177-.5.355c-.536.379-1.109.78-1.7,1.157-.545.35-1.143.71-1.828,1.1-.842.483-1.586.9-2.275,1.26-.271.144-.553.272-.868.412-.13.058-.3.135-.467.213a6.838,6.838,0,0,1-1.18.3,5.079,5.079,0,0,1,.647-.771l.008-.008c.132-.136.251-.26.365-.393l.048-.056c.566-.667,1.151-1.357,1.7-2.059s1.126-1.439,1.649-2.2c.4-.579.749-1.2,1.134-1.888l.016-.028c.406-.734.826-1.493,1.181-2.266.274-.6.733-1.787.866-2.189l.023-.07c.13-.389.215-.646-.013-.916a.369.369,0,0,1-.041.031l0,0c-.028.021-.055.041-.058.065a2.307,2.307,0,0,1-.146.5,5.257,5.257,0,0,1-.374.709c-.281.468-.536.959-.782,1.434-.2.385-.379.731-.57,1.069a20.042,20.042,0,0,1-1.161,1.871,30.689,30.689,0,0,1-1.985,2.531c-.74.821-1.567,1.648-2.6,2.6a21.448,21.448,0,0,1-2.1,1.669c-.85.606-1.754,1.2-2.688,1.768a17.867,17.867,0,0,1-1.993,1.037c-.994.445-2.066.891-3.185,1.324a12.127,12.127,0,0,1-1.714.514c-.955.213-1.969.413-3.1.611-1.023.18-2.054.328-2.927.449A1.41,1.41,0,0,1,.7,38.8ZM37.945,10.58l-.007,0a.583.583,0,0,0-.223.048.677.677,0,0,0-.437.555.637.637,0,0,0,.426.527.621.621,0,0,0,.209.046h.016a.72.72,0,0,0,.464-.194.676.676,0,0,0,.194-.282l0-.011,0-.005,0-.006,0-.009a.415.415,0,0,0,.014-.109.734.734,0,0,0-.657-.56Z"
|
|
3493
3508
|
}
|
|
3494
3509
|
))),
|
|
3495
|
-
/* @__PURE__ */
|
|
3510
|
+
/* @__PURE__ */ React71.createElement("g", { transform: "translate(-123.275 -24)" }, /* @__PURE__ */ React71.createElement("g", { transform: "translate(-2084.725 5.795)", clipPath: `url(#${clipId})` }, /* @__PURE__ */ React71.createElement("rect", { className: "rufous-ls rufous-ls-1", width: "40", height: "6", transform: "translate(2208 58) rotate(-90)", fill: "#d07f6f" }), /* @__PURE__ */ React71.createElement("rect", { className: "rufous-ls rufous-ls-2", width: "40", height: "6", transform: "translate(2214 58) rotate(-90)", fill: "#c66958" }), /* @__PURE__ */ React71.createElement("rect", { className: "rufous-ls rufous-ls-3", width: "40", height: "7", transform: "translate(2220 58) rotate(-90)", fill: "#bb5341" }), /* @__PURE__ */ React71.createElement("rect", { className: "rufous-ls rufous-ls-4", width: "40", height: "6", transform: "translate(2227 58) rotate(-90)", fill: "#b03a28" }), /* @__PURE__ */ React71.createElement("rect", { className: "rufous-ls rufous-ls-5", width: "40", height: "6", transform: "translate(2233 58) rotate(-90)", fill: "#a41b06" }), /* @__PURE__ */ React71.createElement("rect", { className: "rufous-ls rufous-ls-6", width: "40", height: "6", transform: "translate(2239 58) rotate(-90)", fill: "#8e1604" }), /* @__PURE__ */ React71.createElement("rect", { className: "rufous-ls rufous-ls-7", width: "40", height: "6", transform: "translate(2245 58) rotate(-90)", fill: "#791103" }), /* @__PURE__ */ React71.createElement("rect", { className: "rufous-ls rufous-ls-8", width: "40", height: "5", transform: "translate(2251 58) rotate(-90)", fill: "#640c02" }), /* @__PURE__ */ React71.createElement("rect", { className: "rufous-ls rufous-ls-9", width: "40", height: "7", transform: "translate(2256 58) rotate(-90)", fill: "#500801" })))
|
|
3496
3511
|
));
|
|
3497
3512
|
};
|
|
3498
3513
|
|
|
3499
3514
|
// lib/DataGrid/DataGrid.tsx
|
|
3500
|
-
import
|
|
3515
|
+
import React72, { useState as useState8, useMemo as useMemo2, useRef as useRef8, useEffect as useEffect7 } from "react";
|
|
3501
3516
|
import {
|
|
3502
3517
|
ChevronUp,
|
|
3503
3518
|
ChevronDown,
|
|
@@ -3866,7 +3881,7 @@ function DataGrid({
|
|
|
3866
3881
|
return offset;
|
|
3867
3882
|
};
|
|
3868
3883
|
const hasActiveFilters = advancedFilters.some((f) => f.value);
|
|
3869
|
-
return /* @__PURE__ */
|
|
3884
|
+
return /* @__PURE__ */ React72.createElement("div", { className: "dg-root" }, /* @__PURE__ */ React72.createElement("div", { className: "dg-header" }, /* @__PURE__ */ React72.createElement("div", { className: "dg-header-info" }, /* @__PURE__ */ React72.createElement("h2", null, title), /* @__PURE__ */ React72.createElement("p", null, filteredData.length, " total records")), /* @__PURE__ */ React72.createElement("div", { className: "dg-header-actions" }, /* @__PURE__ */ React72.createElement("div", { className: "dg-search-wrap" }, /* @__PURE__ */ React72.createElement(Search, { size: 15 }), /* @__PURE__ */ React72.createElement(
|
|
3870
3885
|
"input",
|
|
3871
3886
|
{
|
|
3872
3887
|
className: "dg-search",
|
|
@@ -3877,52 +3892,52 @@ function DataGrid({
|
|
|
3877
3892
|
setCurrentPage(1);
|
|
3878
3893
|
}
|
|
3879
3894
|
}
|
|
3880
|
-
)), /* @__PURE__ */
|
|
3895
|
+
)), /* @__PURE__ */ React72.createElement(
|
|
3881
3896
|
"button",
|
|
3882
3897
|
{
|
|
3883
3898
|
className: `dg-icon-btn ${hasActiveFilters ? "active" : ""}`,
|
|
3884
3899
|
onClick: () => setShowAdvancedFilter(true),
|
|
3885
3900
|
title: "Filters"
|
|
3886
3901
|
},
|
|
3887
|
-
/* @__PURE__ */
|
|
3888
|
-
), /* @__PURE__ */
|
|
3902
|
+
/* @__PURE__ */ React72.createElement(Filter, { size: 16 })
|
|
3903
|
+
), /* @__PURE__ */ React72.createElement(
|
|
3889
3904
|
"button",
|
|
3890
3905
|
{
|
|
3891
3906
|
className: "dg-icon-btn",
|
|
3892
3907
|
onClick: () => setShowManageColumns(true),
|
|
3893
3908
|
title: "Manage Columns"
|
|
3894
3909
|
},
|
|
3895
|
-
/* @__PURE__ */
|
|
3896
|
-
), /* @__PURE__ */
|
|
3910
|
+
/* @__PURE__ */ React72.createElement(Columns, { size: 16 })
|
|
3911
|
+
), /* @__PURE__ */ React72.createElement("button", { className: "dg-action-btn", onClick: handleExport }, /* @__PURE__ */ React72.createElement(Download, { size: 14 }), " Export CSV"))), /* @__PURE__ */ React72.createElement("div", { className: "dg-table-wrap" }, /* @__PURE__ */ React72.createElement("table", { className: "dg-table" }, /* @__PURE__ */ React72.createElement("thead", null, /* @__PURE__ */ React72.createElement("tr", null, visibleColumns.map((col, idx) => {
|
|
3897
3912
|
const colField = String(col.field);
|
|
3898
3913
|
const width = columnWidths[colField] || 200;
|
|
3899
3914
|
const leftOffset = getLeftOffset(col, idx);
|
|
3900
3915
|
const rightOffset = getRightOffset(col, idx);
|
|
3901
3916
|
const isSorted = sortField === col.field;
|
|
3902
|
-
return /* @__PURE__ */
|
|
3917
|
+
return /* @__PURE__ */ React72.createElement(
|
|
3903
3918
|
"th",
|
|
3904
3919
|
{
|
|
3905
3920
|
key: colField,
|
|
3906
3921
|
className: `dg-thead-cell${col.pinned === "left" ? " pinned-left" : col.pinned === "right" ? " pinned-right" : ""} ${col.headerClassName || ""}`,
|
|
3907
3922
|
style: { width, minWidth: width, left: leftOffset, right: rightOffset, flex: col.flex }
|
|
3908
3923
|
},
|
|
3909
|
-
/* @__PURE__ */
|
|
3924
|
+
/* @__PURE__ */ React72.createElement("div", { className: "dg-th-inner" }, /* @__PURE__ */ React72.createElement(
|
|
3910
3925
|
"div",
|
|
3911
3926
|
{
|
|
3912
3927
|
className: `dg-th-label${col.sortable === false ? " no-sort" : ""}`,
|
|
3913
3928
|
onClick: () => col.sortable !== false && handleSort(col.field || "")
|
|
3914
3929
|
},
|
|
3915
3930
|
col.headerName,
|
|
3916
|
-
isSorted && sortDirection === "asc" && /* @__PURE__ */
|
|
3917
|
-
isSorted && sortDirection === "desc" && /* @__PURE__ */
|
|
3918
|
-
), /* @__PURE__ */
|
|
3931
|
+
isSorted && sortDirection === "asc" && /* @__PURE__ */ React72.createElement(ChevronUp, { size: 12 }),
|
|
3932
|
+
isSorted && sortDirection === "desc" && /* @__PURE__ */ React72.createElement(ChevronDown, { size: 12 })
|
|
3933
|
+
), /* @__PURE__ */ React72.createElement("div", { className: "dg-th-actions" }, !col.disableColumnMenu && /* @__PURE__ */ React72.createElement(
|
|
3919
3934
|
"button",
|
|
3920
3935
|
{
|
|
3921
3936
|
className: "dg-th-menu-btn",
|
|
3922
3937
|
onClick: (e) => handleMenuOpen(e, colField)
|
|
3923
3938
|
},
|
|
3924
|
-
/* @__PURE__ */
|
|
3925
|
-
), /* @__PURE__ */
|
|
3939
|
+
/* @__PURE__ */ React72.createElement(MoreVertical, { size: 13 })
|
|
3940
|
+
), /* @__PURE__ */ React72.createElement(
|
|
3926
3941
|
"div",
|
|
3927
3942
|
{
|
|
3928
3943
|
className: `dg-resizer${resizingColumn === colField ? " resizing" : ""}`,
|
|
@@ -3935,12 +3950,12 @@ function DataGrid({
|
|
|
3935
3950
|
}
|
|
3936
3951
|
)))
|
|
3937
3952
|
);
|
|
3938
|
-
}), actions && /* @__PURE__ */
|
|
3953
|
+
}), actions && /* @__PURE__ */ React72.createElement("th", { style: { width: 0, padding: 0 } }))), /* @__PURE__ */ React72.createElement("tbody", null, paginatedData.length === 0 ? /* @__PURE__ */ React72.createElement("tr", null, /* @__PURE__ */ React72.createElement("td", { colSpan: visibleColumns.length + (actions ? 1 : 0), className: "dg-empty" }, "No records found")) : paginatedData.map((item) => /* @__PURE__ */ React72.createElement("tr", { key: item.id, className: "dg-tbody-row" }, visibleColumns.map((col, idx) => {
|
|
3939
3954
|
const colField = String(col.field);
|
|
3940
3955
|
const width = columnWidths[colField] || 200;
|
|
3941
3956
|
const leftOffset = getLeftOffset(col, idx);
|
|
3942
3957
|
const rightOffset = getRightOffset(col, idx);
|
|
3943
|
-
return /* @__PURE__ */
|
|
3958
|
+
return /* @__PURE__ */ React72.createElement(
|
|
3944
3959
|
"td",
|
|
3945
3960
|
{
|
|
3946
3961
|
key: `${item.id}-${colField}`,
|
|
@@ -3961,11 +3976,11 @@ function DataGrid({
|
|
|
3961
3976
|
return String(formattedValue ?? "");
|
|
3962
3977
|
})()
|
|
3963
3978
|
);
|
|
3964
|
-
}), actions && /* @__PURE__ */
|
|
3979
|
+
}), actions && /* @__PURE__ */ React72.createElement("td", { className: "dg-row-actions-cell" }, (() => {
|
|
3965
3980
|
const resolvedActions = typeof actions === "function" ? actions(item) : actions;
|
|
3966
3981
|
const visibleActions = resolvedActions.filter((a) => !a.show || a.show(item));
|
|
3967
3982
|
if (visibleActions.length === 0) return null;
|
|
3968
|
-
return /* @__PURE__ */
|
|
3983
|
+
return /* @__PURE__ */ React72.createElement("div", { className: "dg-row-actions" }, /* @__PURE__ */ React72.createElement("div", { className: "dg-action-group" }, visibleActions.map((action, i) => /* @__PURE__ */ React72.createElement(
|
|
3969
3984
|
"button",
|
|
3970
3985
|
{
|
|
3971
3986
|
key: i,
|
|
@@ -3976,7 +3991,7 @@ function DataGrid({
|
|
|
3976
3991
|
},
|
|
3977
3992
|
action.icon
|
|
3978
3993
|
))));
|
|
3979
|
-
})())))))), /* @__PURE__ */
|
|
3994
|
+
})())))))), /* @__PURE__ */ React72.createElement("div", { className: "dg-pagination" }, /* @__PURE__ */ React72.createElement("div", { className: "dg-page-info" }, /* @__PURE__ */ React72.createElement("div", { className: "dg-per-page" }, /* @__PURE__ */ React72.createElement("span", null, "Rows per page:"), /* @__PURE__ */ React72.createElement(
|
|
3980
3995
|
"select",
|
|
3981
3996
|
{
|
|
3982
3997
|
value: pageSize,
|
|
@@ -3985,8 +4000,8 @@ function DataGrid({
|
|
|
3985
4000
|
setCurrentPage(1);
|
|
3986
4001
|
}
|
|
3987
4002
|
},
|
|
3988
|
-
pageSizeOptions.map((o) => /* @__PURE__ */
|
|
3989
|
-
)), /* @__PURE__ */
|
|
4003
|
+
pageSizeOptions.map((o) => /* @__PURE__ */ React72.createElement("option", { key: o, value: o }, o))
|
|
4004
|
+
)), /* @__PURE__ */ React72.createElement("span", null, (currentPage - 1) * pageSize + 1, "\u2013", Math.min(currentPage * pageSize, filteredData.length), " of ", filteredData.length)), /* @__PURE__ */ React72.createElement("div", { className: "dg-page-nav" }, /* @__PURE__ */ React72.createElement("button", { className: "dg-page-btn", disabled: currentPage === 1, onClick: () => setCurrentPage((p) => p - 1) }, /* @__PURE__ */ React72.createElement(ChevronLeft, { size: 15 })), /* @__PURE__ */ React72.createElement("span", { className: "dg-page-fraction" }, currentPage, " / ", totalPages), /* @__PURE__ */ React72.createElement("button", { className: "dg-page-btn", disabled: currentPage === totalPages, onClick: () => setCurrentPage((p) => p + 1) }, /* @__PURE__ */ React72.createElement(ChevronRight, { size: 15 })))), activeMenu && /* @__PURE__ */ React72.createElement(
|
|
3990
4005
|
"div",
|
|
3991
4006
|
{
|
|
3992
4007
|
ref: menuRef,
|
|
@@ -3997,25 +4012,25 @@ function DataGrid({
|
|
|
3997
4012
|
...menuPosition.right !== void 0 ? { right: menuPosition.right } : {}
|
|
3998
4013
|
}
|
|
3999
4014
|
},
|
|
4000
|
-
/* @__PURE__ */
|
|
4001
|
-
/* @__PURE__ */
|
|
4002
|
-
/* @__PURE__ */
|
|
4015
|
+
/* @__PURE__ */ React72.createElement("button", { className: "dg-menu-item", onClick: () => handleSort(activeMenu, "asc") }, /* @__PURE__ */ React72.createElement(ArrowUp, { size: 14 }), " Sort ascending"),
|
|
4016
|
+
/* @__PURE__ */ React72.createElement("button", { className: "dg-menu-item", onClick: () => handleSort(activeMenu, "desc") }, /* @__PURE__ */ React72.createElement(ArrowDown, { size: 14 }), " Sort descending"),
|
|
4017
|
+
/* @__PURE__ */ React72.createElement("div", { className: "dg-menu-divider" }),
|
|
4003
4018
|
(() => {
|
|
4004
4019
|
const col = resolvedColumns.find((c) => c.field === activeMenu);
|
|
4005
4020
|
if (!col) return null;
|
|
4006
|
-
return /* @__PURE__ */
|
|
4021
|
+
return /* @__PURE__ */ React72.createElement(React72.Fragment, null, col.pinned === "left" ? /* @__PURE__ */ React72.createElement("button", { className: "dg-menu-item", onClick: () => togglePin(activeMenu, "left") }, /* @__PURE__ */ React72.createElement(Pin, { size: 14, style: { transform: "rotate(0deg)", opacity: 0.5 } }), " Unpin") : /* @__PURE__ */ React72.createElement("button", { className: "dg-menu-item", onClick: () => togglePin(activeMenu, "left") }, /* @__PURE__ */ React72.createElement(Pin, { size: 14, style: { transform: "rotate(45deg)" } }), " Pin left"), col.pinned === "right" ? /* @__PURE__ */ React72.createElement("button", { className: "dg-menu-item", onClick: () => togglePin(activeMenu, "right") }, /* @__PURE__ */ React72.createElement(Pin, { size: 14, style: { transform: "rotate(0deg)", opacity: 0.5 } }), " Unpin") : /* @__PURE__ */ React72.createElement("button", { className: "dg-menu-item", onClick: () => togglePin(activeMenu, "right") }, /* @__PURE__ */ React72.createElement(Pin, { size: 14, style: { transform: "rotate(-45deg)" } }), " Pin right"));
|
|
4007
4022
|
})(),
|
|
4008
|
-
/* @__PURE__ */
|
|
4009
|
-
/* @__PURE__ */
|
|
4023
|
+
/* @__PURE__ */ React72.createElement("div", { className: "dg-menu-divider" }),
|
|
4024
|
+
/* @__PURE__ */ React72.createElement("button", { className: "dg-menu-item", onClick: () => {
|
|
4010
4025
|
setShowAdvancedFilter(true);
|
|
4011
4026
|
setActiveMenu(null);
|
|
4012
|
-
} }, /* @__PURE__ */
|
|
4013
|
-
/* @__PURE__ */
|
|
4014
|
-
/* @__PURE__ */
|
|
4027
|
+
} }, /* @__PURE__ */ React72.createElement(Filter, { size: 14 }), " Filter\u2026"),
|
|
4028
|
+
/* @__PURE__ */ React72.createElement("button", { className: "dg-menu-item", onClick: () => toggleHide(activeMenu) }, /* @__PURE__ */ React72.createElement(EyeOff, { size: 14 }), " Hide column"),
|
|
4029
|
+
/* @__PURE__ */ React72.createElement("button", { className: "dg-menu-item", onClick: () => {
|
|
4015
4030
|
setShowManageColumns(true);
|
|
4016
4031
|
setActiveMenu(null);
|
|
4017
|
-
} }, /* @__PURE__ */
|
|
4018
|
-
), showManageColumns && /* @__PURE__ */
|
|
4032
|
+
} }, /* @__PURE__ */ React72.createElement(Columns, { size: 14 }), " Manage columns")
|
|
4033
|
+
), showManageColumns && /* @__PURE__ */ React72.createElement("div", { className: "dg-modal-overlay", onClick: () => setShowManageColumns(false) }, /* @__PURE__ */ React72.createElement("div", { className: "dg-modal", onClick: (e) => e.stopPropagation() }, /* @__PURE__ */ React72.createElement("div", { className: "dg-modal-header" }, /* @__PURE__ */ React72.createElement("h3", null, "Manage Columns"), /* @__PURE__ */ React72.createElement("button", { className: "dg-icon-btn", onClick: () => setShowManageColumns(false) }, /* @__PURE__ */ React72.createElement(X2, { size: 18 }))), /* @__PURE__ */ React72.createElement("div", { className: "dg-modal-body" }, /* @__PURE__ */ React72.createElement("div", { className: "dg-search-wrap", style: { marginBottom: 8 } }, /* @__PURE__ */ React72.createElement(Search, { size: 14 }), /* @__PURE__ */ React72.createElement(
|
|
4019
4034
|
"input",
|
|
4020
4035
|
{
|
|
4021
4036
|
className: "dg-search",
|
|
@@ -4027,15 +4042,15 @@ function DataGrid({
|
|
|
4027
4042
|
)), resolvedColumns.filter((c) => c.header.toLowerCase().includes(colSearch.toLowerCase())).map((col) => {
|
|
4028
4043
|
const key = String(col.key);
|
|
4029
4044
|
const isUnhideable = col.hideable === false;
|
|
4030
|
-
return /* @__PURE__ */
|
|
4031
|
-
})), /* @__PURE__ */
|
|
4045
|
+
return /* @__PURE__ */ React72.createElement("div", { key, className: `dg-col-row${isUnhideable ? " disabled" : ""}` }, /* @__PURE__ */ React72.createElement("div", { className: "dg-col-label" }, /* @__PURE__ */ React72.createElement("div", { className: "dg-col-dot", style: { background: col.hidden ? "var(--border-color)" : "var(--primary-color)" } }), col.header), !isUnhideable && /* @__PURE__ */ React72.createElement("button", { className: "dg-icon-btn", onClick: () => toggleHide(key) }, col.hidden ? /* @__PURE__ */ React72.createElement(EyeOff, { size: 14 }) : /* @__PURE__ */ React72.createElement(EyeOff, { size: 14, style: { opacity: 0.4 } })));
|
|
4046
|
+
})), /* @__PURE__ */ React72.createElement("div", { className: "dg-modal-footer" }, /* @__PURE__ */ React72.createElement("button", { className: "dg-action-btn", onClick: () => setColumnOverrides((prev) => {
|
|
4032
4047
|
const next = { ...prev };
|
|
4033
4048
|
resolvedColumns.forEach((c) => {
|
|
4034
4049
|
const k = String(c.key);
|
|
4035
4050
|
next[k] = { ...next[k], hidden: false };
|
|
4036
4051
|
});
|
|
4037
4052
|
return next;
|
|
4038
|
-
}) }, "Show All"), /* @__PURE__ */
|
|
4053
|
+
}) }, "Show All"), /* @__PURE__ */ React72.createElement("button", { className: "dg-action-btn", onClick: () => {
|
|
4039
4054
|
const newOverrides = { ...columnOverrides };
|
|
4040
4055
|
resolvedColumns.forEach((c) => {
|
|
4041
4056
|
if (c.hideable !== false) {
|
|
@@ -4044,21 +4059,21 @@ function DataGrid({
|
|
|
4044
4059
|
}
|
|
4045
4060
|
});
|
|
4046
4061
|
setColumnOverrides(newOverrides);
|
|
4047
|
-
} }, "Hide All")))), showAdvancedFilter && /* @__PURE__ */
|
|
4062
|
+
} }, "Hide All")))), showAdvancedFilter && /* @__PURE__ */ React72.createElement("div", { className: "dg-modal-overlay", onClick: () => setShowAdvancedFilter(false) }, /* @__PURE__ */ React72.createElement("div", { className: "dg-modal dg-modal-wide dg-filter-modal", onClick: (e) => e.stopPropagation() }, /* @__PURE__ */ React72.createElement("div", { className: "dg-modal-header" }, /* @__PURE__ */ React72.createElement("h3", null, "Filters"), /* @__PURE__ */ React72.createElement("button", { className: "dg-icon-btn", onClick: () => setShowAdvancedFilter(false) }, /* @__PURE__ */ React72.createElement(X2, { size: 18 }))), /* @__PURE__ */ React72.createElement("div", { className: "dg-modal-body" }, advancedFilters.map((f, idx) => /* @__PURE__ */ React72.createElement("div", { key: idx }, idx > 0 && /* @__PURE__ */ React72.createElement("div", { className: "dg-filter-logic" }, /* @__PURE__ */ React72.createElement(
|
|
4048
4063
|
"button",
|
|
4049
4064
|
{
|
|
4050
4065
|
className: `dg-logic-btn${f.logic === "AND" ? " active" : ""}`,
|
|
4051
4066
|
onClick: () => setAdvancedFilters((p) => p.map((fi, i) => i === idx ? { ...fi, logic: "AND" } : fi))
|
|
4052
4067
|
},
|
|
4053
4068
|
"AND"
|
|
4054
|
-
), /* @__PURE__ */
|
|
4069
|
+
), /* @__PURE__ */ React72.createElement(
|
|
4055
4070
|
"button",
|
|
4056
4071
|
{
|
|
4057
4072
|
className: `dg-logic-btn${f.logic === "OR" ? " active" : ""}`,
|
|
4058
4073
|
onClick: () => setAdvancedFilters((p) => p.map((fi, i) => i === idx ? { ...fi, logic: "OR" } : fi))
|
|
4059
4074
|
},
|
|
4060
4075
|
"OR"
|
|
4061
|
-
)), /* @__PURE__ */
|
|
4076
|
+
)), /* @__PURE__ */ React72.createElement("div", { className: "dg-filter-row" }, advancedFilters.length > 1 && /* @__PURE__ */ React72.createElement("button", { className: "dg-icon-btn", onClick: () => setAdvancedFilters((p) => p.filter((_, i) => i !== idx)) }, /* @__PURE__ */ React72.createElement(X2, { size: 14 })), /* @__PURE__ */ React72.createElement(
|
|
4062
4077
|
"select",
|
|
4063
4078
|
{
|
|
4064
4079
|
className: "dg-filter-select",
|
|
@@ -4070,20 +4085,20 @@ function DataGrid({
|
|
|
4070
4085
|
setAdvancedFilters((p) => p.map((fi, i) => i === idx ? { ...fi, column: newColKey, operator: defaultOp, value: "" } : fi));
|
|
4071
4086
|
}
|
|
4072
4087
|
},
|
|
4073
|
-
resolvedColumns.map((c) => /* @__PURE__ */
|
|
4088
|
+
resolvedColumns.map((c) => /* @__PURE__ */ React72.createElement("option", { key: String(c.key), value: String(c.key) }, c.header))
|
|
4074
4089
|
), (() => {
|
|
4075
4090
|
const col = resolvedColumns.find((c) => String(c.key) === f.column);
|
|
4076
4091
|
const operators = getOperatorsForType(col?.type);
|
|
4077
4092
|
const hideValue = f.operator === "is empty" || f.operator === "is not empty";
|
|
4078
|
-
return /* @__PURE__ */
|
|
4093
|
+
return /* @__PURE__ */ React72.createElement(React72.Fragment, null, /* @__PURE__ */ React72.createElement(
|
|
4079
4094
|
"select",
|
|
4080
4095
|
{
|
|
4081
4096
|
className: "dg-filter-select dg-filter-select-sm",
|
|
4082
4097
|
value: f.operator,
|
|
4083
4098
|
onChange: (e) => setAdvancedFilters((p) => p.map((fi, i) => i === idx ? { ...fi, operator: e.target.value, value: "" } : fi))
|
|
4084
4099
|
},
|
|
4085
|
-
operators.map((op) => /* @__PURE__ */
|
|
4086
|
-
), !hideValue && col?.type === "date" && /* @__PURE__ */
|
|
4100
|
+
operators.map((op) => /* @__PURE__ */ React72.createElement("option", { key: op.value, value: op.value }, op.label))
|
|
4101
|
+
), !hideValue && col?.type === "date" && /* @__PURE__ */ React72.createElement("div", { className: "dg-filter-datefield" }, /* @__PURE__ */ React72.createElement(
|
|
4087
4102
|
DateField,
|
|
4088
4103
|
{
|
|
4089
4104
|
value: f.value,
|
|
@@ -4092,17 +4107,17 @@ function DataGrid({
|
|
|
4092
4107
|
}
|
|
4093
4108
|
)), !hideValue && col?.type === "status" && (() => {
|
|
4094
4109
|
const options = col.statusOptions || [...new Set(data.map((item) => String(item[col.field || col.key || ""])))].filter((v) => v && v !== "undefined" && v !== "null").sort();
|
|
4095
|
-
return /* @__PURE__ */
|
|
4110
|
+
return /* @__PURE__ */ React72.createElement(
|
|
4096
4111
|
"select",
|
|
4097
4112
|
{
|
|
4098
4113
|
className: "dg-filter-select",
|
|
4099
4114
|
value: f.value,
|
|
4100
4115
|
onChange: (e) => setAdvancedFilters((p) => p.map((fi, i) => i === idx ? { ...fi, value: e.target.value } : fi))
|
|
4101
4116
|
},
|
|
4102
|
-
/* @__PURE__ */
|
|
4103
|
-
options.map((opt) => /* @__PURE__ */
|
|
4117
|
+
/* @__PURE__ */ React72.createElement("option", { value: "" }, "Select\u2026"),
|
|
4118
|
+
options.map((opt) => /* @__PURE__ */ React72.createElement("option", { key: opt, value: opt }, opt))
|
|
4104
4119
|
);
|
|
4105
|
-
})(), !hideValue && col?.type !== "date" && col?.type !== "status" && /* @__PURE__ */
|
|
4120
|
+
})(), !hideValue && col?.type !== "date" && col?.type !== "status" && /* @__PURE__ */ React72.createElement(
|
|
4106
4121
|
"input",
|
|
4107
4122
|
{
|
|
4108
4123
|
type: col?.type === "number" ? "number" : "text",
|
|
@@ -4112,7 +4127,7 @@ function DataGrid({
|
|
|
4112
4127
|
onChange: (e) => setAdvancedFilters((p) => p.map((fi, i) => i === idx ? { ...fi, value: e.target.value } : fi))
|
|
4113
4128
|
}
|
|
4114
4129
|
));
|
|
4115
|
-
})()))), /* @__PURE__ */
|
|
4130
|
+
})()))), /* @__PURE__ */ React72.createElement(
|
|
4116
4131
|
"button",
|
|
4117
4132
|
{
|
|
4118
4133
|
className: "dg-action-btn",
|
|
@@ -4123,9 +4138,9 @@ function DataGrid({
|
|
|
4123
4138
|
setAdvancedFilters((p) => [...p, { column: String(firstCol.key), operator: defaultOp, value: "", logic: "AND" }]);
|
|
4124
4139
|
}
|
|
4125
4140
|
},
|
|
4126
|
-
/* @__PURE__ */
|
|
4141
|
+
/* @__PURE__ */ React72.createElement(Plus, { size: 14 }),
|
|
4127
4142
|
" Add Filter"
|
|
4128
|
-
)), /* @__PURE__ */
|
|
4143
|
+
)), /* @__PURE__ */ React72.createElement("div", { className: "dg-modal-footer" }, /* @__PURE__ */ React72.createElement(
|
|
4129
4144
|
"button",
|
|
4130
4145
|
{
|
|
4131
4146
|
className: "dg-action-btn",
|
|
@@ -4134,13 +4149,13 @@ function DataGrid({
|
|
|
4134
4149
|
setAdvancedFilters([{ column: String(firstCol.key), operator: getDefaultOperator(firstCol?.type), value: "", logic: "AND" }]);
|
|
4135
4150
|
}
|
|
4136
4151
|
},
|
|
4137
|
-
/* @__PURE__ */
|
|
4152
|
+
/* @__PURE__ */ React72.createElement(Trash2, { size: 14 }),
|
|
4138
4153
|
" Reset"
|
|
4139
|
-
), /* @__PURE__ */
|
|
4154
|
+
), /* @__PURE__ */ React72.createElement("button", { className: "submit-btn", onClick: () => setShowAdvancedFilter(false) }, "Apply")))));
|
|
4140
4155
|
}
|
|
4141
4156
|
|
|
4142
4157
|
// lib/Editors/RichTextEditor.tsx
|
|
4143
|
-
import
|
|
4158
|
+
import React73, { useEffect as useEffect8, useRef as useRef9, useState as useState9 } from "react";
|
|
4144
4159
|
import JoditReact from "jodit-react";
|
|
4145
4160
|
var MOBILE_BREAKPOINT = 768;
|
|
4146
4161
|
var TODO_STATES = [
|
|
@@ -4449,7 +4464,7 @@ function RichTextEditor({
|
|
|
4449
4464
|
iconURL: showAll ? "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIj48Y2lyY2xlIGN4PSIxMiIgY3k9IjEyIiByPSIxMSIgc3Ryb2tlPSJibGFjayIgc3Ryb2tlLXdpZHRoPSIyIiBmaWxsPSJub25lIi8+PHBvbHlsaW5lIHBvaW50cz0iOCAxNCAxMiAxMCAxNiAxNCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSJibGFjayIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz48L3N2Zz4=" : "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIj48Y2lyY2xlIGN4PSIxMiIgY3k9IjEyIiByPSIxMSIgc3Ryb2tlPSJibGFjayIgc3Ryb2tlLXdpZHRoPSIyIiBmaWxsPSJub25lIi8+PHBvbHlsaW5lIHBvaW50cz0iOCAxMCAxMiAxNCAxNiAxMCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSJibGFjayIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz48L3N2Zz4=",
|
|
4450
4465
|
exec: () => setShowAll((prev) => !prev)
|
|
4451
4466
|
};
|
|
4452
|
-
const config =
|
|
4467
|
+
const config = React73.useMemo(() => {
|
|
4453
4468
|
let uploadConfig = {};
|
|
4454
4469
|
if (uploadUrl) {
|
|
4455
4470
|
const uploadData = {};
|
|
@@ -4565,14 +4580,14 @@ function RichTextEditor({
|
|
|
4565
4580
|
safePluginList: ["changecase", "rteKeyLogger"]
|
|
4566
4581
|
};
|
|
4567
4582
|
}, [isMobile, showAll, isListening, disabled, aiSupport, licenseKey, translationKey, token, uploadUrl, mentions?.arr?.length, height, width, allowResizeY, fullSize, placeholder]);
|
|
4568
|
-
return /* @__PURE__ */
|
|
4583
|
+
return /* @__PURE__ */ React73.createElement(
|
|
4569
4584
|
"div",
|
|
4570
4585
|
{
|
|
4571
4586
|
ref: containerRef,
|
|
4572
4587
|
className: `rte-wrapper ${isListening ? "rte-listening" : ""} ${className}`,
|
|
4573
4588
|
style
|
|
4574
4589
|
},
|
|
4575
|
-
/* @__PURE__ */
|
|
4590
|
+
/* @__PURE__ */ React73.createElement(
|
|
4576
4591
|
JoditReact,
|
|
4577
4592
|
{
|
|
4578
4593
|
ref: editorRef,
|
|
@@ -4583,7 +4598,7 @@ function RichTextEditor({
|
|
|
4583
4598
|
onBlur: (v) => onBlur?.(v)
|
|
4584
4599
|
}
|
|
4585
4600
|
),
|
|
4586
|
-
/* @__PURE__ */
|
|
4601
|
+
/* @__PURE__ */ React73.createElement(
|
|
4587
4602
|
"div",
|
|
4588
4603
|
{
|
|
4589
4604
|
className: "rte-speech-popup",
|
|
@@ -4595,26 +4610,26 @@ function RichTextEditor({
|
|
|
4595
4610
|
pointerEvents: "none"
|
|
4596
4611
|
}
|
|
4597
4612
|
},
|
|
4598
|
-
/* @__PURE__ */
|
|
4599
|
-
/* @__PURE__ */
|
|
4613
|
+
/* @__PURE__ */ React73.createElement("span", { className: "rte-speech-dot" }),
|
|
4614
|
+
/* @__PURE__ */ React73.createElement("span", null, speechText || "\u2026")
|
|
4600
4615
|
),
|
|
4601
|
-
error && /* @__PURE__ */
|
|
4616
|
+
error && /* @__PURE__ */ React73.createElement("p", { className: "rte-error" }, error)
|
|
4602
4617
|
);
|
|
4603
4618
|
}
|
|
4604
4619
|
|
|
4605
4620
|
// lib/Select/Select.tsx
|
|
4606
|
-
import
|
|
4621
|
+
import React74, {
|
|
4607
4622
|
useState as useState10,
|
|
4608
4623
|
useRef as useRef10,
|
|
4609
4624
|
useEffect as useEffect9,
|
|
4610
4625
|
useCallback as useCallback3
|
|
4611
4626
|
} from "react";
|
|
4612
|
-
var ChevronDownIcon2 = () => /* @__PURE__ */
|
|
4613
|
-
var CheckIcon2 = () => /* @__PURE__ */
|
|
4627
|
+
var ChevronDownIcon2 = () => /* @__PURE__ */ React74.createElement("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React74.createElement("polyline", { points: "6 9 12 15 18 9" }));
|
|
4628
|
+
var CheckIcon2 = () => /* @__PURE__ */ React74.createElement("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React74.createElement("polyline", { points: "20 6 9 17 4 12" }));
|
|
4614
4629
|
function normaliseOptions(options) {
|
|
4615
4630
|
return options.map((o) => typeof o === "string" ? { value: o, label: o } : o);
|
|
4616
4631
|
}
|
|
4617
|
-
var Select =
|
|
4632
|
+
var Select = React74.forwardRef(function Select2(props, ref) {
|
|
4618
4633
|
const {
|
|
4619
4634
|
options: rawOptions,
|
|
4620
4635
|
value,
|
|
@@ -4746,20 +4761,20 @@ var Select = React73.forwardRef(function Select2(props, ref) {
|
|
|
4746
4761
|
if (multiple) {
|
|
4747
4762
|
const labels = getSelectedLabels();
|
|
4748
4763
|
if (labels.length === 0) {
|
|
4749
|
-
return /* @__PURE__ */
|
|
4764
|
+
return /* @__PURE__ */ React74.createElement("div", { className: "rf-select__chips" }, placeholder && /* @__PURE__ */ React74.createElement("span", { className: "rf-select__display rf-select__display--placeholder" }, placeholder));
|
|
4750
4765
|
}
|
|
4751
4766
|
if (labels.length <= 2) {
|
|
4752
|
-
return /* @__PURE__ */
|
|
4767
|
+
return /* @__PURE__ */ React74.createElement("div", { className: "rf-select__chips" }, labels.map((l, i) => /* @__PURE__ */ React74.createElement("span", { key: i, className: "rf-select__chip" }, l)));
|
|
4753
4768
|
}
|
|
4754
|
-
return /* @__PURE__ */
|
|
4769
|
+
return /* @__PURE__ */ React74.createElement("div", { className: "rf-select__chips" }, labels.slice(0, 2).map((l, i) => /* @__PURE__ */ React74.createElement("span", { key: i, className: "rf-select__chip" }, l)), /* @__PURE__ */ React74.createElement("span", { className: "rf-select__count" }, "+", labels.length - 2));
|
|
4755
4770
|
}
|
|
4756
4771
|
const selectedOpt = options.find((o) => o.value === value);
|
|
4757
4772
|
if (selectedOpt) {
|
|
4758
|
-
return /* @__PURE__ */
|
|
4773
|
+
return /* @__PURE__ */ React74.createElement("div", { className: "rf-select__display" }, selectedOpt.label);
|
|
4759
4774
|
}
|
|
4760
|
-
return /* @__PURE__ */
|
|
4775
|
+
return /* @__PURE__ */ React74.createElement("div", { className: `rf-select__display${placeholder ? " rf-select__display--placeholder" : ""}` }, placeholder || "\xA0");
|
|
4761
4776
|
};
|
|
4762
|
-
return /* @__PURE__ */
|
|
4777
|
+
return /* @__PURE__ */ React74.createElement(
|
|
4763
4778
|
"div",
|
|
4764
4779
|
{
|
|
4765
4780
|
ref: (node) => {
|
|
@@ -4770,7 +4785,7 @@ var Select = React73.forwardRef(function Select2(props, ref) {
|
|
|
4770
4785
|
className: rootClasses,
|
|
4771
4786
|
style
|
|
4772
4787
|
},
|
|
4773
|
-
/* @__PURE__ */
|
|
4788
|
+
/* @__PURE__ */ React74.createElement(
|
|
4774
4789
|
"div",
|
|
4775
4790
|
{
|
|
4776
4791
|
className: "rf-text-field__wrapper",
|
|
@@ -4784,15 +4799,15 @@ var Select = React73.forwardRef(function Select2(props, ref) {
|
|
|
4784
4799
|
onKeyDown: handleKeyDown
|
|
4785
4800
|
},
|
|
4786
4801
|
renderDisplay(),
|
|
4787
|
-
label && /* @__PURE__ */
|
|
4788
|
-
variant === "outlined" && /* @__PURE__ */
|
|
4789
|
-
/* @__PURE__ */
|
|
4802
|
+
label && /* @__PURE__ */ React74.createElement("label", { id: inputId, className: "rf-text-field__label" }, label, required && /* @__PURE__ */ React74.createElement("span", { className: "rf-text-field__asterisk" }, " *")),
|
|
4803
|
+
variant === "outlined" && /* @__PURE__ */ React74.createElement("fieldset", { className: "rf-text-field__notch" }, label ? /* @__PURE__ */ React74.createElement("legend", { className: "rf-text-field__legend" }, /* @__PURE__ */ React74.createElement("span", null, label, required ? " *" : "")) : /* @__PURE__ */ React74.createElement("legend", { className: "rf-text-field__legend--empty" })),
|
|
4804
|
+
/* @__PURE__ */ React74.createElement("div", { className: "rf-select__arrow", "aria-hidden": "true" }, /* @__PURE__ */ React74.createElement(ChevronDownIcon2, null))
|
|
4790
4805
|
),
|
|
4791
|
-
helperText && /* @__PURE__ */
|
|
4792
|
-
open && !disabled && /* @__PURE__ */
|
|
4806
|
+
helperText && /* @__PURE__ */ React74.createElement("div", { className: `rf-text-field__helper-text${error ? " rf-text-field__helper-text--error" : ""}` }, helperText),
|
|
4807
|
+
open && !disabled && /* @__PURE__ */ React74.createElement("div", { className: "rf-select__popup", role: "presentation" }, /* @__PURE__ */ React74.createElement("ul", { ref: listRef, className: "rf-select__listbox", role: "listbox", "aria-multiselectable": multiple }, options.map((opt, idx) => {
|
|
4793
4808
|
const selected = isSelected(opt.value);
|
|
4794
4809
|
const focused = focusedIdx === idx;
|
|
4795
|
-
return /* @__PURE__ */
|
|
4810
|
+
return /* @__PURE__ */ React74.createElement(
|
|
4796
4811
|
"li",
|
|
4797
4812
|
{
|
|
4798
4813
|
key: opt.value,
|
|
@@ -4811,8 +4826,8 @@ var Select = React73.forwardRef(function Select2(props, ref) {
|
|
|
4811
4826
|
onMouseDown: (e) => e.preventDefault(),
|
|
4812
4827
|
onClick: () => selectOption(opt)
|
|
4813
4828
|
},
|
|
4814
|
-
/* @__PURE__ */
|
|
4815
|
-
/* @__PURE__ */
|
|
4829
|
+
/* @__PURE__ */ React74.createElement("span", { className: "rf-select__option-label" }, opt.label),
|
|
4830
|
+
/* @__PURE__ */ React74.createElement("span", { className: "rf-select__option-check", "aria-hidden": "true" }, /* @__PURE__ */ React74.createElement(CheckIcon2, null))
|
|
4816
4831
|
);
|
|
4817
4832
|
})))
|
|
4818
4833
|
);
|
|
@@ -4820,7 +4835,7 @@ var Select = React73.forwardRef(function Select2(props, ref) {
|
|
|
4820
4835
|
Select.displayName = "Select";
|
|
4821
4836
|
|
|
4822
4837
|
// lib/Slider/Slider.tsx
|
|
4823
|
-
import
|
|
4838
|
+
import React75, {
|
|
4824
4839
|
useState as useState11,
|
|
4825
4840
|
useRef as useRef11,
|
|
4826
4841
|
useEffect as useEffect10,
|
|
@@ -4835,7 +4850,7 @@ function snapToStep(val, min, step) {
|
|
|
4835
4850
|
function pct(val, min, max) {
|
|
4836
4851
|
return (val - min) / (max - min) * 100;
|
|
4837
4852
|
}
|
|
4838
|
-
var Slider =
|
|
4853
|
+
var Slider = React75.forwardRef(function Slider2(props, ref) {
|
|
4839
4854
|
const {
|
|
4840
4855
|
value,
|
|
4841
4856
|
onChange,
|
|
@@ -4975,7 +4990,7 @@ var Slider = React74.forwardRef(function Slider2(props, ref) {
|
|
|
4975
4990
|
const val = vals[thumb];
|
|
4976
4991
|
const p = pct(val, min, max);
|
|
4977
4992
|
const thumbStyle = orientation === "vertical" ? { bottom: `${p}%`, transform: "translate(-50%, 50%)" } : { left: `${p}%` };
|
|
4978
|
-
return /* @__PURE__ */
|
|
4993
|
+
return /* @__PURE__ */ React75.createElement(
|
|
4979
4994
|
"div",
|
|
4980
4995
|
{
|
|
4981
4996
|
key: thumb,
|
|
@@ -4991,30 +5006,30 @@ var Slider = React74.forwardRef(function Slider2(props, ref) {
|
|
|
4991
5006
|
onPointerDown: (e) => handleThumbPointerDown(e, thumb),
|
|
4992
5007
|
onKeyDown: (e) => handleThumbKeyDown(e, thumb)
|
|
4993
5008
|
},
|
|
4994
|
-
valueLabelDisplay !== "off" && /* @__PURE__ */
|
|
5009
|
+
valueLabelDisplay !== "off" && /* @__PURE__ */ React75.createElement("div", { className: "rf-slider__value-label", "aria-hidden": "true" }, val)
|
|
4995
5010
|
);
|
|
4996
5011
|
};
|
|
4997
|
-
return /* @__PURE__ */
|
|
5012
|
+
return /* @__PURE__ */ React75.createElement("div", { ref, className: rootClasses, style }, label && /* @__PURE__ */ React75.createElement("div", { className: "rf-slider__label" }, label), /* @__PURE__ */ React75.createElement(
|
|
4998
5013
|
"div",
|
|
4999
5014
|
{
|
|
5000
5015
|
ref: trackRef,
|
|
5001
5016
|
className: "rf-slider__track-container",
|
|
5002
5017
|
onPointerDown: handleTrackPointerDown
|
|
5003
5018
|
},
|
|
5004
|
-
/* @__PURE__ */
|
|
5005
|
-
/* @__PURE__ */
|
|
5019
|
+
/* @__PURE__ */ React75.createElement("div", { className: "rf-slider__rail", "aria-hidden": "true" }),
|
|
5020
|
+
/* @__PURE__ */ React75.createElement("div", { className: "rf-slider__track", style: trackStyle, "aria-hidden": "true" }),
|
|
5006
5021
|
computedMarks.map((mark) => {
|
|
5007
5022
|
const p = pct(mark.value, min, max);
|
|
5008
5023
|
const isActive = isRange ? mark.value >= vals[0] && mark.value <= vals[1] : mark.value <= vals[0];
|
|
5009
5024
|
const markStyle = orientation === "vertical" ? { bottom: `${p}%`, transform: "translate(-50%, 50%)" } : { left: `${p}%` };
|
|
5010
|
-
return /* @__PURE__ */
|
|
5025
|
+
return /* @__PURE__ */ React75.createElement(React75.Fragment, { key: mark.value }, /* @__PURE__ */ React75.createElement(
|
|
5011
5026
|
"div",
|
|
5012
5027
|
{
|
|
5013
5028
|
className: `rf-slider__mark${isActive ? " rf-slider__mark--active" : ""}`,
|
|
5014
5029
|
style: markStyle,
|
|
5015
5030
|
"aria-hidden": "true"
|
|
5016
5031
|
}
|
|
5017
|
-
), mark.label && orientation === "horizontal" && /* @__PURE__ */
|
|
5032
|
+
), mark.label && orientation === "horizontal" && /* @__PURE__ */ React75.createElement(
|
|
5018
5033
|
"div",
|
|
5019
5034
|
{
|
|
5020
5035
|
className: "rf-slider__mark-label",
|
|
@@ -5026,13 +5041,13 @@ var Slider = React74.forwardRef(function Slider2(props, ref) {
|
|
|
5026
5041
|
}),
|
|
5027
5042
|
renderThumb(0),
|
|
5028
5043
|
isRange && renderThumb(1)
|
|
5029
|
-
), hasLabelledMarks && orientation === "horizontal" && /* @__PURE__ */
|
|
5044
|
+
), hasLabelledMarks && orientation === "horizontal" && /* @__PURE__ */ React75.createElement("div", { className: "rf-slider__marks-labels", "aria-hidden": "true" }));
|
|
5030
5045
|
});
|
|
5031
5046
|
Slider.displayName = "Slider";
|
|
5032
5047
|
|
|
5033
5048
|
// lib/Switch/Switch.tsx
|
|
5034
|
-
import
|
|
5035
|
-
var Switch =
|
|
5049
|
+
import React76, { useRef as useRef12 } from "react";
|
|
5050
|
+
var Switch = React76.forwardRef(function Switch2(props, ref) {
|
|
5036
5051
|
const {
|
|
5037
5052
|
checked = false,
|
|
5038
5053
|
onChange,
|
|
@@ -5062,7 +5077,7 @@ var Switch = React75.forwardRef(function Switch2(props, ref) {
|
|
|
5062
5077
|
sxClass,
|
|
5063
5078
|
className
|
|
5064
5079
|
].filter(Boolean).join(" ");
|
|
5065
|
-
return /* @__PURE__ */
|
|
5080
|
+
return /* @__PURE__ */ React76.createElement(
|
|
5066
5081
|
"label",
|
|
5067
5082
|
{
|
|
5068
5083
|
ref,
|
|
@@ -5070,7 +5085,7 @@ var Switch = React75.forwardRef(function Switch2(props, ref) {
|
|
|
5070
5085
|
style,
|
|
5071
5086
|
htmlFor: inputId
|
|
5072
5087
|
},
|
|
5073
|
-
/* @__PURE__ */
|
|
5088
|
+
/* @__PURE__ */ React76.createElement(
|
|
5074
5089
|
"input",
|
|
5075
5090
|
{
|
|
5076
5091
|
ref: inputRef,
|
|
@@ -5085,16 +5100,16 @@ var Switch = React75.forwardRef(function Switch2(props, ref) {
|
|
|
5085
5100
|
"aria-checked": checked
|
|
5086
5101
|
}
|
|
5087
5102
|
),
|
|
5088
|
-
/* @__PURE__ */
|
|
5089
|
-
label && /* @__PURE__ */
|
|
5103
|
+
/* @__PURE__ */ React76.createElement("div", { className: "rf-switch__track", "aria-hidden": "true" }, /* @__PURE__ */ React76.createElement("div", { className: "rf-switch__thumb" })),
|
|
5104
|
+
label && /* @__PURE__ */ React76.createElement("span", { className: "rf-switch__label" }, label, required && /* @__PURE__ */ React76.createElement("span", { style: { color: "var(--tf-error-color, #d32f2f)" } }, " *"))
|
|
5090
5105
|
);
|
|
5091
5106
|
});
|
|
5092
5107
|
Switch.displayName = "Switch";
|
|
5093
5108
|
|
|
5094
5109
|
// lib/RadioGroup/RadioGroup.tsx
|
|
5095
|
-
import
|
|
5110
|
+
import React77, { useRef as useRef13, createContext as createContext2, useContext as useContext2 } from "react";
|
|
5096
5111
|
var RadioGroupContext = createContext2({});
|
|
5097
|
-
var Radio =
|
|
5112
|
+
var Radio = React77.forwardRef(function Radio2(props, ref) {
|
|
5098
5113
|
const ctx = useContext2(RadioGroupContext);
|
|
5099
5114
|
const {
|
|
5100
5115
|
value,
|
|
@@ -5125,7 +5140,7 @@ var Radio = React76.forwardRef(function Radio2(props, ref) {
|
|
|
5125
5140
|
isDisabled ? "rf-radio--disabled" : "",
|
|
5126
5141
|
sxClass
|
|
5127
5142
|
].filter(Boolean).join(" ");
|
|
5128
|
-
return /* @__PURE__ */
|
|
5143
|
+
return /* @__PURE__ */ React77.createElement("label", { ref, className: rootClasses, htmlFor: inputId }, /* @__PURE__ */ React77.createElement(
|
|
5129
5144
|
"input",
|
|
5130
5145
|
{
|
|
5131
5146
|
id: inputId,
|
|
@@ -5138,10 +5153,10 @@ var Radio = React76.forwardRef(function Radio2(props, ref) {
|
|
|
5138
5153
|
name,
|
|
5139
5154
|
"aria-checked": isChecked
|
|
5140
5155
|
}
|
|
5141
|
-
), /* @__PURE__ */
|
|
5156
|
+
), /* @__PURE__ */ React77.createElement("div", { className: "rf-radio__control", "aria-hidden": "true" }, /* @__PURE__ */ React77.createElement("div", { className: "rf-radio__ripple" }), /* @__PURE__ */ React77.createElement("div", { className: "rf-radio__outer" }, /* @__PURE__ */ React77.createElement("div", { className: "rf-radio__inner" }))), label && /* @__PURE__ */ React77.createElement("span", { className: "rf-radio__label" }, label));
|
|
5142
5157
|
});
|
|
5143
5158
|
Radio.displayName = "Radio";
|
|
5144
|
-
var RadioGroup =
|
|
5159
|
+
var RadioGroup = React77.forwardRef(function RadioGroup2(props, ref) {
|
|
5145
5160
|
const {
|
|
5146
5161
|
value,
|
|
5147
5162
|
onChange,
|
|
@@ -5165,7 +5180,7 @@ var RadioGroup = React76.forwardRef(function RadioGroup2(props, ref) {
|
|
|
5165
5180
|
sxClass,
|
|
5166
5181
|
className
|
|
5167
5182
|
].filter(Boolean).join(" ");
|
|
5168
|
-
return /* @__PURE__ */
|
|
5183
|
+
return /* @__PURE__ */ React77.createElement(RadioGroupContext.Provider, { value: { value, onChange, name: groupName, disabled, size } }, /* @__PURE__ */ React77.createElement(
|
|
5169
5184
|
"div",
|
|
5170
5185
|
{
|
|
5171
5186
|
ref,
|
|
@@ -5174,8 +5189,8 @@ var RadioGroup = React76.forwardRef(function RadioGroup2(props, ref) {
|
|
|
5174
5189
|
role: "radiogroup",
|
|
5175
5190
|
"aria-label": label
|
|
5176
5191
|
},
|
|
5177
|
-
label && /* @__PURE__ */
|
|
5178
|
-
options ? options.map((opt) => /* @__PURE__ */
|
|
5192
|
+
label && /* @__PURE__ */ React77.createElement("div", { className: "rf-radio-group__label" }, label),
|
|
5193
|
+
options ? options.map((opt) => /* @__PURE__ */ React77.createElement(
|
|
5179
5194
|
Radio,
|
|
5180
5195
|
{
|
|
5181
5196
|
key: opt.value,
|
|
@@ -5189,12 +5204,12 @@ var RadioGroup = React76.forwardRef(function RadioGroup2(props, ref) {
|
|
|
5189
5204
|
RadioGroup.displayName = "RadioGroup";
|
|
5190
5205
|
|
|
5191
5206
|
// lib/Rating/Rating.tsx
|
|
5192
|
-
import
|
|
5207
|
+
import React78, {
|
|
5193
5208
|
useState as useState12,
|
|
5194
5209
|
useRef as useRef14
|
|
5195
5210
|
} from "react";
|
|
5196
5211
|
var starSize = { small: 18, medium: 24, large: 32 };
|
|
5197
|
-
var FilledStarIcon = ({ size }) => /* @__PURE__ */
|
|
5212
|
+
var FilledStarIcon = ({ size }) => /* @__PURE__ */ React78.createElement(
|
|
5198
5213
|
"svg",
|
|
5199
5214
|
{
|
|
5200
5215
|
width: size,
|
|
@@ -5203,9 +5218,9 @@ var FilledStarIcon = ({ size }) => /* @__PURE__ */ React77.createElement(
|
|
|
5203
5218
|
fill: "currentColor",
|
|
5204
5219
|
"aria-hidden": "true"
|
|
5205
5220
|
},
|
|
5206
|
-
/* @__PURE__ */
|
|
5221
|
+
/* @__PURE__ */ React78.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" })
|
|
5207
5222
|
);
|
|
5208
|
-
var EmptyStarIcon = ({ size }) => /* @__PURE__ */
|
|
5223
|
+
var EmptyStarIcon = ({ size }) => /* @__PURE__ */ React78.createElement(
|
|
5209
5224
|
"svg",
|
|
5210
5225
|
{
|
|
5211
5226
|
width: size,
|
|
@@ -5216,9 +5231,9 @@ var EmptyStarIcon = ({ size }) => /* @__PURE__ */ React77.createElement(
|
|
|
5216
5231
|
strokeWidth: "1.6",
|
|
5217
5232
|
"aria-hidden": "true"
|
|
5218
5233
|
},
|
|
5219
|
-
/* @__PURE__ */
|
|
5234
|
+
/* @__PURE__ */ React78.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" })
|
|
5220
5235
|
);
|
|
5221
|
-
var Rating =
|
|
5236
|
+
var Rating = React78.forwardRef(function Rating2(props, ref) {
|
|
5222
5237
|
const {
|
|
5223
5238
|
value,
|
|
5224
5239
|
onChange,
|
|
@@ -5241,8 +5256,8 @@ var Rating = React77.forwardRef(function Rating2(props, ref) {
|
|
|
5241
5256
|
const currentValue = value ?? 0;
|
|
5242
5257
|
const displayValue = hoverValue !== null ? hoverValue : currentValue;
|
|
5243
5258
|
const iconSize = starSize[size] ?? 24;
|
|
5244
|
-
const renderedFilledIcon = icon ?? /* @__PURE__ */
|
|
5245
|
-
const renderedEmptyIcon = emptyIcon ?? /* @__PURE__ */
|
|
5259
|
+
const renderedFilledIcon = icon ?? /* @__PURE__ */ React78.createElement(FilledStarIcon, { size: iconSize });
|
|
5260
|
+
const renderedEmptyIcon = emptyIcon ?? /* @__PURE__ */ React78.createElement(EmptyStarIcon, { size: iconSize });
|
|
5246
5261
|
const isFilled = (pos) => {
|
|
5247
5262
|
if (highlightSelectedOnly) return displayValue === pos;
|
|
5248
5263
|
return displayValue >= pos - (precision < 1 ? 0.25 : 0);
|
|
@@ -5303,7 +5318,7 @@ var Rating = React77.forwardRef(function Rating2(props, ref) {
|
|
|
5303
5318
|
sxClass,
|
|
5304
5319
|
className
|
|
5305
5320
|
].filter(Boolean).join(" ");
|
|
5306
|
-
return /* @__PURE__ */
|
|
5321
|
+
return /* @__PURE__ */ React78.createElement("div", { ref, className: rootClasses, style }, label && /* @__PURE__ */ React78.createElement("div", { className: "rf-rating__label" }, label), /* @__PURE__ */ React78.createElement(
|
|
5307
5322
|
"div",
|
|
5308
5323
|
{
|
|
5309
5324
|
ref: starsRef,
|
|
@@ -5320,7 +5335,7 @@ var Rating = React77.forwardRef(function Rating2(props, ref) {
|
|
|
5320
5335
|
"rf-rating__item",
|
|
5321
5336
|
isHovered ? "rf-rating__item--hovered" : ""
|
|
5322
5337
|
].filter(Boolean).join(" ");
|
|
5323
|
-
return /* @__PURE__ */
|
|
5338
|
+
return /* @__PURE__ */ React78.createElement(
|
|
5324
5339
|
"button",
|
|
5325
5340
|
{
|
|
5326
5341
|
key: pos,
|
|
@@ -5335,15 +5350,15 @@ var Rating = React77.forwardRef(function Rating2(props, ref) {
|
|
|
5335
5350
|
},
|
|
5336
5351
|
halfFilled ? (
|
|
5337
5352
|
// Half-star: show half filled + half empty
|
|
5338
|
-
/* @__PURE__ */
|
|
5353
|
+
/* @__PURE__ */ React78.createElement("div", { className: "rf-rating__icon-container", style: { position: "relative" } }, /* @__PURE__ */ React78.createElement("span", { className: "rf-rating__icon--empty" }, renderedEmptyIcon), /* @__PURE__ */ React78.createElement(
|
|
5339
5354
|
"span",
|
|
5340
5355
|
{
|
|
5341
5356
|
className: "rf-rating__half-left",
|
|
5342
5357
|
style: { position: "absolute", inset: 0, width: "50%", overflow: "hidden" }
|
|
5343
5358
|
},
|
|
5344
|
-
/* @__PURE__ */
|
|
5359
|
+
/* @__PURE__ */ React78.createElement("span", { className: "rf-rating__icon--filled" }, renderedFilledIcon)
|
|
5345
5360
|
))
|
|
5346
|
-
) : /* @__PURE__ */
|
|
5361
|
+
) : /* @__PURE__ */ React78.createElement("div", { className: "rf-rating__icon-container" }, /* @__PURE__ */ React78.createElement("span", { className: filled ? "rf-rating__icon--filled" : "rf-rating__icon--empty" }, filled ? renderedFilledIcon : renderedEmptyIcon))
|
|
5347
5362
|
);
|
|
5348
5363
|
})
|
|
5349
5364
|
));
|
|
@@ -5351,12 +5366,12 @@ var Rating = React77.forwardRef(function Rating2(props, ref) {
|
|
|
5351
5366
|
Rating.displayName = "Rating";
|
|
5352
5367
|
|
|
5353
5368
|
// lib/ToggleButton/ToggleButton.tsx
|
|
5354
|
-
import
|
|
5369
|
+
import React79, {
|
|
5355
5370
|
createContext as createContext3,
|
|
5356
5371
|
useContext as useContext3
|
|
5357
5372
|
} from "react";
|
|
5358
5373
|
var ToggleGroupContext = createContext3({});
|
|
5359
|
-
var ToggleButton =
|
|
5374
|
+
var ToggleButton = React79.forwardRef(
|
|
5360
5375
|
function ToggleButton2(props, ref) {
|
|
5361
5376
|
const ctx = useContext3(ToggleGroupContext);
|
|
5362
5377
|
const { value, children, disabled: disabledProp, selected: selectedProp, sx } = props;
|
|
@@ -5389,7 +5404,7 @@ var ToggleButton = React78.forwardRef(
|
|
|
5389
5404
|
}
|
|
5390
5405
|
}
|
|
5391
5406
|
};
|
|
5392
|
-
const isIconOnly =
|
|
5407
|
+
const isIconOnly = React79.Children.count(children) === 1 && React79.isValidElement(children) && children.type === "svg";
|
|
5393
5408
|
const btnClasses = [
|
|
5394
5409
|
"rf-toggle-btn",
|
|
5395
5410
|
isSelected ? "rf-toggle-btn--selected" : "",
|
|
@@ -5397,7 +5412,7 @@ var ToggleButton = React78.forwardRef(
|
|
|
5397
5412
|
isIconOnly ? "rf-toggle-btn--icon-only" : "",
|
|
5398
5413
|
sxClass
|
|
5399
5414
|
].filter(Boolean).join(" ");
|
|
5400
|
-
return /* @__PURE__ */
|
|
5415
|
+
return /* @__PURE__ */ React79.createElement(
|
|
5401
5416
|
"button",
|
|
5402
5417
|
{
|
|
5403
5418
|
ref,
|
|
@@ -5412,7 +5427,7 @@ var ToggleButton = React78.forwardRef(
|
|
|
5412
5427
|
}
|
|
5413
5428
|
);
|
|
5414
5429
|
ToggleButton.displayName = "ToggleButton";
|
|
5415
|
-
var ToggleButtonGroup =
|
|
5430
|
+
var ToggleButtonGroup = React79.forwardRef(
|
|
5416
5431
|
function ToggleButtonGroup2(props, ref) {
|
|
5417
5432
|
const {
|
|
5418
5433
|
value,
|
|
@@ -5439,7 +5454,7 @@ var ToggleButtonGroup = React78.forwardRef(
|
|
|
5439
5454
|
sxClass,
|
|
5440
5455
|
className
|
|
5441
5456
|
].filter(Boolean).join(" ");
|
|
5442
|
-
return /* @__PURE__ */
|
|
5457
|
+
return /* @__PURE__ */ React79.createElement(ToggleGroupContext.Provider, { value: { value, onChange, exclusive, size, disabled, color } }, /* @__PURE__ */ React79.createElement(
|
|
5443
5458
|
"div",
|
|
5444
5459
|
{
|
|
5445
5460
|
ref,
|
|
@@ -5455,7 +5470,7 @@ var ToggleButtonGroup = React78.forwardRef(
|
|
|
5455
5470
|
ToggleButtonGroup.displayName = "ToggleButtonGroup";
|
|
5456
5471
|
|
|
5457
5472
|
// lib/Avatar/Avatar.tsx
|
|
5458
|
-
import
|
|
5473
|
+
import React80, { useState as useState13 } from "react";
|
|
5459
5474
|
var DEFAULT_PALETTE = [
|
|
5460
5475
|
"#a41b06",
|
|
5461
5476
|
"#8b1605",
|
|
@@ -5490,7 +5505,7 @@ function getInitials(alt) {
|
|
|
5490
5505
|
}
|
|
5491
5506
|
return words[0][0].toUpperCase();
|
|
5492
5507
|
}
|
|
5493
|
-
var Avatar =
|
|
5508
|
+
var Avatar = React80.forwardRef(
|
|
5494
5509
|
({
|
|
5495
5510
|
src,
|
|
5496
5511
|
alt,
|
|
@@ -5525,7 +5540,7 @@ var Avatar = React79.forwardRef(
|
|
|
5525
5540
|
inlineStyle.backgroundColor = bgColor;
|
|
5526
5541
|
inlineStyle.color = "#ffffff";
|
|
5527
5542
|
}
|
|
5528
|
-
return /* @__PURE__ */
|
|
5543
|
+
return /* @__PURE__ */ React80.createElement("div", { ref, className: classes, style: inlineStyle, "aria-label": alt, role: alt ? "img" : void 0, onClick, tabIndex: onClick ? 0 : void 0 }, showImage ? /* @__PURE__ */ React80.createElement(
|
|
5529
5544
|
"img",
|
|
5530
5545
|
{
|
|
5531
5546
|
src,
|
|
@@ -5534,7 +5549,7 @@ var Avatar = React79.forwardRef(
|
|
|
5534
5549
|
onError: () => setImgError(true),
|
|
5535
5550
|
...imgProps
|
|
5536
5551
|
}
|
|
5537
|
-
) : /* @__PURE__ */
|
|
5552
|
+
) : /* @__PURE__ */ React80.createElement("span", { className: "rf-avatar__initials" }, content));
|
|
5538
5553
|
}
|
|
5539
5554
|
);
|
|
5540
5555
|
Avatar.displayName = "Avatar";
|
|
@@ -5547,7 +5562,7 @@ var AvatarGroup = ({
|
|
|
5547
5562
|
sx
|
|
5548
5563
|
}) => {
|
|
5549
5564
|
const sxClass = useSx(sx);
|
|
5550
|
-
const childArray =
|
|
5565
|
+
const childArray = React80.Children.toArray(children);
|
|
5551
5566
|
const totalCount = childArray.length;
|
|
5552
5567
|
const overflowCount = totalCount > max ? totalCount - (max - 1) : 0;
|
|
5553
5568
|
const visibleChildren = overflowCount > 0 ? childArray.slice(0, max - 1) : childArray;
|
|
@@ -5561,7 +5576,7 @@ var AvatarGroup = ({
|
|
|
5561
5576
|
}
|
|
5562
5577
|
const classes = ["rf-avatar-group", spacingClass, sxClass, className].filter(Boolean).join(" ");
|
|
5563
5578
|
const avatarsToRender = [...visibleChildren].reverse();
|
|
5564
|
-
return /* @__PURE__ */
|
|
5579
|
+
return /* @__PURE__ */ React80.createElement("div", { className: classes, style, role: "group" }, overflowCount > 0 && /* @__PURE__ */ React80.createElement(
|
|
5565
5580
|
Avatar,
|
|
5566
5581
|
{
|
|
5567
5582
|
className: "rf-avatar-group__overflow",
|
|
@@ -5573,7 +5588,7 @@ var AvatarGroup = ({
|
|
|
5573
5588
|
), avatarsToRender.map((child, i) => {
|
|
5574
5589
|
if (typeof spacing === "number") {
|
|
5575
5590
|
const typedChild = child;
|
|
5576
|
-
return
|
|
5591
|
+
return React80.cloneElement(typedChild, {
|
|
5577
5592
|
key: i,
|
|
5578
5593
|
style: {
|
|
5579
5594
|
marginLeft: i < avatarsToRender.length - 1 ? -spacing : 0,
|
|
@@ -5587,7 +5602,7 @@ var AvatarGroup = ({
|
|
|
5587
5602
|
AvatarGroup.displayName = "AvatarGroup";
|
|
5588
5603
|
|
|
5589
5604
|
// lib/Chip/Chip.tsx
|
|
5590
|
-
import
|
|
5605
|
+
import React81 from "react";
|
|
5591
5606
|
var Chip = ({
|
|
5592
5607
|
label,
|
|
5593
5608
|
onDelete,
|
|
@@ -5625,7 +5640,7 @@ var Chip = ({
|
|
|
5625
5640
|
onDelete();
|
|
5626
5641
|
}
|
|
5627
5642
|
};
|
|
5628
|
-
return /* @__PURE__ */
|
|
5643
|
+
return /* @__PURE__ */ React81.createElement(
|
|
5629
5644
|
"div",
|
|
5630
5645
|
{
|
|
5631
5646
|
className: classes,
|
|
@@ -5636,10 +5651,10 @@ var Chip = ({
|
|
|
5636
5651
|
onKeyDown: !disabled ? handleKeyDown : void 0,
|
|
5637
5652
|
"aria-disabled": disabled || void 0
|
|
5638
5653
|
},
|
|
5639
|
-
avatar && /* @__PURE__ */
|
|
5640
|
-
!avatar && icon && /* @__PURE__ */
|
|
5641
|
-
/* @__PURE__ */
|
|
5642
|
-
onDelete && /* @__PURE__ */
|
|
5654
|
+
avatar && /* @__PURE__ */ React81.createElement("span", { className: "rf-chip__avatar" }, avatar),
|
|
5655
|
+
!avatar && icon && /* @__PURE__ */ React81.createElement("span", { className: "rf-chip__icon", "aria-hidden": "true" }, icon),
|
|
5656
|
+
/* @__PURE__ */ React81.createElement("span", { className: "rf-chip__label" }, label),
|
|
5657
|
+
onDelete && /* @__PURE__ */ React81.createElement(
|
|
5643
5658
|
"button",
|
|
5644
5659
|
{
|
|
5645
5660
|
className: "rf-chip__delete",
|
|
@@ -5660,7 +5675,7 @@ var Chip = ({
|
|
|
5660
5675
|
Chip.displayName = "Chip";
|
|
5661
5676
|
|
|
5662
5677
|
// lib/Divider/Divider.tsx
|
|
5663
|
-
import
|
|
5678
|
+
import React82 from "react";
|
|
5664
5679
|
var Divider = ({
|
|
5665
5680
|
orientation = "horizontal",
|
|
5666
5681
|
variant = "fullWidth",
|
|
@@ -5674,7 +5689,7 @@ var Divider = ({
|
|
|
5674
5689
|
sx
|
|
5675
5690
|
}) => {
|
|
5676
5691
|
const sxClass = useSx(sx);
|
|
5677
|
-
const hasChildren =
|
|
5692
|
+
const hasChildren = React82.Children.count(children) > 0;
|
|
5678
5693
|
const variantClass = variant === "inset" ? "rf-divider--inset" : variant === "middle" ? "rf-divider--middle" : "";
|
|
5679
5694
|
const classes = [
|
|
5680
5695
|
"rf-divider",
|
|
@@ -5690,7 +5705,7 @@ var Divider = ({
|
|
|
5690
5705
|
].filter(Boolean).join(" ");
|
|
5691
5706
|
const Tag = component || (hasChildren ? "div" : "hr");
|
|
5692
5707
|
if (!hasChildren) {
|
|
5693
|
-
return /* @__PURE__ */
|
|
5708
|
+
return /* @__PURE__ */ React82.createElement(
|
|
5694
5709
|
Tag,
|
|
5695
5710
|
{
|
|
5696
5711
|
className: classes,
|
|
@@ -5699,7 +5714,7 @@ var Divider = ({
|
|
|
5699
5714
|
}
|
|
5700
5715
|
);
|
|
5701
5716
|
}
|
|
5702
|
-
return /* @__PURE__ */
|
|
5717
|
+
return /* @__PURE__ */ React82.createElement(
|
|
5703
5718
|
Tag,
|
|
5704
5719
|
{
|
|
5705
5720
|
className: classes,
|
|
@@ -5707,13 +5722,13 @@ var Divider = ({
|
|
|
5707
5722
|
role: "separator",
|
|
5708
5723
|
"aria-orientation": orientation
|
|
5709
5724
|
},
|
|
5710
|
-
/* @__PURE__ */
|
|
5725
|
+
/* @__PURE__ */ React82.createElement("span", { className: "rf-divider__text" }, children)
|
|
5711
5726
|
);
|
|
5712
5727
|
};
|
|
5713
5728
|
Divider.displayName = "Divider";
|
|
5714
5729
|
|
|
5715
5730
|
// lib/List/List.tsx
|
|
5716
|
-
import
|
|
5731
|
+
import React83 from "react";
|
|
5717
5732
|
var List = ({
|
|
5718
5733
|
dense = false,
|
|
5719
5734
|
disablePadding = false,
|
|
@@ -5731,7 +5746,7 @@ var List = ({
|
|
|
5731
5746
|
sxClass,
|
|
5732
5747
|
className
|
|
5733
5748
|
].filter(Boolean).join(" ");
|
|
5734
|
-
return /* @__PURE__ */
|
|
5749
|
+
return /* @__PURE__ */ React83.createElement("ul", { className: classes, style }, subheader, children);
|
|
5735
5750
|
};
|
|
5736
5751
|
List.displayName = "List";
|
|
5737
5752
|
var ListItem = ({
|
|
@@ -5755,7 +5770,7 @@ var ListItem = ({
|
|
|
5755
5770
|
sxClass,
|
|
5756
5771
|
className
|
|
5757
5772
|
].filter(Boolean).join(" ");
|
|
5758
|
-
return /* @__PURE__ */
|
|
5773
|
+
return /* @__PURE__ */ React83.createElement("li", { className: classes, style }, /* @__PURE__ */ React83.createElement("div", { className: "rf-list-item__content" }, children), secondaryAction && /* @__PURE__ */ React83.createElement("div", { className: "rf-list-item__secondary-action" }, secondaryAction));
|
|
5759
5774
|
};
|
|
5760
5775
|
ListItem.displayName = "ListItem";
|
|
5761
5776
|
var ListItemText = ({
|
|
@@ -5772,12 +5787,12 @@ var ListItemText = ({
|
|
|
5772
5787
|
inset ? "rf-list-item-text--inset" : "",
|
|
5773
5788
|
sxClass
|
|
5774
5789
|
].filter(Boolean).join(" ");
|
|
5775
|
-
return /* @__PURE__ */
|
|
5790
|
+
return /* @__PURE__ */ React83.createElement("div", { className: classes }, /* @__PURE__ */ React83.createElement("p", { className: "rf-list-item-text__primary", ...primaryTypographyProps }, primary), secondary && /* @__PURE__ */ React83.createElement("p", { className: "rf-list-item-text__secondary", ...secondaryTypographyProps }, secondary));
|
|
5776
5791
|
};
|
|
5777
5792
|
ListItemText.displayName = "ListItemText";
|
|
5778
5793
|
var ListItemIcon = ({ children, sx }) => {
|
|
5779
5794
|
const sxClass = useSx(sx);
|
|
5780
|
-
return /* @__PURE__ */
|
|
5795
|
+
return /* @__PURE__ */ React83.createElement("div", { className: ["rf-list-item-icon", sxClass].filter(Boolean).join(" "), "aria-hidden": "true" }, children);
|
|
5781
5796
|
};
|
|
5782
5797
|
ListItemIcon.displayName = "ListItemIcon";
|
|
5783
5798
|
var ListItemButton = ({
|
|
@@ -5809,7 +5824,7 @@ var ListItemButton = ({
|
|
|
5809
5824
|
"aria-disabled": disabled || void 0
|
|
5810
5825
|
};
|
|
5811
5826
|
if (href) {
|
|
5812
|
-
return /* @__PURE__ */
|
|
5827
|
+
return /* @__PURE__ */ React83.createElement(
|
|
5813
5828
|
"a",
|
|
5814
5829
|
{
|
|
5815
5830
|
href,
|
|
@@ -5820,7 +5835,7 @@ var ListItemButton = ({
|
|
|
5820
5835
|
children
|
|
5821
5836
|
);
|
|
5822
5837
|
}
|
|
5823
|
-
return /* @__PURE__ */
|
|
5838
|
+
return /* @__PURE__ */ React83.createElement(
|
|
5824
5839
|
"button",
|
|
5825
5840
|
{
|
|
5826
5841
|
type: "button",
|
|
@@ -5849,12 +5864,12 @@ var ListSubheader = ({
|
|
|
5849
5864
|
color !== "default" ? `rf-list-subheader--color-${color}` : "",
|
|
5850
5865
|
sxClass
|
|
5851
5866
|
].filter(Boolean).join(" ");
|
|
5852
|
-
return /* @__PURE__ */
|
|
5867
|
+
return /* @__PURE__ */ React83.createElement("li", { className: classes, role: "presentation", "aria-label": typeof children === "string" ? children : void 0 }, children);
|
|
5853
5868
|
};
|
|
5854
5869
|
ListSubheader.displayName = "ListSubheader";
|
|
5855
5870
|
|
|
5856
5871
|
// lib/Typography/Typography.tsx
|
|
5857
|
-
import
|
|
5872
|
+
import React84 from "react";
|
|
5858
5873
|
var VARIANT_ELEMENT_MAP = {
|
|
5859
5874
|
h1: "h1",
|
|
5860
5875
|
h2: "h2",
|
|
@@ -5928,12 +5943,12 @@ var Typography = ({
|
|
|
5928
5943
|
...weightStyle,
|
|
5929
5944
|
...style
|
|
5930
5945
|
};
|
|
5931
|
-
return /* @__PURE__ */
|
|
5946
|
+
return /* @__PURE__ */ React84.createElement(Tag, { className: classes, style: Object.keys(inlineStyle).length > 0 ? inlineStyle : void 0 }, children);
|
|
5932
5947
|
};
|
|
5933
5948
|
Typography.displayName = "Typography";
|
|
5934
5949
|
|
|
5935
5950
|
// lib/Skeleton/Skeleton.tsx
|
|
5936
|
-
import
|
|
5951
|
+
import React85 from "react";
|
|
5937
5952
|
var Skeleton = ({
|
|
5938
5953
|
variant = "text",
|
|
5939
5954
|
width,
|
|
@@ -5969,7 +5984,7 @@ var Skeleton = ({
|
|
|
5969
5984
|
if (variant === "rounded" && !height) {
|
|
5970
5985
|
inlineStyle.height = 140;
|
|
5971
5986
|
}
|
|
5972
|
-
return /* @__PURE__ */
|
|
5987
|
+
return /* @__PURE__ */ React85.createElement(
|
|
5973
5988
|
"span",
|
|
5974
5989
|
{
|
|
5975
5990
|
className: classes,
|
|
@@ -5982,7 +5997,7 @@ var Skeleton = ({
|
|
|
5982
5997
|
Skeleton.displayName = "Skeleton";
|
|
5983
5998
|
|
|
5984
5999
|
// lib/Tooltip/Tooltip.tsx
|
|
5985
|
-
import
|
|
6000
|
+
import React86, {
|
|
5986
6001
|
useCallback as useCallback5,
|
|
5987
6002
|
useEffect as useEffect11,
|
|
5988
6003
|
useRef as useRef15,
|
|
@@ -6173,7 +6188,7 @@ var Tooltip = ({
|
|
|
6173
6188
|
sxClass,
|
|
6174
6189
|
className
|
|
6175
6190
|
].filter(Boolean).join(" ");
|
|
6176
|
-
const tooltipElement = /* @__PURE__ */
|
|
6191
|
+
const tooltipElement = /* @__PURE__ */ React86.createElement(
|
|
6177
6192
|
"div",
|
|
6178
6193
|
{
|
|
6179
6194
|
ref: tooltipRef,
|
|
@@ -6187,7 +6202,7 @@ var Tooltip = ({
|
|
|
6187
6202
|
"aria-hidden": !isOpen
|
|
6188
6203
|
},
|
|
6189
6204
|
title,
|
|
6190
|
-
arrow && /* @__PURE__ */
|
|
6205
|
+
arrow && /* @__PURE__ */ React86.createElement(
|
|
6191
6206
|
"span",
|
|
6192
6207
|
{
|
|
6193
6208
|
className: "rf-tooltip__arrow",
|
|
@@ -6198,7 +6213,7 @@ var Tooltip = ({
|
|
|
6198
6213
|
}
|
|
6199
6214
|
)
|
|
6200
6215
|
);
|
|
6201
|
-
return /* @__PURE__ */
|
|
6216
|
+
return /* @__PURE__ */ React86.createElement(React86.Fragment, null, /* @__PURE__ */ React86.createElement(
|
|
6202
6217
|
"span",
|
|
6203
6218
|
{
|
|
6204
6219
|
ref: anchorRef,
|
|
@@ -6206,14 +6221,14 @@ var Tooltip = ({
|
|
|
6206
6221
|
"aria-describedby": isOpen ? "rf-tooltip" : void 0,
|
|
6207
6222
|
...childProps
|
|
6208
6223
|
},
|
|
6209
|
-
|
|
6224
|
+
React86.cloneElement(children)
|
|
6210
6225
|
), ReactDOM.createPortal(tooltipElement, document.body));
|
|
6211
6226
|
};
|
|
6212
6227
|
Tooltip.displayName = "Tooltip";
|
|
6213
6228
|
|
|
6214
6229
|
// lib/Box/Box.tsx
|
|
6215
|
-
import * as
|
|
6216
|
-
var Box =
|
|
6230
|
+
import * as React87 from "react";
|
|
6231
|
+
var Box = React87.forwardRef(
|
|
6217
6232
|
({
|
|
6218
6233
|
component = "div",
|
|
6219
6234
|
children,
|
|
@@ -6246,14 +6261,14 @@ var Box = React86.forwardRef(
|
|
|
6246
6261
|
};
|
|
6247
6262
|
const classes = ["rf-box", sxClass, className].filter(Boolean).join(" ");
|
|
6248
6263
|
const Tag = component;
|
|
6249
|
-
return /* @__PURE__ */
|
|
6264
|
+
return /* @__PURE__ */ React87.createElement(Tag, { ref, className: classes, style: inlineStyle, ...rest }, children);
|
|
6250
6265
|
}
|
|
6251
6266
|
);
|
|
6252
6267
|
Box.displayName = "Box";
|
|
6253
6268
|
|
|
6254
6269
|
// lib/Stack/Stack.tsx
|
|
6255
|
-
import * as
|
|
6256
|
-
var Stack =
|
|
6270
|
+
import * as React88 from "react";
|
|
6271
|
+
var Stack = React88.forwardRef(
|
|
6257
6272
|
({
|
|
6258
6273
|
direction = "column",
|
|
6259
6274
|
spacing,
|
|
@@ -6282,14 +6297,14 @@ var Stack = React87.forwardRef(
|
|
|
6282
6297
|
const classes = ["rf-stack", sxClass, className].filter(Boolean).join(" ");
|
|
6283
6298
|
let content;
|
|
6284
6299
|
if (divider) {
|
|
6285
|
-
const childArray =
|
|
6300
|
+
const childArray = React88.Children.toArray(children).filter(
|
|
6286
6301
|
(child) => child !== null && child !== void 0
|
|
6287
6302
|
);
|
|
6288
6303
|
content = childArray.reduce((acc, child, idx) => {
|
|
6289
6304
|
acc.push(child);
|
|
6290
6305
|
if (idx < childArray.length - 1) {
|
|
6291
6306
|
acc.push(
|
|
6292
|
-
/* @__PURE__ */
|
|
6307
|
+
/* @__PURE__ */ React88.createElement("div", { key: `divider-${idx}`, className: "rf-stack-divider" }, divider)
|
|
6293
6308
|
);
|
|
6294
6309
|
}
|
|
6295
6310
|
return acc;
|
|
@@ -6298,13 +6313,13 @@ var Stack = React87.forwardRef(
|
|
|
6298
6313
|
content = children;
|
|
6299
6314
|
}
|
|
6300
6315
|
const Tag = component;
|
|
6301
|
-
return /* @__PURE__ */
|
|
6316
|
+
return /* @__PURE__ */ React88.createElement(Tag, { ref, className: classes, style: inlineStyle, ...rest }, content);
|
|
6302
6317
|
}
|
|
6303
6318
|
);
|
|
6304
6319
|
Stack.displayName = "Stack";
|
|
6305
6320
|
|
|
6306
6321
|
// lib/Grid/Grid.tsx
|
|
6307
|
-
import * as
|
|
6322
|
+
import * as React89 from "react";
|
|
6308
6323
|
function getBreakpointClass(bp, val) {
|
|
6309
6324
|
if (val === void 0) return "";
|
|
6310
6325
|
if (val === true) return `rf-grid-${bp}-12`;
|
|
@@ -6317,7 +6332,7 @@ function getSpacingGap(spacing) {
|
|
|
6317
6332
|
const base = spacing.xs ?? spacing.sm ?? spacing.md ?? 0;
|
|
6318
6333
|
return `${base * 8}px`;
|
|
6319
6334
|
}
|
|
6320
|
-
var Grid =
|
|
6335
|
+
var Grid = React89.forwardRef(
|
|
6321
6336
|
({
|
|
6322
6337
|
container = false,
|
|
6323
6338
|
item = false,
|
|
@@ -6367,14 +6382,14 @@ var Grid = React88.forwardRef(
|
|
|
6367
6382
|
className
|
|
6368
6383
|
].filter(Boolean).join(" ");
|
|
6369
6384
|
const Tag = component;
|
|
6370
|
-
return /* @__PURE__ */
|
|
6385
|
+
return /* @__PURE__ */ React89.createElement(Tag, { ref, className: classes, style: inlineStyle, ...rest }, children);
|
|
6371
6386
|
}
|
|
6372
6387
|
);
|
|
6373
6388
|
Grid.displayName = "Grid";
|
|
6374
6389
|
|
|
6375
6390
|
// lib/Paper/Paper.tsx
|
|
6376
|
-
import * as
|
|
6377
|
-
var Paper =
|
|
6391
|
+
import * as React90 from "react";
|
|
6392
|
+
var Paper = React90.forwardRef(
|
|
6378
6393
|
({
|
|
6379
6394
|
elevation = 1,
|
|
6380
6395
|
square = false,
|
|
@@ -6396,14 +6411,14 @@ var Paper = React89.forwardRef(
|
|
|
6396
6411
|
className
|
|
6397
6412
|
].filter(Boolean).join(" ");
|
|
6398
6413
|
const Tag = component;
|
|
6399
|
-
return /* @__PURE__ */
|
|
6414
|
+
return /* @__PURE__ */ React90.createElement(Tag, { ref, className: classes, style, ...rest }, children);
|
|
6400
6415
|
}
|
|
6401
6416
|
);
|
|
6402
6417
|
Paper.displayName = "Paper";
|
|
6403
6418
|
|
|
6404
6419
|
// lib/Card/Card.tsx
|
|
6405
|
-
import * as
|
|
6406
|
-
var Card =
|
|
6420
|
+
import * as React91 from "react";
|
|
6421
|
+
var Card = React91.forwardRef(
|
|
6407
6422
|
({
|
|
6408
6423
|
elevation = 1,
|
|
6409
6424
|
variant = "elevation",
|
|
@@ -6422,33 +6437,33 @@ var Card = React90.forwardRef(
|
|
|
6422
6437
|
sxClass,
|
|
6423
6438
|
className
|
|
6424
6439
|
].filter(Boolean).join(" ");
|
|
6425
|
-
return /* @__PURE__ */
|
|
6440
|
+
return /* @__PURE__ */ React91.createElement("div", { ref, className: classes, style, ...rest }, children);
|
|
6426
6441
|
}
|
|
6427
6442
|
);
|
|
6428
6443
|
Card.displayName = "Card";
|
|
6429
|
-
var CardContent =
|
|
6444
|
+
var CardContent = React91.forwardRef(
|
|
6430
6445
|
({ children, className, style, sx, ...rest }, ref) => {
|
|
6431
6446
|
const sxClass = useSx(sx);
|
|
6432
6447
|
const classes = ["rf-card-content", sxClass, className].filter(Boolean).join(" ");
|
|
6433
|
-
return /* @__PURE__ */
|
|
6448
|
+
return /* @__PURE__ */ React91.createElement("div", { ref, className: classes, style, ...rest }, children);
|
|
6434
6449
|
}
|
|
6435
6450
|
);
|
|
6436
6451
|
CardContent.displayName = "CardContent";
|
|
6437
|
-
var CardHeader =
|
|
6452
|
+
var CardHeader = React91.forwardRef(
|
|
6438
6453
|
({ title, subheader, avatar, action, className, style, sx, ...rest }, ref) => {
|
|
6439
6454
|
const sxClass = useSx(sx);
|
|
6440
6455
|
const classes = ["rf-card-header", sxClass, className].filter(Boolean).join(" ");
|
|
6441
|
-
return /* @__PURE__ */
|
|
6456
|
+
return /* @__PURE__ */ React91.createElement("div", { ref, className: classes, style, ...rest }, avatar && /* @__PURE__ */ React91.createElement("div", { className: "rf-card-header-avatar" }, avatar), /* @__PURE__ */ React91.createElement("div", { className: "rf-card-header-content" }, /* @__PURE__ */ React91.createElement("div", { className: "rf-card-header-title" }, title), subheader && /* @__PURE__ */ React91.createElement("div", { className: "rf-card-header-subheader" }, subheader)), action && /* @__PURE__ */ React91.createElement("div", { className: "rf-card-header-action" }, action));
|
|
6442
6457
|
}
|
|
6443
6458
|
);
|
|
6444
6459
|
CardHeader.displayName = "CardHeader";
|
|
6445
|
-
var CardMedia =
|
|
6460
|
+
var CardMedia = React91.forwardRef(
|
|
6446
6461
|
({ component = "div", image, src, height, alt, className, style, sx, ...rest }, ref) => {
|
|
6447
6462
|
const sxClass = useSx(sx);
|
|
6448
6463
|
const classes = ["rf-card-media", sxClass, className].filter(Boolean).join(" ");
|
|
6449
6464
|
const computedHeight = height !== void 0 ? typeof height === "number" ? `${height}px` : height : "200px";
|
|
6450
6465
|
if (component === "img") {
|
|
6451
|
-
return /* @__PURE__ */
|
|
6466
|
+
return /* @__PURE__ */ React91.createElement(
|
|
6452
6467
|
"img",
|
|
6453
6468
|
{
|
|
6454
6469
|
ref,
|
|
@@ -6461,7 +6476,7 @@ var CardMedia = React90.forwardRef(
|
|
|
6461
6476
|
);
|
|
6462
6477
|
}
|
|
6463
6478
|
if (component === "video") {
|
|
6464
|
-
return /* @__PURE__ */
|
|
6479
|
+
return /* @__PURE__ */ React91.createElement(
|
|
6465
6480
|
"video",
|
|
6466
6481
|
{
|
|
6467
6482
|
ref,
|
|
@@ -6477,7 +6492,7 @@ var CardMedia = React90.forwardRef(
|
|
|
6477
6492
|
...image ? { backgroundImage: `url(${image})` } : {},
|
|
6478
6493
|
...style
|
|
6479
6494
|
};
|
|
6480
|
-
return /* @__PURE__ */
|
|
6495
|
+
return /* @__PURE__ */ React91.createElement(
|
|
6481
6496
|
"div",
|
|
6482
6497
|
{
|
|
6483
6498
|
ref,
|
|
@@ -6489,7 +6504,7 @@ var CardMedia = React90.forwardRef(
|
|
|
6489
6504
|
}
|
|
6490
6505
|
);
|
|
6491
6506
|
CardMedia.displayName = "CardMedia";
|
|
6492
|
-
var CardActions =
|
|
6507
|
+
var CardActions = React91.forwardRef(
|
|
6493
6508
|
({ disableSpacing = false, children, className, style, sx, ...rest }, ref) => {
|
|
6494
6509
|
const sxClass = useSx(sx);
|
|
6495
6510
|
const classes = [
|
|
@@ -6498,13 +6513,13 @@ var CardActions = React90.forwardRef(
|
|
|
6498
6513
|
sxClass,
|
|
6499
6514
|
className
|
|
6500
6515
|
].filter(Boolean).join(" ");
|
|
6501
|
-
return /* @__PURE__ */
|
|
6516
|
+
return /* @__PURE__ */ React91.createElement("div", { ref, className: classes, style, ...rest }, children);
|
|
6502
6517
|
}
|
|
6503
6518
|
);
|
|
6504
6519
|
CardActions.displayName = "CardActions";
|
|
6505
6520
|
|
|
6506
6521
|
// lib/Accordion/Accordion.tsx
|
|
6507
|
-
import * as
|
|
6522
|
+
import * as React92 from "react";
|
|
6508
6523
|
import { useState as useState15, useContext as useContext4, createContext as createContext4 } from "react";
|
|
6509
6524
|
var AccordionContext = createContext4({
|
|
6510
6525
|
expanded: false,
|
|
@@ -6512,7 +6527,7 @@ var AccordionContext = createContext4({
|
|
|
6512
6527
|
toggle: () => {
|
|
6513
6528
|
}
|
|
6514
6529
|
});
|
|
6515
|
-
var Accordion =
|
|
6530
|
+
var Accordion = React92.forwardRef(
|
|
6516
6531
|
({
|
|
6517
6532
|
expanded: expandedProp,
|
|
6518
6533
|
defaultExpanded = false,
|
|
@@ -6547,11 +6562,11 @@ var Accordion = React91.forwardRef(
|
|
|
6547
6562
|
sxClass,
|
|
6548
6563
|
className
|
|
6549
6564
|
].filter(Boolean).join(" ");
|
|
6550
|
-
return /* @__PURE__ */
|
|
6565
|
+
return /* @__PURE__ */ React92.createElement(AccordionContext.Provider, { value: { expanded, disabled, toggle } }, /* @__PURE__ */ React92.createElement("div", { ref, className: classes, style, ...rest }, children));
|
|
6551
6566
|
}
|
|
6552
6567
|
);
|
|
6553
6568
|
Accordion.displayName = "Accordion";
|
|
6554
|
-
var ChevronIcon = () => /* @__PURE__ */
|
|
6569
|
+
var ChevronIcon = () => /* @__PURE__ */ React92.createElement(
|
|
6555
6570
|
"svg",
|
|
6556
6571
|
{
|
|
6557
6572
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -6565,9 +6580,9 @@ var ChevronIcon = () => /* @__PURE__ */ React91.createElement(
|
|
|
6565
6580
|
strokeLinejoin: "round",
|
|
6566
6581
|
"aria-hidden": "true"
|
|
6567
6582
|
},
|
|
6568
|
-
/* @__PURE__ */
|
|
6583
|
+
/* @__PURE__ */ React92.createElement("polyline", { points: "6 9 12 15 18 9" })
|
|
6569
6584
|
);
|
|
6570
|
-
var AccordionSummary =
|
|
6585
|
+
var AccordionSummary = React92.forwardRef(
|
|
6571
6586
|
({ expandIcon, children, sx, className, style, ...rest }, ref) => {
|
|
6572
6587
|
const sxClass = useSx(sx);
|
|
6573
6588
|
const { expanded, toggle, disabled } = useContext4(AccordionContext);
|
|
@@ -6581,7 +6596,7 @@ var AccordionSummary = React91.forwardRef(
|
|
|
6581
6596
|
"rf-accordion-summary-icon",
|
|
6582
6597
|
expanded ? "rf-accordion-icon-expanded" : ""
|
|
6583
6598
|
].filter(Boolean).join(" ");
|
|
6584
|
-
return /* @__PURE__ */
|
|
6599
|
+
return /* @__PURE__ */ React92.createElement(
|
|
6585
6600
|
"button",
|
|
6586
6601
|
{
|
|
6587
6602
|
ref,
|
|
@@ -6593,13 +6608,13 @@ var AccordionSummary = React91.forwardRef(
|
|
|
6593
6608
|
"aria-expanded": expanded,
|
|
6594
6609
|
...rest
|
|
6595
6610
|
},
|
|
6596
|
-
/* @__PURE__ */
|
|
6597
|
-
/* @__PURE__ */
|
|
6611
|
+
/* @__PURE__ */ React92.createElement("span", { className: "rf-accordion-summary-content" }, children),
|
|
6612
|
+
/* @__PURE__ */ React92.createElement("span", { className: iconClasses }, expandIcon !== void 0 ? expandIcon : /* @__PURE__ */ React92.createElement(ChevronIcon, null))
|
|
6598
6613
|
);
|
|
6599
6614
|
}
|
|
6600
6615
|
);
|
|
6601
6616
|
AccordionSummary.displayName = "AccordionSummary";
|
|
6602
|
-
var AccordionDetails =
|
|
6617
|
+
var AccordionDetails = React92.forwardRef(
|
|
6603
6618
|
({ children, sx, className, style, ...rest }, ref) => {
|
|
6604
6619
|
const sxClass = useSx(sx);
|
|
6605
6620
|
const { expanded } = useContext4(AccordionContext);
|
|
@@ -6612,13 +6627,13 @@ var AccordionDetails = React91.forwardRef(
|
|
|
6612
6627
|
sxClass,
|
|
6613
6628
|
className
|
|
6614
6629
|
].filter(Boolean).join(" ");
|
|
6615
|
-
return /* @__PURE__ */
|
|
6630
|
+
return /* @__PURE__ */ React92.createElement("div", { className: wrapperClasses }, /* @__PURE__ */ React92.createElement("div", { className: "rf-accordion-details-inner" }, /* @__PURE__ */ React92.createElement("div", { ref, className: detailsClasses, style, ...rest }, children)));
|
|
6616
6631
|
}
|
|
6617
6632
|
);
|
|
6618
6633
|
AccordionDetails.displayName = "AccordionDetails";
|
|
6619
6634
|
|
|
6620
6635
|
// lib/Tabs/Tabs.tsx
|
|
6621
|
-
import
|
|
6636
|
+
import React93, {
|
|
6622
6637
|
useEffect as useEffect12,
|
|
6623
6638
|
useLayoutEffect,
|
|
6624
6639
|
useRef as useRef16,
|
|
@@ -6653,7 +6668,7 @@ var Tab = ({
|
|
|
6653
6668
|
_onClick(value);
|
|
6654
6669
|
}
|
|
6655
6670
|
};
|
|
6656
|
-
return /* @__PURE__ */
|
|
6671
|
+
return /* @__PURE__ */ React93.createElement(
|
|
6657
6672
|
"button",
|
|
6658
6673
|
{
|
|
6659
6674
|
ref: _tabRef,
|
|
@@ -6665,9 +6680,9 @@ var Tab = ({
|
|
|
6665
6680
|
"aria-disabled": disabled,
|
|
6666
6681
|
type: "button"
|
|
6667
6682
|
},
|
|
6668
|
-
icon && (iconPosition === "top" || iconPosition === "start") && /* @__PURE__ */
|
|
6683
|
+
icon && (iconPosition === "top" || iconPosition === "start") && /* @__PURE__ */ React93.createElement("span", { className: "rf-tab__icon" }, icon),
|
|
6669
6684
|
label,
|
|
6670
|
-
icon && (iconPosition === "bottom" || iconPosition === "end") && /* @__PURE__ */
|
|
6685
|
+
icon && (iconPosition === "bottom" || iconPosition === "end") && /* @__PURE__ */ React93.createElement("span", { className: "rf-tab__icon" }, icon)
|
|
6671
6686
|
);
|
|
6672
6687
|
};
|
|
6673
6688
|
Tab.displayName = "Tab";
|
|
@@ -6754,7 +6769,7 @@ var Tabs = ({
|
|
|
6754
6769
|
}
|
|
6755
6770
|
});
|
|
6756
6771
|
});
|
|
6757
|
-
return /* @__PURE__ */
|
|
6772
|
+
return /* @__PURE__ */ React93.createElement("div", { className: rootClasses, style, role: "tablist" }, /* @__PURE__ */ React93.createElement(
|
|
6758
6773
|
"div",
|
|
6759
6774
|
{
|
|
6760
6775
|
ref: tabsListRef,
|
|
@@ -6762,7 +6777,7 @@ var Tabs = ({
|
|
|
6762
6777
|
style: centered ? { justifyContent: "center" } : void 0
|
|
6763
6778
|
},
|
|
6764
6779
|
enrichedChildren,
|
|
6765
|
-
/* @__PURE__ */
|
|
6780
|
+
/* @__PURE__ */ React93.createElement(
|
|
6766
6781
|
"span",
|
|
6767
6782
|
{
|
|
6768
6783
|
className: "rf-tabs__indicator",
|
|
@@ -6775,7 +6790,7 @@ var Tabs = ({
|
|
|
6775
6790
|
Tabs.displayName = "Tabs";
|
|
6776
6791
|
|
|
6777
6792
|
// lib/Breadcrumbs/Breadcrumbs.tsx
|
|
6778
|
-
import
|
|
6793
|
+
import React94, {
|
|
6779
6794
|
Children as Children3,
|
|
6780
6795
|
useState as useState17
|
|
6781
6796
|
} from "react";
|
|
@@ -6801,7 +6816,7 @@ var Breadcrumbs = ({
|
|
|
6801
6816
|
const after = childArray.slice(totalItems - itemsAfterCollapse);
|
|
6802
6817
|
itemsToRender = [
|
|
6803
6818
|
...before,
|
|
6804
|
-
/* @__PURE__ */
|
|
6819
|
+
/* @__PURE__ */ React94.createElement(
|
|
6805
6820
|
"button",
|
|
6806
6821
|
{
|
|
6807
6822
|
key: "collapse-btn",
|
|
@@ -6818,15 +6833,15 @@ var Breadcrumbs = ({
|
|
|
6818
6833
|
itemsToRender = childArray;
|
|
6819
6834
|
}
|
|
6820
6835
|
const classes = ["rf-breadcrumbs", sxClass, className].filter(Boolean).join(" ");
|
|
6821
|
-
return /* @__PURE__ */
|
|
6836
|
+
return /* @__PURE__ */ React94.createElement("nav", { "aria-label": ariaLabel }, /* @__PURE__ */ React94.createElement("ol", { className: classes, style }, itemsToRender.map((item, index) => {
|
|
6822
6837
|
const isLast = index === itemsToRender.length - 1;
|
|
6823
|
-
return /* @__PURE__ */
|
|
6838
|
+
return /* @__PURE__ */ React94.createElement(React94.Fragment, { key: index }, /* @__PURE__ */ React94.createElement(
|
|
6824
6839
|
"li",
|
|
6825
6840
|
{
|
|
6826
6841
|
className: `rf-breadcrumbs__item${isLast ? " rf-breadcrumbs__current" : ""}`
|
|
6827
6842
|
},
|
|
6828
6843
|
item
|
|
6829
|
-
), !isLast && /* @__PURE__ */
|
|
6844
|
+
), !isLast && /* @__PURE__ */ React94.createElement(
|
|
6830
6845
|
"li",
|
|
6831
6846
|
{
|
|
6832
6847
|
className: "rf-breadcrumbs__separator",
|
|
@@ -6839,7 +6854,7 @@ var Breadcrumbs = ({
|
|
|
6839
6854
|
Breadcrumbs.displayName = "Breadcrumbs";
|
|
6840
6855
|
|
|
6841
6856
|
// lib/Stepper/Stepper.tsx
|
|
6842
|
-
import
|
|
6857
|
+
import React95, {
|
|
6843
6858
|
Children as Children4,
|
|
6844
6859
|
cloneElement as cloneElement2,
|
|
6845
6860
|
isValidElement as isValidElement2
|
|
@@ -6856,7 +6871,7 @@ var DefaultStepIcon = ({
|
|
|
6856
6871
|
completed ? "rf-step-icon--completed" : "",
|
|
6857
6872
|
error ? "rf-step-icon--error" : ""
|
|
6858
6873
|
].filter(Boolean).join(" ");
|
|
6859
|
-
return /* @__PURE__ */
|
|
6874
|
+
return /* @__PURE__ */ React95.createElement("div", { className: classes }, completed ? "\u2713" : error ? "!" : icon);
|
|
6860
6875
|
};
|
|
6861
6876
|
var StepLabel = ({
|
|
6862
6877
|
icon,
|
|
@@ -6878,7 +6893,7 @@ var StepLabel = ({
|
|
|
6878
6893
|
_completed ? "rf-step-label__title--completed" : "",
|
|
6879
6894
|
error ? "rf-step-label__title--error" : ""
|
|
6880
6895
|
].filter(Boolean).join(" ");
|
|
6881
|
-
return /* @__PURE__ */
|
|
6896
|
+
return /* @__PURE__ */ React95.createElement("div", { className: `rf-step-label${sxClass ? ` ${sxClass}` : ""}` }, /* @__PURE__ */ React95.createElement("div", { className: "rf-step-label__icon-container" }, icon ? icon : /* @__PURE__ */ React95.createElement(
|
|
6882
6897
|
IconComp,
|
|
6883
6898
|
{
|
|
6884
6899
|
active: _active,
|
|
@@ -6886,7 +6901,7 @@ var StepLabel = ({
|
|
|
6886
6901
|
error,
|
|
6887
6902
|
icon: _stepIndex + 1
|
|
6888
6903
|
}
|
|
6889
|
-
)), /* @__PURE__ */
|
|
6904
|
+
)), /* @__PURE__ */ React95.createElement("div", { className: "rf-step-label__text" }, /* @__PURE__ */ React95.createElement("span", { className: titleClasses }, children), optional && /* @__PURE__ */ React95.createElement("span", { className: "rf-step-label__optional" }, optional)));
|
|
6890
6905
|
};
|
|
6891
6906
|
StepLabel.displayName = "StepLabel";
|
|
6892
6907
|
var StepContent = ({
|
|
@@ -6895,7 +6910,7 @@ var StepContent = ({
|
|
|
6895
6910
|
_isLast = false
|
|
6896
6911
|
}) => {
|
|
6897
6912
|
const sxClass = useSx(sx);
|
|
6898
|
-
return /* @__PURE__ */
|
|
6913
|
+
return /* @__PURE__ */ React95.createElement(
|
|
6899
6914
|
"div",
|
|
6900
6915
|
{
|
|
6901
6916
|
className: [
|
|
@@ -6915,7 +6930,7 @@ var StepButton = ({
|
|
|
6915
6930
|
_disabled = false
|
|
6916
6931
|
}) => {
|
|
6917
6932
|
const sxClass = useSx(sx);
|
|
6918
|
-
return /* @__PURE__ */
|
|
6933
|
+
return /* @__PURE__ */ React95.createElement(
|
|
6919
6934
|
"button",
|
|
6920
6935
|
{
|
|
6921
6936
|
className: `rf-step-button${sxClass ? ` ${sxClass}` : ""}`,
|
|
@@ -6963,7 +6978,7 @@ var Step = ({
|
|
|
6963
6978
|
}
|
|
6964
6979
|
return child;
|
|
6965
6980
|
});
|
|
6966
|
-
return /* @__PURE__ */
|
|
6981
|
+
return /* @__PURE__ */ React95.createElement(
|
|
6967
6982
|
"div",
|
|
6968
6983
|
{
|
|
6969
6984
|
className: `rf-step${sxClass ? ` ${sxClass}` : ""}`,
|
|
@@ -6978,7 +6993,7 @@ Step.displayName = "Step";
|
|
|
6978
6993
|
var DefaultConnector = ({
|
|
6979
6994
|
completed,
|
|
6980
6995
|
active
|
|
6981
|
-
}) => /* @__PURE__ */
|
|
6996
|
+
}) => /* @__PURE__ */ React95.createElement(
|
|
6982
6997
|
"div",
|
|
6983
6998
|
{
|
|
6984
6999
|
className: [
|
|
@@ -6987,7 +7002,7 @@ var DefaultConnector = ({
|
|
|
6987
7002
|
active ? "rf-step-connector--active" : ""
|
|
6988
7003
|
].filter(Boolean).join(" ")
|
|
6989
7004
|
},
|
|
6990
|
-
/* @__PURE__ */
|
|
7005
|
+
/* @__PURE__ */ React95.createElement("span", { className: "rf-step-connector__line" })
|
|
6991
7006
|
);
|
|
6992
7007
|
var Stepper = ({
|
|
6993
7008
|
activeStep = 0,
|
|
@@ -7010,7 +7025,7 @@ var Stepper = ({
|
|
|
7010
7025
|
sxClass,
|
|
7011
7026
|
className
|
|
7012
7027
|
].filter(Boolean).join(" ");
|
|
7013
|
-
return /* @__PURE__ */
|
|
7028
|
+
return /* @__PURE__ */ React95.createElement("div", { className: classes, style }, childArray.map((child, index) => {
|
|
7014
7029
|
const isActive = index === activeStep;
|
|
7015
7030
|
const isCompleted = nonLinear ? child.props.completed ?? false : index < activeStep;
|
|
7016
7031
|
const isLast = index === totalSteps - 1;
|
|
@@ -7023,7 +7038,7 @@ var Stepper = ({
|
|
|
7023
7038
|
last: isLast
|
|
7024
7039
|
}
|
|
7025
7040
|
);
|
|
7026
|
-
const connectorEl = index > 0 ? connector ? connector : /* @__PURE__ */
|
|
7041
|
+
const connectorEl = index > 0 ? connector ? connector : /* @__PURE__ */ React95.createElement(
|
|
7027
7042
|
DefaultConnector,
|
|
7028
7043
|
{
|
|
7029
7044
|
key: `connector-${index}`,
|
|
@@ -7032,9 +7047,9 @@ var Stepper = ({
|
|
|
7032
7047
|
}
|
|
7033
7048
|
) : null;
|
|
7034
7049
|
if (orientation === "horizontal") {
|
|
7035
|
-
return /* @__PURE__ */
|
|
7050
|
+
return /* @__PURE__ */ React95.createElement(React95.Fragment, { key: index }, connectorEl, enrichedStep);
|
|
7036
7051
|
}
|
|
7037
|
-
return /* @__PURE__ */
|
|
7052
|
+
return /* @__PURE__ */ React95.createElement(React95.Fragment, { key: index }, /* @__PURE__ */ React95.createElement("div", { className: "rf-step__header" }, enrichedStep), !isLast && /* @__PURE__ */ React95.createElement(
|
|
7038
7053
|
DefaultConnector,
|
|
7039
7054
|
{
|
|
7040
7055
|
completed: index < activeStep,
|
|
@@ -7046,13 +7061,13 @@ var Stepper = ({
|
|
|
7046
7061
|
Stepper.displayName = "Stepper";
|
|
7047
7062
|
|
|
7048
7063
|
// lib/Menu/Menu.tsx
|
|
7049
|
-
import
|
|
7064
|
+
import React96, {
|
|
7050
7065
|
useEffect as useEffect13,
|
|
7051
7066
|
useRef as useRef17,
|
|
7052
7067
|
useState as useState18
|
|
7053
7068
|
} from "react";
|
|
7054
7069
|
import ReactDOM2 from "react-dom";
|
|
7055
|
-
var MenuDivider = () => /* @__PURE__ */
|
|
7070
|
+
var MenuDivider = () => /* @__PURE__ */ React96.createElement("hr", { className: "rf-menu-divider", "aria-hidden": "true" });
|
|
7056
7071
|
MenuDivider.displayName = "MenuDivider";
|
|
7057
7072
|
var MenuItem = ({
|
|
7058
7073
|
onClick,
|
|
@@ -7073,7 +7088,7 @@ var MenuItem = ({
|
|
|
7073
7088
|
divider ? "rf-menu-item--divider" : "",
|
|
7074
7089
|
sxClass
|
|
7075
7090
|
].filter(Boolean).join(" ");
|
|
7076
|
-
return /* @__PURE__ */
|
|
7091
|
+
return /* @__PURE__ */ React96.createElement(
|
|
7077
7092
|
"li",
|
|
7078
7093
|
{
|
|
7079
7094
|
className: classes,
|
|
@@ -7088,7 +7103,7 @@ var MenuItem = ({
|
|
|
7088
7103
|
}
|
|
7089
7104
|
}
|
|
7090
7105
|
},
|
|
7091
|
-
icon && /* @__PURE__ */
|
|
7106
|
+
icon && /* @__PURE__ */ React96.createElement("span", { className: "rf-menu-item__icon" }, icon),
|
|
7092
7107
|
children
|
|
7093
7108
|
);
|
|
7094
7109
|
};
|
|
@@ -7100,17 +7115,17 @@ var MenuList = ({
|
|
|
7100
7115
|
sx
|
|
7101
7116
|
}) => {
|
|
7102
7117
|
const sxClass = useSx(sx);
|
|
7103
|
-
return /* @__PURE__ */
|
|
7118
|
+
return /* @__PURE__ */ React96.createElement(
|
|
7104
7119
|
"ul",
|
|
7105
7120
|
{
|
|
7106
7121
|
className: `rf-menu-list${sxClass ? ` ${sxClass}` : ""}`,
|
|
7107
7122
|
role: "menu"
|
|
7108
7123
|
},
|
|
7109
|
-
subheader && /* @__PURE__ */
|
|
7110
|
-
|
|
7111
|
-
if (!
|
|
7124
|
+
subheader && /* @__PURE__ */ React96.createElement("li", { className: "rf-menu-list__subheader", role: "presentation" }, subheader),
|
|
7125
|
+
React96.Children.map(children, (child) => {
|
|
7126
|
+
if (!React96.isValidElement(child)) return child;
|
|
7112
7127
|
if (dense) {
|
|
7113
|
-
return
|
|
7128
|
+
return React96.cloneElement(child, {
|
|
7114
7129
|
dense: true
|
|
7115
7130
|
});
|
|
7116
7131
|
}
|
|
@@ -7187,14 +7202,14 @@ var Menu = ({
|
|
|
7187
7202
|
}, [open, onClose]);
|
|
7188
7203
|
if (!mounted) return null;
|
|
7189
7204
|
const classes = ["rf-menu-paper", sxClass, className].filter(Boolean).join(" ");
|
|
7190
|
-
const portal = /* @__PURE__ */
|
|
7205
|
+
const portal = /* @__PURE__ */ React96.createElement("div", { className: "rf-menu-portal", style: { display: open ? void 0 : "none" } }, /* @__PURE__ */ React96.createElement(
|
|
7191
7206
|
"div",
|
|
7192
7207
|
{
|
|
7193
7208
|
className: "rf-menu-backdrop",
|
|
7194
7209
|
onClick: onClose,
|
|
7195
7210
|
"aria-hidden": "true"
|
|
7196
7211
|
}
|
|
7197
|
-
), /* @__PURE__ */
|
|
7212
|
+
), /* @__PURE__ */ React96.createElement(
|
|
7198
7213
|
"div",
|
|
7199
7214
|
{
|
|
7200
7215
|
ref: paperRef,
|
|
@@ -7209,7 +7224,7 @@ var Menu = ({
|
|
|
7209
7224
|
Menu.displayName = "Menu";
|
|
7210
7225
|
|
|
7211
7226
|
// lib/Drawer/Drawer.tsx
|
|
7212
|
-
import
|
|
7227
|
+
import React97, {
|
|
7213
7228
|
useEffect as useEffect14,
|
|
7214
7229
|
useState as useState19
|
|
7215
7230
|
} from "react";
|
|
@@ -7277,7 +7292,7 @@ var Drawer = ({
|
|
|
7277
7292
|
className
|
|
7278
7293
|
].filter(Boolean).join(" ");
|
|
7279
7294
|
if (variant === "permanent") {
|
|
7280
|
-
return /* @__PURE__ */
|
|
7295
|
+
return /* @__PURE__ */ React97.createElement("div", { className: rootClasses, style }, /* @__PURE__ */ React97.createElement(
|
|
7281
7296
|
"div",
|
|
7282
7297
|
{
|
|
7283
7298
|
className: paperClasses,
|
|
@@ -7287,7 +7302,7 @@ var Drawer = ({
|
|
|
7287
7302
|
));
|
|
7288
7303
|
}
|
|
7289
7304
|
if (variant === "persistent") {
|
|
7290
|
-
return /* @__PURE__ */
|
|
7305
|
+
return /* @__PURE__ */ React97.createElement("div", { className: rootClasses, style }, /* @__PURE__ */ React97.createElement(
|
|
7291
7306
|
"div",
|
|
7292
7307
|
{
|
|
7293
7308
|
className: paperClasses,
|
|
@@ -7296,14 +7311,14 @@ var Drawer = ({
|
|
|
7296
7311
|
children
|
|
7297
7312
|
));
|
|
7298
7313
|
}
|
|
7299
|
-
const drawerContent = /* @__PURE__ */
|
|
7314
|
+
const drawerContent = /* @__PURE__ */ React97.createElement(React97.Fragment, null, /* @__PURE__ */ React97.createElement(
|
|
7300
7315
|
"div",
|
|
7301
7316
|
{
|
|
7302
7317
|
className: `rf-drawer-backdrop${!open ? " rf-drawer-backdrop--hidden" : ""}`,
|
|
7303
7318
|
onClick: onClose,
|
|
7304
7319
|
"aria-hidden": "true"
|
|
7305
7320
|
}
|
|
7306
|
-
), /* @__PURE__ */
|
|
7321
|
+
), /* @__PURE__ */ React97.createElement(
|
|
7307
7322
|
"div",
|
|
7308
7323
|
{
|
|
7309
7324
|
className: paperClasses,
|
|
@@ -7314,14 +7329,14 @@ var Drawer = ({
|
|
|
7314
7329
|
children
|
|
7315
7330
|
));
|
|
7316
7331
|
return ReactDOM3.createPortal(
|
|
7317
|
-
/* @__PURE__ */
|
|
7332
|
+
/* @__PURE__ */ React97.createElement("div", { className: rootClasses, style }, drawerContent),
|
|
7318
7333
|
document.body
|
|
7319
7334
|
);
|
|
7320
7335
|
};
|
|
7321
7336
|
Drawer.displayName = "Drawer";
|
|
7322
7337
|
|
|
7323
7338
|
// lib/Snackbar/Snackbar.tsx
|
|
7324
|
-
import
|
|
7339
|
+
import React98, {
|
|
7325
7340
|
useCallback as useCallback6,
|
|
7326
7341
|
useEffect as useEffect15,
|
|
7327
7342
|
useRef as useRef18,
|
|
@@ -7407,7 +7422,7 @@ var Snackbar = ({
|
|
|
7407
7422
|
].filter(Boolean).join(" ");
|
|
7408
7423
|
const rootClasses = ["rf-snackbar-root", anchorClass].filter(Boolean).join(" ");
|
|
7409
7424
|
const icon = severity !== "default" ? SEVERITY_ICONS[severity] : null;
|
|
7410
|
-
const snackbarEl = /* @__PURE__ */
|
|
7425
|
+
const snackbarEl = /* @__PURE__ */ React98.createElement("div", { className: rootClasses }, /* @__PURE__ */ React98.createElement(
|
|
7411
7426
|
"div",
|
|
7412
7427
|
{
|
|
7413
7428
|
className: snackbarClasses,
|
|
@@ -7418,10 +7433,10 @@ var Snackbar = ({
|
|
|
7418
7433
|
onMouseEnter: handleMouseEnter,
|
|
7419
7434
|
onMouseLeave: handleMouseLeave
|
|
7420
7435
|
},
|
|
7421
|
-
icon && severity !== "default" && /* @__PURE__ */
|
|
7422
|
-
/* @__PURE__ */
|
|
7423
|
-
action && /* @__PURE__ */
|
|
7424
|
-
!action && onClose && /* @__PURE__ */
|
|
7436
|
+
icon && severity !== "default" && /* @__PURE__ */ React98.createElement("span", { className: "rf-snackbar__icon", "aria-hidden": "true" }, icon),
|
|
7437
|
+
/* @__PURE__ */ React98.createElement("span", { className: "rf-snackbar__message" }, message),
|
|
7438
|
+
action && /* @__PURE__ */ React98.createElement("span", { className: "rf-snackbar__action" }, action),
|
|
7439
|
+
!action && onClose && /* @__PURE__ */ React98.createElement(
|
|
7425
7440
|
"button",
|
|
7426
7441
|
{
|
|
7427
7442
|
className: "rf-snackbar__close-btn",
|
|
@@ -7437,7 +7452,7 @@ var Snackbar = ({
|
|
|
7437
7452
|
Snackbar.displayName = "Snackbar";
|
|
7438
7453
|
|
|
7439
7454
|
// lib/Link/Link.tsx
|
|
7440
|
-
import
|
|
7455
|
+
import React99 from "react";
|
|
7441
7456
|
var KNOWN_COLORS = ["primary", "secondary", "textPrimary", "textSecondary", "inherit"];
|
|
7442
7457
|
var Link = ({
|
|
7443
7458
|
href,
|
|
@@ -7468,7 +7483,7 @@ var Link = ({
|
|
|
7468
7483
|
};
|
|
7469
7484
|
const Tag = component || "a";
|
|
7470
7485
|
const computedRel = rel ?? (target === "_blank" ? "noopener noreferrer" : void 0);
|
|
7471
|
-
return /* @__PURE__ */
|
|
7486
|
+
return /* @__PURE__ */ React99.createElement(
|
|
7472
7487
|
Tag,
|
|
7473
7488
|
{
|
|
7474
7489
|
href,
|
|
@@ -7485,7 +7500,7 @@ var Link = ({
|
|
|
7485
7500
|
Link.displayName = "Link";
|
|
7486
7501
|
|
|
7487
7502
|
// lib/Popper/Popper.tsx
|
|
7488
|
-
import
|
|
7503
|
+
import React100, {
|
|
7489
7504
|
useEffect as useEffect16,
|
|
7490
7505
|
useLayoutEffect as useLayoutEffect2,
|
|
7491
7506
|
useRef as useRef19,
|
|
@@ -7621,7 +7636,7 @@ var Popper = ({
|
|
|
7621
7636
|
const content = typeof children === "function" ? children(
|
|
7622
7637
|
{ placement, TransitionProps: transitionProps }
|
|
7623
7638
|
) : children;
|
|
7624
|
-
const popper = /* @__PURE__ */
|
|
7639
|
+
const popper = /* @__PURE__ */ React100.createElement(
|
|
7625
7640
|
"div",
|
|
7626
7641
|
{
|
|
7627
7642
|
ref: popperRef,
|
|
@@ -7632,14 +7647,14 @@ var Popper = ({
|
|
|
7632
7647
|
content
|
|
7633
7648
|
);
|
|
7634
7649
|
if (disablePortal) {
|
|
7635
|
-
return /* @__PURE__ */
|
|
7650
|
+
return /* @__PURE__ */ React100.createElement(React100.Fragment, null, popper);
|
|
7636
7651
|
}
|
|
7637
7652
|
return ReactDOM5.createPortal(popper, document.body);
|
|
7638
7653
|
};
|
|
7639
7654
|
Popper.displayName = "Popper";
|
|
7640
7655
|
|
|
7641
7656
|
// lib/Popover/Popover.tsx
|
|
7642
|
-
import
|
|
7657
|
+
import React101, {
|
|
7643
7658
|
useEffect as useEffect17,
|
|
7644
7659
|
useLayoutEffect as useLayoutEffect3,
|
|
7645
7660
|
useRef as useRef20,
|
|
@@ -7723,14 +7738,14 @@ var Popover = ({
|
|
|
7723
7738
|
paperSxClass
|
|
7724
7739
|
].filter(Boolean).join(" ");
|
|
7725
7740
|
const rootClasses = ["rf-popover-root", sxClass, className].filter(Boolean).join(" ");
|
|
7726
|
-
const content = /* @__PURE__ */
|
|
7741
|
+
const content = /* @__PURE__ */ React101.createElement(React101.Fragment, null, /* @__PURE__ */ React101.createElement(
|
|
7727
7742
|
"div",
|
|
7728
7743
|
{
|
|
7729
7744
|
className: "rf-popover-backdrop",
|
|
7730
7745
|
onClick: onClose,
|
|
7731
7746
|
"aria-hidden": "true"
|
|
7732
7747
|
}
|
|
7733
|
-
), /* @__PURE__ */
|
|
7748
|
+
), /* @__PURE__ */ React101.createElement(
|
|
7734
7749
|
"div",
|
|
7735
7750
|
{
|
|
7736
7751
|
ref: paperRef,
|
|
@@ -7746,17 +7761,17 @@ var Popover = ({
|
|
|
7746
7761
|
children
|
|
7747
7762
|
));
|
|
7748
7763
|
if (disablePortal) {
|
|
7749
|
-
return /* @__PURE__ */
|
|
7764
|
+
return /* @__PURE__ */ React101.createElement("div", { className: `${rootClasses} rf-popover-inline`, style }, content);
|
|
7750
7765
|
}
|
|
7751
7766
|
return ReactDOM6.createPortal(
|
|
7752
|
-
/* @__PURE__ */
|
|
7767
|
+
/* @__PURE__ */ React101.createElement("div", { className: rootClasses, style }, content),
|
|
7753
7768
|
document.body
|
|
7754
7769
|
);
|
|
7755
7770
|
};
|
|
7756
7771
|
Popover.displayName = "Popover";
|
|
7757
7772
|
|
|
7758
7773
|
// lib/Transitions/Transitions.tsx
|
|
7759
|
-
import
|
|
7774
|
+
import React102, {
|
|
7760
7775
|
cloneElement as cloneElement3,
|
|
7761
7776
|
useEffect as useEffect18,
|
|
7762
7777
|
useRef as useRef21,
|
|
@@ -7934,7 +7949,7 @@ var Collapse = ({
|
|
|
7934
7949
|
const exitMs = getTimeout(timeout, "exit");
|
|
7935
7950
|
const dur = state === "entering" || state === "entered" ? enterMs : exitMs;
|
|
7936
7951
|
const containerStyle = orientation === "vertical" ? { height: size === "auto" ? "auto" : typeof size === "number" ? `${size}px` : size } : { width: size === "auto" ? "auto" : typeof size === "number" ? `${size}px` : size };
|
|
7937
|
-
return /* @__PURE__ */
|
|
7952
|
+
return /* @__PURE__ */ React102.createElement(
|
|
7938
7953
|
"div",
|
|
7939
7954
|
{
|
|
7940
7955
|
className: [
|
|
@@ -7947,7 +7962,7 @@ var Collapse = ({
|
|
|
7947
7962
|
...containerStyle
|
|
7948
7963
|
}
|
|
7949
7964
|
},
|
|
7950
|
-
/* @__PURE__ */
|
|
7965
|
+
/* @__PURE__ */ React102.createElement(
|
|
7951
7966
|
"div",
|
|
7952
7967
|
{
|
|
7953
7968
|
ref: innerRef,
|
|
@@ -7986,6 +8001,116 @@ var Zoom = ({
|
|
|
7986
8001
|
});
|
|
7987
8002
|
};
|
|
7988
8003
|
Zoom.displayName = "Zoom";
|
|
8004
|
+
|
|
8005
|
+
// lib/ImageField/ImageField.tsx
|
|
8006
|
+
import React103, { useRef as useRef22, useState as useState24, useCallback as useCallback7 } from "react";
|
|
8007
|
+
function getSizeStyle2(size) {
|
|
8008
|
+
if (size === "small") return { className: "rf-image-field--small" };
|
|
8009
|
+
if (size === "large") return { className: "rf-image-field--large" };
|
|
8010
|
+
if (typeof size === "number") {
|
|
8011
|
+
return {
|
|
8012
|
+
className: "",
|
|
8013
|
+
style: { width: size, height: size }
|
|
8014
|
+
};
|
|
8015
|
+
}
|
|
8016
|
+
return { className: "rf-image-field--medium" };
|
|
8017
|
+
}
|
|
8018
|
+
var ImageField = React103.forwardRef(
|
|
8019
|
+
({
|
|
8020
|
+
src,
|
|
8021
|
+
alt = "",
|
|
8022
|
+
variant = "circular",
|
|
8023
|
+
size = "medium",
|
|
8024
|
+
accept = "image/*",
|
|
8025
|
+
onChange,
|
|
8026
|
+
overlayText = "Upload",
|
|
8027
|
+
disabled = false,
|
|
8028
|
+
className = "",
|
|
8029
|
+
style,
|
|
8030
|
+
sx
|
|
8031
|
+
}, ref) => {
|
|
8032
|
+
const sxClass = useSx(sx);
|
|
8033
|
+
const inputRef = useRef22(null);
|
|
8034
|
+
const [preview, setPreview] = useState24(null);
|
|
8035
|
+
const { className: sizeClass, style: sizeStyle } = getSizeStyle2(size);
|
|
8036
|
+
const displaySrc = preview || src;
|
|
8037
|
+
const handleClick = useCallback7(() => {
|
|
8038
|
+
if (!disabled) {
|
|
8039
|
+
inputRef.current?.click();
|
|
8040
|
+
}
|
|
8041
|
+
}, [disabled]);
|
|
8042
|
+
const handleKeyDown = useCallback7(
|
|
8043
|
+
(e) => {
|
|
8044
|
+
if ((e.key === "Enter" || e.key === " ") && !disabled) {
|
|
8045
|
+
e.preventDefault();
|
|
8046
|
+
inputRef.current?.click();
|
|
8047
|
+
}
|
|
8048
|
+
},
|
|
8049
|
+
[disabled]
|
|
8050
|
+
);
|
|
8051
|
+
const handleFileChange = useCallback7(
|
|
8052
|
+
(e) => {
|
|
8053
|
+
const file = e.target.files?.[0];
|
|
8054
|
+
if (!file) return;
|
|
8055
|
+
const objectUrl = URL.createObjectURL(file);
|
|
8056
|
+
setPreview(objectUrl);
|
|
8057
|
+
onChange?.(file);
|
|
8058
|
+
e.target.value = "";
|
|
8059
|
+
},
|
|
8060
|
+
[onChange]
|
|
8061
|
+
);
|
|
8062
|
+
const classes = [
|
|
8063
|
+
"rf-image-field",
|
|
8064
|
+
`rf-image-field--${variant}`,
|
|
8065
|
+
sizeClass,
|
|
8066
|
+
disabled ? "rf-image-field--disabled" : "",
|
|
8067
|
+
sxClass,
|
|
8068
|
+
className
|
|
8069
|
+
].filter(Boolean).join(" ");
|
|
8070
|
+
const iconSize = typeof size === "number" ? Math.max(size * 0.25, 16) : size === "small" ? 16 : size === "large" ? 28 : 22;
|
|
8071
|
+
return /* @__PURE__ */ React103.createElement(
|
|
8072
|
+
"div",
|
|
8073
|
+
{
|
|
8074
|
+
ref,
|
|
8075
|
+
className: classes,
|
|
8076
|
+
style: { ...sizeStyle, ...style },
|
|
8077
|
+
role: "button",
|
|
8078
|
+
tabIndex: disabled ? -1 : 0,
|
|
8079
|
+
"aria-label": alt || overlayText,
|
|
8080
|
+
onClick: handleClick,
|
|
8081
|
+
onKeyDown: handleKeyDown
|
|
8082
|
+
},
|
|
8083
|
+
displaySrc ? /* @__PURE__ */ React103.createElement(
|
|
8084
|
+
"img",
|
|
8085
|
+
{
|
|
8086
|
+
src: displaySrc,
|
|
8087
|
+
alt,
|
|
8088
|
+
className: "rf-image-field__img"
|
|
8089
|
+
}
|
|
8090
|
+
) : /* @__PURE__ */ React103.createElement("div", { className: "rf-image-field__placeholder" }, /* @__PURE__ */ React103.createElement(
|
|
8091
|
+
cameraIcon_default,
|
|
8092
|
+
{
|
|
8093
|
+
width: iconSize,
|
|
8094
|
+
height: iconSize,
|
|
8095
|
+
color: "var(--text-secondary)"
|
|
8096
|
+
}
|
|
8097
|
+
)),
|
|
8098
|
+
/* @__PURE__ */ React103.createElement("div", { className: "rf-image-field__overlay" }, /* @__PURE__ */ React103.createElement(cameraIcon_default, { width: iconSize, height: iconSize, color: "#ffffff" }), overlayText && /* @__PURE__ */ React103.createElement("span", { className: "rf-image-field__overlay-text" }, overlayText)),
|
|
8099
|
+
/* @__PURE__ */ React103.createElement(
|
|
8100
|
+
"input",
|
|
8101
|
+
{
|
|
8102
|
+
ref: inputRef,
|
|
8103
|
+
type: "file",
|
|
8104
|
+
accept,
|
|
8105
|
+
className: "rf-image-field__input",
|
|
8106
|
+
onChange: handleFileChange,
|
|
8107
|
+
disabled
|
|
8108
|
+
}
|
|
8109
|
+
)
|
|
8110
|
+
);
|
|
8111
|
+
}
|
|
8112
|
+
);
|
|
8113
|
+
ImageField.displayName = "ImageField";
|
|
7989
8114
|
export {
|
|
7990
8115
|
APP_THEMES,
|
|
7991
8116
|
Accordion,
|
|
@@ -8002,6 +8127,7 @@ export {
|
|
|
8002
8127
|
BaseDialog_default as BaseDialog,
|
|
8003
8128
|
Box,
|
|
8004
8129
|
Breadcrumbs,
|
|
8130
|
+
cameraIcon_default as CameraIcon,
|
|
8005
8131
|
cancelButton_default as CancelButton,
|
|
8006
8132
|
Card,
|
|
8007
8133
|
CardActions,
|
|
@@ -8036,6 +8162,7 @@ export {
|
|
|
8036
8162
|
Grow,
|
|
8037
8163
|
helpOutlinedIcon_default as HelpOutlinedIcon,
|
|
8038
8164
|
hierarchyIcon_default as HierarchyIcon,
|
|
8165
|
+
ImageField,
|
|
8039
8166
|
inactiveGroupIcon_default as InactiveGroupIcon,
|
|
8040
8167
|
industryIcon_default as IndustryIcon,
|
|
8041
8168
|
invoiceIcon_default as InvoiceIcon,
|