@eztrak/shared 0.15.3 → 0.16.1
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/{chunk-QM2TGUZN.mjs → chunk-DFGYKOJF.mjs} +540 -125
- package/dist/chunk-DFGYKOJF.mjs.map +1 -0
- package/dist/components/index.d.mts +98 -2
- package/dist/components/index.d.ts +98 -2
- package/dist/components/index.js +550 -130
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +11 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +550 -130
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +11 -1
- package/package.json +1 -1
- package/dist/chunk-QM2TGUZN.mjs.map +0 -1
- package/dist/components/index.css +0 -21
- package/dist/components/index.css.map +0 -1
- package/dist/index.css +0 -21
- package/dist/index.css.map +0 -1
|
@@ -883,6 +883,9 @@ import { createPortal } from "react-dom";
|
|
|
883
883
|
import { FaFileExport, FaPrint } from "react-icons/fa";
|
|
884
884
|
import { IoCloseCircleOutline } from "react-icons/io5";
|
|
885
885
|
|
|
886
|
+
// src/components/Loader/Loader.css
|
|
887
|
+
import "@eztrak/shared/components/loader.css";
|
|
888
|
+
|
|
886
889
|
// src/components/Loader/Loader.tsx
|
|
887
890
|
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
888
891
|
var Loader = ({ className, color = "#F54C00", size = "50px", speed = "1s" }) => {
|
|
@@ -1080,8 +1083,473 @@ function Modal({
|
|
|
1080
1083
|
return createPortal(modalContent, modalRoot);
|
|
1081
1084
|
}
|
|
1082
1085
|
|
|
1086
|
+
// src/components/button/Button.tsx
|
|
1087
|
+
import { forwardRef } from "react";
|
|
1088
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
1089
|
+
var BASE_STYLES2 = "flex gap-1 items-center font-medium text-sm px-5 py-3 rounded-md transition-colors duration-200 disabled:opacity-50 disabled:cursor-not-allowed";
|
|
1090
|
+
var VARIANTS2 = {
|
|
1091
|
+
primary: "bg-white text-secondary border-secondary hover:bg-lightGray hover:text-black",
|
|
1092
|
+
"primary-outline": "bg-white text-primary-150 border-primary-150 hover:bg-primary-100 hover:text-white font-bold",
|
|
1093
|
+
"primary-fill": "bg-primary-150 text-white border-primary hover:bg-primary/90",
|
|
1094
|
+
secondary: "bg-primary-150 text-white border-primary hover:bg-primary/90",
|
|
1095
|
+
danger: "bg-red-600 text-white border-red-600 hover:bg-red-700",
|
|
1096
|
+
outline: "bg-white text-primary border-primary hover:bg-primary/10",
|
|
1097
|
+
ghost: "bg-transparent text-secondary border-transparent hover:bg-primary/10 p-2",
|
|
1098
|
+
inline: "bg-transparent text-gray-500 border-none hover:text-gray-600 underline shadow-none p-0 m-0"
|
|
1099
|
+
};
|
|
1100
|
+
var SIZES = {
|
|
1101
|
+
sm: "px-3 py-2 text-xs",
|
|
1102
|
+
md: "px-5 py-3 text-sm",
|
|
1103
|
+
lg: "px-6 py-4 text-base"
|
|
1104
|
+
};
|
|
1105
|
+
var Button = forwardRef(
|
|
1106
|
+
({
|
|
1107
|
+
children,
|
|
1108
|
+
className = "",
|
|
1109
|
+
type = "button",
|
|
1110
|
+
onClick,
|
|
1111
|
+
disabled = false,
|
|
1112
|
+
variant = "primary",
|
|
1113
|
+
size = "md",
|
|
1114
|
+
...props
|
|
1115
|
+
}, ref) => {
|
|
1116
|
+
const variantStyles = VARIANTS2[variant] || VARIANTS2.primary;
|
|
1117
|
+
const sizeStyles = SIZES[size];
|
|
1118
|
+
return /* @__PURE__ */ jsx8(
|
|
1119
|
+
"button",
|
|
1120
|
+
{
|
|
1121
|
+
ref,
|
|
1122
|
+
type,
|
|
1123
|
+
className: cn(
|
|
1124
|
+
BASE_STYLES2,
|
|
1125
|
+
variantStyles,
|
|
1126
|
+
size !== "md" && sizeStyles,
|
|
1127
|
+
className
|
|
1128
|
+
),
|
|
1129
|
+
onClick,
|
|
1130
|
+
disabled,
|
|
1131
|
+
...props,
|
|
1132
|
+
children
|
|
1133
|
+
}
|
|
1134
|
+
);
|
|
1135
|
+
}
|
|
1136
|
+
);
|
|
1137
|
+
Button.displayName = "Button";
|
|
1138
|
+
|
|
1139
|
+
// src/components/card/Card.tsx
|
|
1140
|
+
import { jsx as jsx9, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1141
|
+
function Card({
|
|
1142
|
+
title,
|
|
1143
|
+
content,
|
|
1144
|
+
icon,
|
|
1145
|
+
onClick,
|
|
1146
|
+
containerClassName = "shadow p-6",
|
|
1147
|
+
iconClassName = "",
|
|
1148
|
+
titleClassName = "",
|
|
1149
|
+
contentClassName = "",
|
|
1150
|
+
cardBodyClassName = ""
|
|
1151
|
+
}) {
|
|
1152
|
+
return /* @__PURE__ */ jsx9(
|
|
1153
|
+
"div",
|
|
1154
|
+
{
|
|
1155
|
+
className: cn(
|
|
1156
|
+
"transform transition duration-300 cursor-pointer select-none",
|
|
1157
|
+
containerClassName
|
|
1158
|
+
),
|
|
1159
|
+
onClick,
|
|
1160
|
+
children: /* @__PURE__ */ jsxs6("div", { className: cn("flex space-x-4", cardBodyClassName), children: [
|
|
1161
|
+
/* @__PURE__ */ jsx9("span", { className: cn("text-primary text-3xl", iconClassName), children: icon }),
|
|
1162
|
+
/* @__PURE__ */ jsxs6("div", { children: [
|
|
1163
|
+
/* @__PURE__ */ jsx9("h3", { className: cn("font-semibold text-lg text-primary", titleClassName), children: title }),
|
|
1164
|
+
content != null && /* @__PURE__ */ jsx9("p", { className: cn("text-sm text-secondary", contentClassName), children: content })
|
|
1165
|
+
] })
|
|
1166
|
+
] })
|
|
1167
|
+
}
|
|
1168
|
+
);
|
|
1169
|
+
}
|
|
1170
|
+
|
|
1171
|
+
// src/components/header/Header.tsx
|
|
1172
|
+
import { jsx as jsx10, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1173
|
+
function Header({
|
|
1174
|
+
title = "Header",
|
|
1175
|
+
className = "p-2 gap-2 flex-col",
|
|
1176
|
+
containerClass = "",
|
|
1177
|
+
breadcrumbs = "",
|
|
1178
|
+
titleStyle = "text-4xl h-fit font-bold",
|
|
1179
|
+
breadcrumbsStyle = "text-sm",
|
|
1180
|
+
children
|
|
1181
|
+
}) {
|
|
1182
|
+
return /* @__PURE__ */ jsxs7("div", { className: `flex ${className}`, children: [
|
|
1183
|
+
/* @__PURE__ */ jsxs7("div", { className: "title-wrapper", children: [
|
|
1184
|
+
/* @__PURE__ */ jsx10("h1", { className: titleStyle, children: title }),
|
|
1185
|
+
breadcrumbs && /* @__PURE__ */ jsx10("div", { className: `breadcrumbs-wraper ${breadcrumbsStyle}`, children: breadcrumbs })
|
|
1186
|
+
] }),
|
|
1187
|
+
/* @__PURE__ */ jsx10("div", { className: `flex flex-row justify-between items-center ${containerClass}`, children })
|
|
1188
|
+
] });
|
|
1189
|
+
}
|
|
1190
|
+
|
|
1191
|
+
// src/components/breadcrumbs/Breadcrumbs.tsx
|
|
1192
|
+
import { Fragment } from "react";
|
|
1193
|
+
import { Link, useLocation } from "react-router-dom";
|
|
1194
|
+
import { Fragment as Fragment2, jsx as jsx11, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1195
|
+
var INACTIVE_LINK_CLASS = "inline-flex items-center justify-center text-[#5D6D7F] bg-white px-4 py-2 rounded-lg transition-colors duration-300 hover:text-[#516378]";
|
|
1196
|
+
function asTitleMap(customTitles) {
|
|
1197
|
+
if (Object.prototype.toString.call(customTitles) !== "[object Object]") {
|
|
1198
|
+
return {};
|
|
1199
|
+
}
|
|
1200
|
+
return customTitles;
|
|
1201
|
+
}
|
|
1202
|
+
function findRoute(pathname, routes, parentPath = "") {
|
|
1203
|
+
for (const route of routes) {
|
|
1204
|
+
const fullPath = `${parentPath}/${route.path}`.replace(/\/+/g, "/");
|
|
1205
|
+
if (fullPath === pathname) {
|
|
1206
|
+
return route;
|
|
1207
|
+
}
|
|
1208
|
+
if (route.children) {
|
|
1209
|
+
const childRoute = findRoute(pathname, route.children, fullPath);
|
|
1210
|
+
if (childRoute) {
|
|
1211
|
+
return childRoute;
|
|
1212
|
+
}
|
|
1213
|
+
}
|
|
1214
|
+
}
|
|
1215
|
+
return null;
|
|
1216
|
+
}
|
|
1217
|
+
function getLastParam(str) {
|
|
1218
|
+
return str.endsWith("/") ? str.slice(0, -1).split("/").pop() : str.split("/").pop();
|
|
1219
|
+
}
|
|
1220
|
+
function Breadcrumbs({
|
|
1221
|
+
routes = [],
|
|
1222
|
+
containerClassName,
|
|
1223
|
+
linkClassName = "",
|
|
1224
|
+
separatorClassName = "",
|
|
1225
|
+
separator = "/",
|
|
1226
|
+
activeClassName = "font-bold whitespace-pre",
|
|
1227
|
+
customTitles = {},
|
|
1228
|
+
customIcons = {},
|
|
1229
|
+
prefix,
|
|
1230
|
+
suffix,
|
|
1231
|
+
nonClickablePaths = []
|
|
1232
|
+
}) {
|
|
1233
|
+
const location = useLocation();
|
|
1234
|
+
const pathnames = location.pathname.split("/").filter((segment) => segment);
|
|
1235
|
+
const titles = asTitleMap(customTitles);
|
|
1236
|
+
const inactiveLinkClassName = cn(INACTIVE_LINK_CLASS, linkClassName);
|
|
1237
|
+
const getTitle = (pathname) => {
|
|
1238
|
+
const match = findRoute(pathname, routes);
|
|
1239
|
+
if (match && match.title) {
|
|
1240
|
+
return match.title;
|
|
1241
|
+
}
|
|
1242
|
+
const titleKeys = Object.keys(titles);
|
|
1243
|
+
const paramMatch = pathname.split("/").find((segment) => titleKeys.includes(segment)) || "";
|
|
1244
|
+
if (paramMatch && titles[paramMatch]) {
|
|
1245
|
+
return titles[paramMatch];
|
|
1246
|
+
}
|
|
1247
|
+
const lastParamPath = getLastParam(pathname);
|
|
1248
|
+
if (lastParamPath) {
|
|
1249
|
+
return lastParamPath;
|
|
1250
|
+
}
|
|
1251
|
+
return pathname;
|
|
1252
|
+
};
|
|
1253
|
+
const getIcon = (pathname) => {
|
|
1254
|
+
const iconKeys = Object.keys(customIcons);
|
|
1255
|
+
const matchedSegment = pathname.split("/").find((segment) => iconKeys.includes(segment));
|
|
1256
|
+
if (matchedSegment && customIcons[matchedSegment]) {
|
|
1257
|
+
return customIcons[matchedSegment];
|
|
1258
|
+
}
|
|
1259
|
+
return null;
|
|
1260
|
+
};
|
|
1261
|
+
return /* @__PURE__ */ jsxs8(
|
|
1262
|
+
"div",
|
|
1263
|
+
{
|
|
1264
|
+
className: cn(
|
|
1265
|
+
"flex flex-row gap-2 items-center text-sm text-secondary",
|
|
1266
|
+
containerClassName
|
|
1267
|
+
),
|
|
1268
|
+
children: [
|
|
1269
|
+
prefix && /* @__PURE__ */ jsx11("div", { className: "breadcrumb-prefix", children: prefix }),
|
|
1270
|
+
/* @__PURE__ */ jsxs8(Link, { to: "/", className: inactiveLinkClassName, children: [
|
|
1271
|
+
customIcons.home && /* @__PURE__ */ jsx11("span", { className: "mr-1", children: customIcons.home }),
|
|
1272
|
+
titles.home || "Home"
|
|
1273
|
+
] }),
|
|
1274
|
+
pathnames.map((segment, index) => {
|
|
1275
|
+
const to = `/${pathnames.slice(0, index + 1).join("/")}`;
|
|
1276
|
+
const isLast = index === pathnames.length - 1;
|
|
1277
|
+
const title = getTitle(to);
|
|
1278
|
+
const icon = getIcon(to);
|
|
1279
|
+
const isNonClickable = nonClickablePaths.some(
|
|
1280
|
+
(token) => to.includes(token) || segment === token
|
|
1281
|
+
);
|
|
1282
|
+
const crumb = /* @__PURE__ */ jsxs8(Fragment2, { children: [
|
|
1283
|
+
icon && /* @__PURE__ */ jsx11("span", { className: "mr-1", children: icon }),
|
|
1284
|
+
title
|
|
1285
|
+
] });
|
|
1286
|
+
return /* @__PURE__ */ jsxs8(Fragment, { children: [
|
|
1287
|
+
/* @__PURE__ */ jsx11("span", { className: separatorClassName, children: separator }),
|
|
1288
|
+
isLast || isNonClickable ? /* @__PURE__ */ jsx11("span", { className: isLast ? activeClassName : linkClassName, children: crumb }) : /* @__PURE__ */ jsx11(Link, { to, className: inactiveLinkClassName, children: crumb })
|
|
1289
|
+
] }, to);
|
|
1290
|
+
}),
|
|
1291
|
+
suffix && /* @__PURE__ */ jsx11("div", { className: "breadcrumb-suffix", children: suffix })
|
|
1292
|
+
]
|
|
1293
|
+
}
|
|
1294
|
+
);
|
|
1295
|
+
}
|
|
1296
|
+
|
|
1297
|
+
// src/components/sidebar/Sidebar.tsx
|
|
1298
|
+
import { useEffect as useEffect5, useState as useState3 } from "react";
|
|
1299
|
+
import { Link as Link2, useLocation as useLocation2 } from "react-router-dom";
|
|
1300
|
+
|
|
1301
|
+
// src/components/tooltip/ToolTip.tsx
|
|
1302
|
+
import { useId as useId2 } from "react";
|
|
1303
|
+
import { Tooltip } from "react-tooltip";
|
|
1304
|
+
import { Fragment as Fragment3, jsx as jsx12, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1305
|
+
var defaultTooltipStyle = {
|
|
1306
|
+
color: "#fff",
|
|
1307
|
+
borderRadius: "5px",
|
|
1308
|
+
zIndex: 999,
|
|
1309
|
+
textAlign: "justify",
|
|
1310
|
+
maxWidth: "300px",
|
|
1311
|
+
whiteSpace: "pre-wrap",
|
|
1312
|
+
wordWrap: "break-word",
|
|
1313
|
+
overflowWrap: "break-word"
|
|
1314
|
+
};
|
|
1315
|
+
function ToolTip({
|
|
1316
|
+
text = "tool tip",
|
|
1317
|
+
placement = "top",
|
|
1318
|
+
delayShow,
|
|
1319
|
+
delayHide,
|
|
1320
|
+
className,
|
|
1321
|
+
tooltipClassName,
|
|
1322
|
+
tooltipStyle,
|
|
1323
|
+
wrapperTabIndex,
|
|
1324
|
+
disabled = false,
|
|
1325
|
+
children
|
|
1326
|
+
}) {
|
|
1327
|
+
const generatedId = useId2();
|
|
1328
|
+
const tooltipId = `eztrak-tooltip-${generatedId.replace(/:/g, "")}`;
|
|
1329
|
+
const tooltipText = String(text ?? "");
|
|
1330
|
+
if (disabled || !tooltipText) {
|
|
1331
|
+
return /* @__PURE__ */ jsx12("span", { className, children });
|
|
1332
|
+
}
|
|
1333
|
+
return /* @__PURE__ */ jsxs9(Fragment3, { children: [
|
|
1334
|
+
/* @__PURE__ */ jsx12(
|
|
1335
|
+
"span",
|
|
1336
|
+
{
|
|
1337
|
+
className,
|
|
1338
|
+
"data-tooltip-id": tooltipId,
|
|
1339
|
+
"data-tooltip-content": tooltipText,
|
|
1340
|
+
tabIndex: wrapperTabIndex,
|
|
1341
|
+
children
|
|
1342
|
+
}
|
|
1343
|
+
),
|
|
1344
|
+
/* @__PURE__ */ jsx12(
|
|
1345
|
+
Tooltip,
|
|
1346
|
+
{
|
|
1347
|
+
id: tooltipId,
|
|
1348
|
+
place: placement,
|
|
1349
|
+
positionStrategy: "fixed",
|
|
1350
|
+
delayShow,
|
|
1351
|
+
delayHide,
|
|
1352
|
+
className: tooltipClassName,
|
|
1353
|
+
style: { ...defaultTooltipStyle, ...tooltipStyle }
|
|
1354
|
+
}
|
|
1355
|
+
)
|
|
1356
|
+
] });
|
|
1357
|
+
}
|
|
1358
|
+
|
|
1359
|
+
// src/components/sidebar/Sidebar.tsx
|
|
1360
|
+
import { jsx as jsx13, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1361
|
+
function Sidebar({
|
|
1362
|
+
className,
|
|
1363
|
+
sideCollapseWidth = "w-20",
|
|
1364
|
+
sidebarWidth = "w-48",
|
|
1365
|
+
header,
|
|
1366
|
+
children,
|
|
1367
|
+
footer,
|
|
1368
|
+
items = [],
|
|
1369
|
+
logoUrl = "",
|
|
1370
|
+
logoAltText = "Logo",
|
|
1371
|
+
collapseButtonText = "\u2B05\uFE0F Collapse",
|
|
1372
|
+
expandButtonText = "\u27A1\uFE0F",
|
|
1373
|
+
location: _location,
|
|
1374
|
+
classNames = {},
|
|
1375
|
+
onCollapseChange,
|
|
1376
|
+
isCollapsed = false,
|
|
1377
|
+
itemDropdownIcon = /* @__PURE__ */ jsx13("span", { children: "\u25BC" }),
|
|
1378
|
+
...rest
|
|
1379
|
+
}) {
|
|
1380
|
+
const location = useLocation2();
|
|
1381
|
+
const [collapsed, setCollapsed] = useState3(isCollapsed);
|
|
1382
|
+
const [, setActiveLink] = useState3(location.pathname);
|
|
1383
|
+
const [subItemsCollapsed, setSubItemsCollapsed] = useState3({});
|
|
1384
|
+
useEffect5(() => {
|
|
1385
|
+
if (onCollapseChange) {
|
|
1386
|
+
onCollapseChange(collapsed);
|
|
1387
|
+
}
|
|
1388
|
+
}, [collapsed, onCollapseChange]);
|
|
1389
|
+
useEffect5(() => {
|
|
1390
|
+
setActiveLink(location.pathname);
|
|
1391
|
+
}, [location]);
|
|
1392
|
+
const toggleGroup = (group) => {
|
|
1393
|
+
setSubItemsCollapsed((prevState) => ({
|
|
1394
|
+
...prevState,
|
|
1395
|
+
[group]: !prevState[group]
|
|
1396
|
+
}));
|
|
1397
|
+
};
|
|
1398
|
+
const isActive = (link) => {
|
|
1399
|
+
return location.pathname.startsWith(link);
|
|
1400
|
+
};
|
|
1401
|
+
return /* @__PURE__ */ jsxs10(
|
|
1402
|
+
"div",
|
|
1403
|
+
{
|
|
1404
|
+
className: `flex flex-col h-screen overflow-hidden ${collapsed ? `${sideCollapseWidth} justify-center items-center collapsed` : `${sidebarWidth}`} transition-all duration-100 ${className ?? ""}`,
|
|
1405
|
+
...rest,
|
|
1406
|
+
children: [
|
|
1407
|
+
logoUrl && /* @__PURE__ */ jsx13(
|
|
1408
|
+
"div",
|
|
1409
|
+
{
|
|
1410
|
+
className: cn(
|
|
1411
|
+
"flex items-center justify-center h-16 border-b border-gray-300",
|
|
1412
|
+
classNames.logoSection
|
|
1413
|
+
),
|
|
1414
|
+
children: /* @__PURE__ */ jsx13("img", { src: logoUrl, alt: logoAltText, className: "h-10" })
|
|
1415
|
+
}
|
|
1416
|
+
),
|
|
1417
|
+
header && /* @__PURE__ */ jsx13("div", { className: "flex items-center justify-between p-4 border-b border-gray-300", children: header }),
|
|
1418
|
+
/* @__PURE__ */ jsx13("nav", { className: cn("flex-grow", classNames.navSection), children: items.map((item, index) => {
|
|
1419
|
+
if (item.subItems) {
|
|
1420
|
+
return /* @__PURE__ */ jsxs10(
|
|
1421
|
+
"div",
|
|
1422
|
+
{
|
|
1423
|
+
className: `my-2 ${item?.subItems && "has-sub-items"}`,
|
|
1424
|
+
children: [
|
|
1425
|
+
/* @__PURE__ */ jsxs10(
|
|
1426
|
+
"div",
|
|
1427
|
+
{
|
|
1428
|
+
onClick: () => toggleGroup(item.name),
|
|
1429
|
+
"data-sidebar-item": item.name,
|
|
1430
|
+
"data-tooltip-id": item.name,
|
|
1431
|
+
className: `flex cursor-pointer dropdown-title-wrapper ${classNames?.navItem ?? ""}`,
|
|
1432
|
+
children: [
|
|
1433
|
+
/* @__PURE__ */ jsx13(
|
|
1434
|
+
ToolTip,
|
|
1435
|
+
{
|
|
1436
|
+
text: item.tooltip || item.name,
|
|
1437
|
+
placement: item.tooltipPlacement || "top",
|
|
1438
|
+
children: /* @__PURE__ */ jsxs10("div", { className: "flex items-center space-x-2", children: [
|
|
1439
|
+
/* @__PURE__ */ jsx13("span", { className: classNames?.navItemText, children: item.icon }),
|
|
1440
|
+
!collapsed && /* @__PURE__ */ jsx13("span", { className: classNames?.navItemText, children: item.name })
|
|
1441
|
+
] })
|
|
1442
|
+
}
|
|
1443
|
+
),
|
|
1444
|
+
!collapsed && /* @__PURE__ */ jsx13(
|
|
1445
|
+
"span",
|
|
1446
|
+
{
|
|
1447
|
+
className: `transform transition-transform ${subItemsCollapsed[item.name] ? "rotate-180" : "rotate-0"}`,
|
|
1448
|
+
children: itemDropdownIcon
|
|
1449
|
+
}
|
|
1450
|
+
)
|
|
1451
|
+
]
|
|
1452
|
+
}
|
|
1453
|
+
),
|
|
1454
|
+
subItemsCollapsed[item.name] && /* @__PURE__ */ jsx13("div", { className: cn("collapse-btn-wrapper", classNames.subItem), children: item.subItems.map((subItem, subIndex) => {
|
|
1455
|
+
if (subItem.component) {
|
|
1456
|
+
const SubItemComponent = subItem.component;
|
|
1457
|
+
return /* @__PURE__ */ jsx13(SubItemComponent, {}, `${index}-${subIndex}`);
|
|
1458
|
+
}
|
|
1459
|
+
return /* @__PURE__ */ jsx13(
|
|
1460
|
+
"div",
|
|
1461
|
+
{
|
|
1462
|
+
className: "w-full",
|
|
1463
|
+
"data-sidebar-item": subItem.name,
|
|
1464
|
+
"data-tooltip-id": subItem.name,
|
|
1465
|
+
children: /* @__PURE__ */ jsx13(
|
|
1466
|
+
ToolTip,
|
|
1467
|
+
{
|
|
1468
|
+
text: item.tooltip || item.name,
|
|
1469
|
+
placement: item.tooltipPlacement || "top",
|
|
1470
|
+
className: "block w-full",
|
|
1471
|
+
children: /* @__PURE__ */ jsxs10(
|
|
1472
|
+
Link2,
|
|
1473
|
+
{
|
|
1474
|
+
to: subItem.link || "#",
|
|
1475
|
+
className: `flex ${classNames?.navItem ?? ""} ${isActive(subItem?.link ?? "") ? "active" : ""} ${item?.itemClassName}`,
|
|
1476
|
+
onClick: () => subItem.link && setActiveLink(subItem.link || ""),
|
|
1477
|
+
title: subItem.tooltip || subItem.name,
|
|
1478
|
+
children: [
|
|
1479
|
+
/* @__PURE__ */ jsx13(
|
|
1480
|
+
"span",
|
|
1481
|
+
{
|
|
1482
|
+
className: classNames.navItemText ?? "text-orange-600",
|
|
1483
|
+
children: subItem.icon
|
|
1484
|
+
}
|
|
1485
|
+
),
|
|
1486
|
+
!collapsed && /* @__PURE__ */ jsx13("span", { className: classNames.navItemText, children: subItem.name })
|
|
1487
|
+
]
|
|
1488
|
+
}
|
|
1489
|
+
)
|
|
1490
|
+
}
|
|
1491
|
+
)
|
|
1492
|
+
},
|
|
1493
|
+
`${index}-${subIndex}`
|
|
1494
|
+
);
|
|
1495
|
+
}) })
|
|
1496
|
+
]
|
|
1497
|
+
},
|
|
1498
|
+
index
|
|
1499
|
+
);
|
|
1500
|
+
}
|
|
1501
|
+
if (item.component) {
|
|
1502
|
+
const ItemComponent = item.component;
|
|
1503
|
+
return /* @__PURE__ */ jsx13(ItemComponent, {}, index);
|
|
1504
|
+
}
|
|
1505
|
+
return /* @__PURE__ */ jsx13(
|
|
1506
|
+
"div",
|
|
1507
|
+
{
|
|
1508
|
+
className: "w-full",
|
|
1509
|
+
"data-sidebar-item": item.name,
|
|
1510
|
+
"data-tooltip-id": item.name,
|
|
1511
|
+
children: /* @__PURE__ */ jsx13(
|
|
1512
|
+
ToolTip,
|
|
1513
|
+
{
|
|
1514
|
+
text: item.tooltip || item.name,
|
|
1515
|
+
placement: item.tooltipPlacement || "top",
|
|
1516
|
+
className: "block w-full",
|
|
1517
|
+
children: /* @__PURE__ */ jsxs10(
|
|
1518
|
+
Link2,
|
|
1519
|
+
{
|
|
1520
|
+
to: item.link || "#",
|
|
1521
|
+
className: `flex ${classNames?.navItem ?? ""} ${isActive(item.link || "") ? "active" : ""} ${item?.itemClassName}`,
|
|
1522
|
+
onClick: () => setActiveLink(item.link || ""),
|
|
1523
|
+
title: item.tooltip || item.name,
|
|
1524
|
+
children: [
|
|
1525
|
+
/* @__PURE__ */ jsx13("span", { className: classNames.navItemText ?? "text-orange-600", children: item.icon }),
|
|
1526
|
+
!collapsed && /* @__PURE__ */ jsx13("span", { className: classNames.navItemText, children: item.name })
|
|
1527
|
+
]
|
|
1528
|
+
}
|
|
1529
|
+
)
|
|
1530
|
+
}
|
|
1531
|
+
)
|
|
1532
|
+
},
|
|
1533
|
+
index
|
|
1534
|
+
);
|
|
1535
|
+
}) }),
|
|
1536
|
+
children,
|
|
1537
|
+
/* @__PURE__ */ jsx13(
|
|
1538
|
+
"button",
|
|
1539
|
+
{
|
|
1540
|
+
onClick: () => setCollapsed(!collapsed),
|
|
1541
|
+
className: cn("", classNames.collapseButton) ?? "p-4 border-t border-gray-300",
|
|
1542
|
+
children: collapsed ? expandButtonText : collapseButtonText
|
|
1543
|
+
}
|
|
1544
|
+
),
|
|
1545
|
+
footer && /* @__PURE__ */ jsx13("div", { className: classNames?.footer ?? "p-4 border-t border-gray-300", children: footer })
|
|
1546
|
+
]
|
|
1547
|
+
}
|
|
1548
|
+
);
|
|
1549
|
+
}
|
|
1550
|
+
|
|
1083
1551
|
// src/components/skeleton/CardSkeleton.tsx
|
|
1084
|
-
import { Fragment, jsx as
|
|
1552
|
+
import { Fragment as Fragment4, jsx as jsx14, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1085
1553
|
var DEFAULT_LINE_WIDTHS = ["w-32", "w-48"];
|
|
1086
1554
|
function shouldShowAvatar(variant, showAvatar) {
|
|
1087
1555
|
return showAvatar ?? variant === "profile";
|
|
@@ -1090,7 +1558,7 @@ function shouldShowImage(variant, showImage) {
|
|
|
1090
1558
|
return showImage ?? variant === "image";
|
|
1091
1559
|
}
|
|
1092
1560
|
function AvatarSkeleton({ className }) {
|
|
1093
|
-
return /* @__PURE__ */
|
|
1561
|
+
return /* @__PURE__ */ jsx14(
|
|
1094
1562
|
"svg",
|
|
1095
1563
|
{
|
|
1096
1564
|
className: cn("w-10 h-10 text-gray-200 dark:text-gray-700", className),
|
|
@@ -1098,7 +1566,7 @@ function AvatarSkeleton({ className }) {
|
|
|
1098
1566
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1099
1567
|
fill: "currentColor",
|
|
1100
1568
|
viewBox: "0 0 20 20",
|
|
1101
|
-
children: /* @__PURE__ */
|
|
1569
|
+
children: /* @__PURE__ */ jsx14("path", { d: "M10 0a10 10 0 1 0 10 10A10.011 10.011 0 0 0 10 0Zm0 5a3 3 0 1 1 0 6 3 3 0 0 1 0-6Zm0 13a8.949 8.949 0 0 1-4.951-1.488A3.987 3.987 0 0 1 9 13h2a3.987 3.987 0 0 1 3.951 3.512A8.949 8.949 0 0 1 10 18Z" })
|
|
1102
1570
|
}
|
|
1103
1571
|
);
|
|
1104
1572
|
}
|
|
@@ -1107,7 +1575,7 @@ function SkeletonBlock({
|
|
|
1107
1575
|
className,
|
|
1108
1576
|
isFirst
|
|
1109
1577
|
}) {
|
|
1110
|
-
return /* @__PURE__ */
|
|
1578
|
+
return /* @__PURE__ */ jsx14(
|
|
1111
1579
|
"div",
|
|
1112
1580
|
{
|
|
1113
1581
|
className: cn(
|
|
@@ -1139,14 +1607,14 @@ function CardSkeleton({
|
|
|
1139
1607
|
const skeletons = Array.from({ length: Math.max(1, count) }, (_, index) => {
|
|
1140
1608
|
const renderAvatar = shouldShowAvatar(variant, showAvatar);
|
|
1141
1609
|
const renderImage = shouldShowImage(variant, showImage);
|
|
1142
|
-
return /* @__PURE__ */
|
|
1610
|
+
return /* @__PURE__ */ jsxs11(
|
|
1143
1611
|
"div",
|
|
1144
1612
|
{
|
|
1145
1613
|
className: cn("animate-pulse md:p-6 dark:border-gray-700", className),
|
|
1146
1614
|
style: { animationDuration, ...style },
|
|
1147
1615
|
...props,
|
|
1148
1616
|
children: [
|
|
1149
|
-
renderImage ? /* @__PURE__ */
|
|
1617
|
+
renderImage ? /* @__PURE__ */ jsx14(
|
|
1150
1618
|
"div",
|
|
1151
1619
|
{
|
|
1152
1620
|
className: cn(
|
|
@@ -1155,9 +1623,9 @@ function CardSkeleton({
|
|
|
1155
1623
|
)
|
|
1156
1624
|
}
|
|
1157
1625
|
) : null,
|
|
1158
|
-
/* @__PURE__ */
|
|
1159
|
-
renderAvatar ? /* @__PURE__ */
|
|
1160
|
-
/* @__PURE__ */
|
|
1626
|
+
/* @__PURE__ */ jsxs11("div", { className: cn("flex items-center mt-4 gap-4", contentClassName), children: [
|
|
1627
|
+
renderAvatar ? /* @__PURE__ */ jsx14(AvatarSkeleton, { className: avatarClassName }) : null,
|
|
1628
|
+
/* @__PURE__ */ jsx14("div", { children: Array.from({ length: Math.max(1, lines) }, (_2, lineIndex) => /* @__PURE__ */ jsx14(
|
|
1161
1629
|
SkeletonBlock,
|
|
1162
1630
|
{
|
|
1163
1631
|
widthClass: lineWidths[lineIndex] ?? lineWidths[lineWidths.length - 1] ?? DEFAULT_LINE_WIDTHS[1],
|
|
@@ -1167,75 +1635,17 @@ function CardSkeleton({
|
|
|
1167
1635
|
lineIndex
|
|
1168
1636
|
)) })
|
|
1169
1637
|
] }),
|
|
1170
|
-
/* @__PURE__ */
|
|
1638
|
+
/* @__PURE__ */ jsx14("span", { className: "sr-only", children: srLabel })
|
|
1171
1639
|
]
|
|
1172
1640
|
},
|
|
1173
1641
|
index
|
|
1174
1642
|
);
|
|
1175
1643
|
});
|
|
1176
|
-
return /* @__PURE__ */
|
|
1177
|
-
}
|
|
1178
|
-
|
|
1179
|
-
// src/components/tooltip/ToolTip.tsx
|
|
1180
|
-
import { useId as useId2 } from "react";
|
|
1181
|
-
import { Tooltip } from "react-tooltip";
|
|
1182
|
-
import { Fragment as Fragment2, jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1183
|
-
var defaultTooltipStyle = {
|
|
1184
|
-
color: "#fff",
|
|
1185
|
-
borderRadius: "5px",
|
|
1186
|
-
zIndex: 999,
|
|
1187
|
-
textAlign: "justify",
|
|
1188
|
-
maxWidth: "300px",
|
|
1189
|
-
whiteSpace: "pre-wrap",
|
|
1190
|
-
wordWrap: "break-word",
|
|
1191
|
-
overflowWrap: "break-word"
|
|
1192
|
-
};
|
|
1193
|
-
function ToolTip({
|
|
1194
|
-
text = "tool tip",
|
|
1195
|
-
placement = "top",
|
|
1196
|
-
delayShow,
|
|
1197
|
-
delayHide,
|
|
1198
|
-
className,
|
|
1199
|
-
tooltipClassName,
|
|
1200
|
-
tooltipStyle,
|
|
1201
|
-
wrapperTabIndex,
|
|
1202
|
-
disabled = false,
|
|
1203
|
-
children
|
|
1204
|
-
}) {
|
|
1205
|
-
const generatedId = useId2();
|
|
1206
|
-
const tooltipId = `eztrak-tooltip-${generatedId.replace(/:/g, "")}`;
|
|
1207
|
-
const tooltipText = String(text ?? "");
|
|
1208
|
-
if (disabled || !tooltipText) {
|
|
1209
|
-
return /* @__PURE__ */ jsx9("span", { className, children });
|
|
1210
|
-
}
|
|
1211
|
-
return /* @__PURE__ */ jsxs7(Fragment2, { children: [
|
|
1212
|
-
/* @__PURE__ */ jsx9(
|
|
1213
|
-
"span",
|
|
1214
|
-
{
|
|
1215
|
-
className,
|
|
1216
|
-
"data-tooltip-id": tooltipId,
|
|
1217
|
-
"data-tooltip-content": tooltipText,
|
|
1218
|
-
tabIndex: wrapperTabIndex,
|
|
1219
|
-
children
|
|
1220
|
-
}
|
|
1221
|
-
),
|
|
1222
|
-
/* @__PURE__ */ jsx9(
|
|
1223
|
-
Tooltip,
|
|
1224
|
-
{
|
|
1225
|
-
id: tooltipId,
|
|
1226
|
-
place: placement,
|
|
1227
|
-
positionStrategy: "fixed",
|
|
1228
|
-
delayShow,
|
|
1229
|
-
delayHide,
|
|
1230
|
-
className: tooltipClassName,
|
|
1231
|
-
style: { ...defaultTooltipStyle, ...tooltipStyle }
|
|
1232
|
-
}
|
|
1233
|
-
)
|
|
1234
|
-
] });
|
|
1644
|
+
return /* @__PURE__ */ jsx14(Fragment4, { children: skeletons });
|
|
1235
1645
|
}
|
|
1236
1646
|
|
|
1237
1647
|
// src/components/tooltip/TooltipText.tsx
|
|
1238
|
-
import { jsx as
|
|
1648
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
1239
1649
|
function TooltipText({
|
|
1240
1650
|
text = "",
|
|
1241
1651
|
maxLength = 20,
|
|
@@ -1255,7 +1665,7 @@ function TooltipText({
|
|
|
1255
1665
|
const displayText = truncateText(fullText, maxLength);
|
|
1256
1666
|
const isTruncated = displayText !== fullText;
|
|
1257
1667
|
const tooltipDisabled = !showTooltip || !hasValue || tooltipWhenTruncatedOnly && !isTruncated;
|
|
1258
|
-
return /* @__PURE__ */
|
|
1668
|
+
return /* @__PURE__ */ jsx15(
|
|
1259
1669
|
ToolTip,
|
|
1260
1670
|
{
|
|
1261
1671
|
text: fullText,
|
|
@@ -1267,24 +1677,24 @@ function TooltipText({
|
|
|
1267
1677
|
tooltipStyle,
|
|
1268
1678
|
wrapperTabIndex: tooltipDisabled ? void 0 : 0,
|
|
1269
1679
|
disabled: tooltipDisabled,
|
|
1270
|
-
children: /* @__PURE__ */
|
|
1680
|
+
children: /* @__PURE__ */ jsx15("span", { className: cn("inline-block max-w-full align-bottom", textClassName), children: displayText })
|
|
1271
1681
|
}
|
|
1272
1682
|
);
|
|
1273
1683
|
}
|
|
1274
1684
|
|
|
1275
1685
|
// src/components/cell-editor/CustomCellEditor.tsx
|
|
1276
1686
|
import {
|
|
1277
|
-
forwardRef,
|
|
1278
|
-
useEffect as
|
|
1687
|
+
forwardRef as forwardRef2,
|
|
1688
|
+
useEffect as useEffect6,
|
|
1279
1689
|
useImperativeHandle,
|
|
1280
1690
|
useMemo,
|
|
1281
1691
|
useRef as useRef5,
|
|
1282
|
-
useState as
|
|
1692
|
+
useState as useState4
|
|
1283
1693
|
} from "react";
|
|
1284
1694
|
import toast from "react-hot-toast";
|
|
1285
|
-
import { jsx as
|
|
1695
|
+
import { jsx as jsx16, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1286
1696
|
function ButtonSpinner() {
|
|
1287
|
-
return /* @__PURE__ */
|
|
1697
|
+
return /* @__PURE__ */ jsxs12(
|
|
1288
1698
|
"svg",
|
|
1289
1699
|
{
|
|
1290
1700
|
className: "animate-spin",
|
|
@@ -1294,7 +1704,7 @@ function ButtonSpinner() {
|
|
|
1294
1704
|
fill: "none",
|
|
1295
1705
|
"aria-hidden": true,
|
|
1296
1706
|
children: [
|
|
1297
|
-
/* @__PURE__ */
|
|
1707
|
+
/* @__PURE__ */ jsx16(
|
|
1298
1708
|
"circle",
|
|
1299
1709
|
{
|
|
1300
1710
|
cx: "12",
|
|
@@ -1305,7 +1715,7 @@ function ButtonSpinner() {
|
|
|
1305
1715
|
strokeOpacity: "0.25"
|
|
1306
1716
|
}
|
|
1307
1717
|
),
|
|
1308
|
-
/* @__PURE__ */
|
|
1718
|
+
/* @__PURE__ */ jsx16(
|
|
1309
1719
|
"path",
|
|
1310
1720
|
{
|
|
1311
1721
|
d: "M12 2a10 10 0 0 1 10 10",
|
|
@@ -1327,7 +1737,7 @@ function normalizeInitialValue(initialValue, inputType) {
|
|
|
1327
1737
|
}
|
|
1328
1738
|
return initialValue;
|
|
1329
1739
|
}
|
|
1330
|
-
var CustomCellEditor =
|
|
1740
|
+
var CustomCellEditor = forwardRef2(
|
|
1331
1741
|
({
|
|
1332
1742
|
value: initialValue,
|
|
1333
1743
|
name,
|
|
@@ -1352,8 +1762,8 @@ var CustomCellEditor = forwardRef(
|
|
|
1352
1762
|
cancelButtonClassName
|
|
1353
1763
|
}, ref) => {
|
|
1354
1764
|
const normalizedInitial = normalizeInitialValue(initialValue, inputType);
|
|
1355
|
-
const [value, setValue] =
|
|
1356
|
-
const [isLoading, setIsLoading] =
|
|
1765
|
+
const [value, setValue] = useState4(normalizedInitial);
|
|
1766
|
+
const [isLoading, setIsLoading] = useState4(false);
|
|
1357
1767
|
const inputRef = useRef5(null);
|
|
1358
1768
|
const selectRef = useRef5(null);
|
|
1359
1769
|
const normalizedOptions = useMemo(() => {
|
|
@@ -1372,7 +1782,7 @@ var CustomCellEditor = forwardRef(
|
|
|
1372
1782
|
isCancelAfterEnd: () => false,
|
|
1373
1783
|
isPopup: () => true
|
|
1374
1784
|
}));
|
|
1375
|
-
|
|
1785
|
+
useEffect6(() => {
|
|
1376
1786
|
if (isDropdown) {
|
|
1377
1787
|
selectRef.current?.focus();
|
|
1378
1788
|
return;
|
|
@@ -1441,7 +1851,7 @@ var CustomCellEditor = forwardRef(
|
|
|
1441
1851
|
const defaultInputClass = "w-48 px-2 py-1 text-sm border border-gray-200 rounded-md bg-white focus:outline-none focus:ring-1 focus:ring-blue-400";
|
|
1442
1852
|
const defaultSaveBtnClass = "px-3 py-1 text-sm font-medium text-white bg-green-500 rounded-md hover:bg-green-600 disabled:opacity-50 whitespace-nowrap shrink-0";
|
|
1443
1853
|
const defaultCancelBtnClass = "px-3 py-1 text-sm font-medium text-white bg-red-500 rounded-md hover:bg-red-600 disabled:opacity-50 whitespace-nowrap shrink-0";
|
|
1444
|
-
return /* @__PURE__ */
|
|
1854
|
+
return /* @__PURE__ */ jsxs12(
|
|
1445
1855
|
"div",
|
|
1446
1856
|
{
|
|
1447
1857
|
className: cn(
|
|
@@ -1450,7 +1860,7 @@ var CustomCellEditor = forwardRef(
|
|
|
1450
1860
|
),
|
|
1451
1861
|
style: containerStyle,
|
|
1452
1862
|
children: [
|
|
1453
|
-
isDropdown ? /* @__PURE__ */
|
|
1863
|
+
isDropdown ? /* @__PURE__ */ jsxs12(
|
|
1454
1864
|
"select",
|
|
1455
1865
|
{
|
|
1456
1866
|
ref: selectRef,
|
|
@@ -1460,11 +1870,11 @@ var CustomCellEditor = forwardRef(
|
|
|
1460
1870
|
className: inputClassName ?? defaultInputClass,
|
|
1461
1871
|
disabled: isLoading,
|
|
1462
1872
|
children: [
|
|
1463
|
-
/* @__PURE__ */
|
|
1464
|
-
normalizedOptions.map((opt) => /* @__PURE__ */
|
|
1873
|
+
/* @__PURE__ */ jsx16("option", { value: "", disabled: true, children: "Select option..." }),
|
|
1874
|
+
normalizedOptions.map((opt) => /* @__PURE__ */ jsx16("option", { value: opt.value, children: opt.label }, opt.value))
|
|
1465
1875
|
]
|
|
1466
1876
|
}
|
|
1467
|
-
) : /* @__PURE__ */
|
|
1877
|
+
) : /* @__PURE__ */ jsx16(
|
|
1468
1878
|
"input",
|
|
1469
1879
|
{
|
|
1470
1880
|
ref: inputRef,
|
|
@@ -1477,7 +1887,7 @@ var CustomCellEditor = forwardRef(
|
|
|
1477
1887
|
disabled: isLoading
|
|
1478
1888
|
}
|
|
1479
1889
|
),
|
|
1480
|
-
/* @__PURE__ */
|
|
1890
|
+
/* @__PURE__ */ jsx16(
|
|
1481
1891
|
"button",
|
|
1482
1892
|
{
|
|
1483
1893
|
type: "button",
|
|
@@ -1486,10 +1896,10 @@ var CustomCellEditor = forwardRef(
|
|
|
1486
1896
|
className: saveButtonClassName ?? (saveButtonStyle ? void 0 : defaultSaveBtnClass),
|
|
1487
1897
|
style: saveButtonStyle,
|
|
1488
1898
|
title: "Save (Enter)",
|
|
1489
|
-
children: isLoading ? loadingIndicator ?? /* @__PURE__ */
|
|
1899
|
+
children: isLoading ? loadingIndicator ?? /* @__PURE__ */ jsx16(ButtonSpinner, {}) : saveButtonContent ?? "Save"
|
|
1490
1900
|
}
|
|
1491
1901
|
),
|
|
1492
|
-
/* @__PURE__ */
|
|
1902
|
+
/* @__PURE__ */ jsx16(
|
|
1493
1903
|
"button",
|
|
1494
1904
|
{
|
|
1495
1905
|
type: "button",
|
|
@@ -1509,10 +1919,10 @@ var CustomCellEditor = forwardRef(
|
|
|
1509
1919
|
CustomCellEditor.displayName = "CustomCellEditor";
|
|
1510
1920
|
|
|
1511
1921
|
// src/components/popup-cell-renderer/PopupCellRenderer.tsx
|
|
1512
|
-
import { useRef as useRef6, useState as
|
|
1922
|
+
import { useRef as useRef6, useState as useState5 } from "react";
|
|
1513
1923
|
import Tippy from "@tippyjs/react";
|
|
1514
1924
|
import { BiDotsVerticalRounded } from "react-icons/bi";
|
|
1515
|
-
import { jsx as
|
|
1925
|
+
import { jsx as jsx17, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1516
1926
|
function PopupCellRenderer({
|
|
1517
1927
|
dropDownContent,
|
|
1518
1928
|
actionIcon: ActionIcon = BiDotsVerticalRounded,
|
|
@@ -1526,7 +1936,7 @@ function PopupCellRenderer({
|
|
|
1526
1936
|
ariaLabel = "Row actions",
|
|
1527
1937
|
openOnHover = false
|
|
1528
1938
|
}) {
|
|
1529
|
-
const [visible, setVisible] =
|
|
1939
|
+
const [visible, setVisible] = useState5(false);
|
|
1530
1940
|
const instanceRef = useRef6(null);
|
|
1531
1941
|
const show = () => setVisible(true);
|
|
1532
1942
|
const hide = () => {
|
|
@@ -1547,7 +1957,7 @@ function PopupCellRenderer({
|
|
|
1547
1957
|
visible,
|
|
1548
1958
|
onClickOutside: hide
|
|
1549
1959
|
};
|
|
1550
|
-
return /* @__PURE__ */
|
|
1960
|
+
return /* @__PURE__ */ jsx17("div", { className: "flex h-full", children: /* @__PURE__ */ jsx17(
|
|
1551
1961
|
Tippy,
|
|
1552
1962
|
{
|
|
1553
1963
|
content,
|
|
@@ -1565,7 +1975,7 @@ function PopupCellRenderer({
|
|
|
1565
1975
|
},
|
|
1566
1976
|
...hoverOrClickProps,
|
|
1567
1977
|
...tippyProps,
|
|
1568
|
-
children: /* @__PURE__ */
|
|
1978
|
+
children: /* @__PURE__ */ jsxs13(
|
|
1569
1979
|
"button",
|
|
1570
1980
|
{
|
|
1571
1981
|
type: "button",
|
|
@@ -1577,7 +1987,7 @@ function PopupCellRenderer({
|
|
|
1577
1987
|
"aria-label": ariaLabel,
|
|
1578
1988
|
children: [
|
|
1579
1989
|
!hideTitle && title,
|
|
1580
|
-
/* @__PURE__ */
|
|
1990
|
+
/* @__PURE__ */ jsx17(ActionIcon, { "aria-hidden": true })
|
|
1581
1991
|
]
|
|
1582
1992
|
}
|
|
1583
1993
|
)
|
|
@@ -1614,7 +2024,7 @@ var ROW_ACTION_PRESETS = {
|
|
|
1614
2024
|
};
|
|
1615
2025
|
|
|
1616
2026
|
// src/components/row-actions/ActionMenuItem.tsx
|
|
1617
|
-
import { jsx as
|
|
2027
|
+
import { jsx as jsx18, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1618
2028
|
function ActionMenuItem({
|
|
1619
2029
|
label,
|
|
1620
2030
|
icon: Icon,
|
|
@@ -1635,7 +2045,7 @@ function ActionMenuItem({
|
|
|
1635
2045
|
onClick
|
|
1636
2046
|
}) {
|
|
1637
2047
|
const tooltipText = tooltip ?? label;
|
|
1638
|
-
return /* @__PURE__ */
|
|
2048
|
+
return /* @__PURE__ */ jsx18(
|
|
1639
2049
|
ToolTip,
|
|
1640
2050
|
{
|
|
1641
2051
|
text: tooltipText,
|
|
@@ -1646,7 +2056,7 @@ function ActionMenuItem({
|
|
|
1646
2056
|
tooltipClassName,
|
|
1647
2057
|
tooltipStyle: { ...ROW_ACTION_DEFAULT_MENU_TOOLTIP_STYLE, ...tooltipStyle },
|
|
1648
2058
|
className: showLabel ? "block w-full" : "inline-flex",
|
|
1649
|
-
children: /* @__PURE__ */
|
|
2059
|
+
children: /* @__PURE__ */ jsxs14(
|
|
1650
2060
|
"button",
|
|
1651
2061
|
{
|
|
1652
2062
|
type: "button",
|
|
@@ -1666,7 +2076,7 @@ function ActionMenuItem({
|
|
|
1666
2076
|
className
|
|
1667
2077
|
),
|
|
1668
2078
|
children: [
|
|
1669
|
-
Icon ? /* @__PURE__ */
|
|
2079
|
+
Icon ? /* @__PURE__ */ jsx18(
|
|
1670
2080
|
Icon,
|
|
1671
2081
|
{
|
|
1672
2082
|
className: cn("shrink-0", iconClassName),
|
|
@@ -1674,7 +2084,7 @@ function ActionMenuItem({
|
|
|
1674
2084
|
size: iconSize
|
|
1675
2085
|
}
|
|
1676
2086
|
) : null,
|
|
1677
|
-
showLabel ? /* @__PURE__ */
|
|
2087
|
+
showLabel ? /* @__PURE__ */ jsx18("span", { className: labelClassName, children: label }) : null
|
|
1678
2088
|
]
|
|
1679
2089
|
}
|
|
1680
2090
|
)
|
|
@@ -1732,7 +2142,7 @@ function resolveActions(actions, data, hasPermission, presets) {
|
|
|
1732
2142
|
}
|
|
1733
2143
|
|
|
1734
2144
|
// src/components/row-actions/RowActions.tsx
|
|
1735
|
-
import { Fragment as
|
|
2145
|
+
import { Fragment as Fragment5, jsx as jsx19 } from "react/jsx-runtime";
|
|
1736
2146
|
function runAction(action, data, hide, confirmFn = confirmationAlert) {
|
|
1737
2147
|
if (!action.onClick) {
|
|
1738
2148
|
if (action.closeOnClick) hide?.();
|
|
@@ -1786,7 +2196,7 @@ function RowActions({
|
|
|
1786
2196
|
};
|
|
1787
2197
|
const renderDefaultItem = (action, hide, showLabel = true) => {
|
|
1788
2198
|
if (action.type === "divider") {
|
|
1789
|
-
return /* @__PURE__ */
|
|
2199
|
+
return /* @__PURE__ */ jsx19(
|
|
1790
2200
|
"div",
|
|
1791
2201
|
{
|
|
1792
2202
|
role: "separator",
|
|
@@ -1796,9 +2206,9 @@ function RowActions({
|
|
|
1796
2206
|
);
|
|
1797
2207
|
}
|
|
1798
2208
|
if (action.content) {
|
|
1799
|
-
return /* @__PURE__ */
|
|
2209
|
+
return /* @__PURE__ */ jsx19("div", { className: action.className, children: action.content }, action.key);
|
|
1800
2210
|
}
|
|
1801
|
-
return /* @__PURE__ */
|
|
2211
|
+
return /* @__PURE__ */ jsx19(
|
|
1802
2212
|
ActionMenuItem,
|
|
1803
2213
|
{
|
|
1804
2214
|
label: action.label,
|
|
@@ -1825,15 +2235,15 @@ function RowActions({
|
|
|
1825
2235
|
const renderItems = (hide, showLabel = true) => resolved.map((action) => {
|
|
1826
2236
|
const defaultItem = renderDefaultItem(action, hide, showLabel);
|
|
1827
2237
|
if (!renderItem) return defaultItem;
|
|
1828
|
-
return /* @__PURE__ */
|
|
2238
|
+
return /* @__PURE__ */ jsx19("div", { children: renderItem(action, { data, hide: hide ?? (() => void 0), defaultItem }) }, action.key);
|
|
1829
2239
|
});
|
|
1830
2240
|
if (mode === "inline") {
|
|
1831
2241
|
const inlineItems = renderItems(void 0, false);
|
|
1832
|
-
return /* @__PURE__ */
|
|
2242
|
+
return /* @__PURE__ */ jsx19("div", { className: cn("flex h-full items-center justify-center gap-1", className), children: inlineItems });
|
|
1833
2243
|
}
|
|
1834
2244
|
const triggerTooltipText = triggerTooltip === false ? void 0 : triggerTooltip;
|
|
1835
2245
|
const buildMenu = (hide) => {
|
|
1836
|
-
const defaultMenu = /* @__PURE__ */
|
|
2246
|
+
const defaultMenu = /* @__PURE__ */ jsx19(
|
|
1837
2247
|
"div",
|
|
1838
2248
|
{
|
|
1839
2249
|
className: cn(
|
|
@@ -1852,14 +2262,14 @@ function RowActions({
|
|
|
1852
2262
|
});
|
|
1853
2263
|
};
|
|
1854
2264
|
if (renderTrigger) {
|
|
1855
|
-
return /* @__PURE__ */
|
|
2265
|
+
return /* @__PURE__ */ jsx19(Fragment5, { children: renderTrigger({
|
|
1856
2266
|
data,
|
|
1857
2267
|
actions: resolved,
|
|
1858
2268
|
hide: () => void 0,
|
|
1859
2269
|
defaultMenu: buildMenu(() => void 0)
|
|
1860
2270
|
}) });
|
|
1861
2271
|
}
|
|
1862
|
-
return /* @__PURE__ */
|
|
2272
|
+
return /* @__PURE__ */ jsx19(
|
|
1863
2273
|
ToolTip,
|
|
1864
2274
|
{
|
|
1865
2275
|
text: triggerTooltipText,
|
|
@@ -1870,7 +2280,7 @@ function RowActions({
|
|
|
1870
2280
|
tooltipClassName,
|
|
1871
2281
|
tooltipStyle,
|
|
1872
2282
|
className: "flex h-full items-center justify-center",
|
|
1873
|
-
children: /* @__PURE__ */
|
|
2283
|
+
children: /* @__PURE__ */ jsx19(
|
|
1874
2284
|
PopupCellRenderer,
|
|
1875
2285
|
{
|
|
1876
2286
|
params: { data },
|
|
@@ -1891,7 +2301,7 @@ function RowActions({
|
|
|
1891
2301
|
// src/components/table-error-boundary/TableErrorBoundary.tsx
|
|
1892
2302
|
import { useMemo as useMemo2 } from "react";
|
|
1893
2303
|
import { FaArrowsRotate, FaTriangleExclamation } from "react-icons/fa6";
|
|
1894
|
-
import { Fragment as
|
|
2304
|
+
import { Fragment as Fragment6, jsx as jsx20, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1895
2305
|
var TableErrorBoundary = ({
|
|
1896
2306
|
isError,
|
|
1897
2307
|
isLoading = false,
|
|
@@ -1908,7 +2318,7 @@ var TableErrorBoundary = ({
|
|
|
1908
2318
|
return "Unable to load table data. Please try again.";
|
|
1909
2319
|
}, [error, errorMessage]);
|
|
1910
2320
|
if (isLoading && !isError) {
|
|
1911
|
-
return /* @__PURE__ */
|
|
2321
|
+
return /* @__PURE__ */ jsx20(
|
|
1912
2322
|
"div",
|
|
1913
2323
|
{
|
|
1914
2324
|
className: cn(
|
|
@@ -1919,12 +2329,12 @@ var TableErrorBoundary = ({
|
|
|
1919
2329
|
role: "status",
|
|
1920
2330
|
"aria-live": "polite",
|
|
1921
2331
|
"aria-busy": "true",
|
|
1922
|
-
children: /* @__PURE__ */
|
|
2332
|
+
children: /* @__PURE__ */ jsx20(Loader, { size: "40px" })
|
|
1923
2333
|
}
|
|
1924
2334
|
);
|
|
1925
2335
|
}
|
|
1926
2336
|
if (isError) {
|
|
1927
|
-
return /* @__PURE__ */
|
|
2337
|
+
return /* @__PURE__ */ jsxs15(
|
|
1928
2338
|
"div",
|
|
1929
2339
|
{
|
|
1930
2340
|
className: cn(
|
|
@@ -1935,7 +2345,7 @@ var TableErrorBoundary = ({
|
|
|
1935
2345
|
role: "alert",
|
|
1936
2346
|
"aria-live": "assertive",
|
|
1937
2347
|
children: [
|
|
1938
|
-
/* @__PURE__ */
|
|
2348
|
+
/* @__PURE__ */ jsx20(
|
|
1939
2349
|
FaTriangleExclamation,
|
|
1940
2350
|
{
|
|
1941
2351
|
className: "text-red-500",
|
|
@@ -1943,11 +2353,11 @@ var TableErrorBoundary = ({
|
|
|
1943
2353
|
"aria-hidden": true
|
|
1944
2354
|
}
|
|
1945
2355
|
),
|
|
1946
|
-
/* @__PURE__ */
|
|
1947
|
-
/* @__PURE__ */
|
|
1948
|
-
/* @__PURE__ */
|
|
2356
|
+
/* @__PURE__ */ jsxs15("div", { className: "max-w-md space-y-1", children: [
|
|
2357
|
+
/* @__PURE__ */ jsx20("p", { className: "text-base font-semibold text-gray-800", children: "Failed to load data" }),
|
|
2358
|
+
/* @__PURE__ */ jsx20("p", { className: "text-sm text-gray-600", children: message })
|
|
1949
2359
|
] }),
|
|
1950
|
-
refetch && /* @__PURE__ */
|
|
2360
|
+
refetch && /* @__PURE__ */ jsxs15(
|
|
1951
2361
|
"button",
|
|
1952
2362
|
{
|
|
1953
2363
|
type: "button",
|
|
@@ -1955,7 +2365,7 @@ var TableErrorBoundary = ({
|
|
|
1955
2365
|
disabled: isLoading,
|
|
1956
2366
|
className: "inline-flex items-center gap-2 rounded-lg bg-primary-150 px-4 py-2 text-sm font-medium text-white transition-colors hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-60",
|
|
1957
2367
|
children: [
|
|
1958
|
-
/* @__PURE__ */
|
|
2368
|
+
/* @__PURE__ */ jsx20(FaArrowsRotate, { className: cn(isLoading && "animate-spin") }),
|
|
1959
2369
|
isLoading ? "Retrying..." : "Try again"
|
|
1960
2370
|
]
|
|
1961
2371
|
}
|
|
@@ -1964,7 +2374,7 @@ var TableErrorBoundary = ({
|
|
|
1964
2374
|
}
|
|
1965
2375
|
);
|
|
1966
2376
|
}
|
|
1967
|
-
return /* @__PURE__ */
|
|
2377
|
+
return /* @__PURE__ */ jsx20(Fragment6, { children });
|
|
1968
2378
|
};
|
|
1969
2379
|
|
|
1970
2380
|
export {
|
|
@@ -1978,8 +2388,13 @@ export {
|
|
|
1978
2388
|
SearchInput,
|
|
1979
2389
|
Loader,
|
|
1980
2390
|
Modal,
|
|
1981
|
-
|
|
2391
|
+
Button,
|
|
2392
|
+
Card,
|
|
2393
|
+
Header,
|
|
2394
|
+
Breadcrumbs,
|
|
1982
2395
|
ToolTip,
|
|
2396
|
+
Sidebar,
|
|
2397
|
+
CardSkeleton,
|
|
1983
2398
|
TooltipText,
|
|
1984
2399
|
CustomCellEditor,
|
|
1985
2400
|
PopupCellRenderer,
|
|
@@ -1993,4 +2408,4 @@ export {
|
|
|
1993
2408
|
RowActions,
|
|
1994
2409
|
TableErrorBoundary
|
|
1995
2410
|
};
|
|
1996
|
-
//# sourceMappingURL=chunk-
|
|
2411
|
+
//# sourceMappingURL=chunk-DFGYKOJF.mjs.map
|