@eztrak/shared 0.11.0 → 0.12.0

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/index.js CHANGED
@@ -33,6 +33,7 @@ __export(src_exports, {
33
33
  CardSkeleton: () => CardSkeleton,
34
34
  CustomCellEditor: () => CustomCellEditor,
35
35
  CustomPagination: () => CustomPagination,
36
+ DropdownFilter: () => DropdownFilter,
36
37
  EztrakTabs: () => EztrakTabs,
37
38
  Loader: () => Loader,
38
39
  Modal: () => Modal,
@@ -50,6 +51,7 @@ __export(src_exports, {
50
51
  convertCommaDataToArray: () => convertCommaDataToArray,
51
52
  currencyFormatter: () => currencyFormatter,
52
53
  deserializeJson: () => deserializeJson,
54
+ dropdownStyles: () => dropdownStyles,
53
55
  flattenTableData: () => flattenTableData,
54
56
  formatDate: () => formatDate,
55
57
  formatDateTime: () => formatDateTime,
@@ -1062,9 +1064,119 @@ function CustomPagination({
1062
1064
  );
1063
1065
  }
1064
1066
 
1065
- // src/components/search-filters/ResetFiltersButton.tsx
1067
+ // src/components/search-filters/DropdownFilter.tsx
1068
+ var import_react_select = __toESM(require("react-select"));
1066
1069
  var import_react_router_dom2 = require("react-router-dom");
1070
+
1071
+ // src/components/search-filters/dropdownStyles.ts
1072
+ var themeColors = {
1073
+ primary: "#FF7335",
1074
+ primaryHover: "#E65C2E",
1075
+ lightBackground: "#FFF3EB",
1076
+ textColor: "black",
1077
+ white: "white"
1078
+ };
1079
+ var dropdownStyles = (_borderRadius = "5px") => ({
1080
+ control: (provided, state) => ({
1081
+ ...provided,
1082
+ fontSize: "14px",
1083
+ padding: "4px 8px",
1084
+ minWidth: "180px",
1085
+ borderRadius: "5px",
1086
+ cursor: "pointer",
1087
+ borderColor: state.isFocused ? themeColors.primary : "#e0e0e0",
1088
+ boxShadow: state.isFocused ? "0 0 0 2px rgba(255, 115, 53, 0.3)" : "none",
1089
+ "&:hover": {
1090
+ borderColor: themeColors.primary
1091
+ },
1092
+ transition: "border-color 0.2s, box-shadow 0.2s",
1093
+ zIndex: 50
1094
+ }),
1095
+ option: (provided, state) => ({
1096
+ ...provided,
1097
+ fontSize: "14px",
1098
+ backgroundColor: state.isSelected ? themeColors.primary : state.isFocused ? themeColors.lightBackground : themeColors.white,
1099
+ borderRadius: "5px",
1100
+ cursor: "pointer",
1101
+ borderColor: state.isFocused ? themeColors.primary : "#e0e0e0",
1102
+ color: state.isSelected ? themeColors.white : state.isFocused ? themeColors.primary : themeColors.textColor,
1103
+ "&:hover": {
1104
+ backgroundColor: themeColors.lightBackground,
1105
+ color: themeColors.primary
1106
+ },
1107
+ "&:active": {
1108
+ backgroundColor: themeColors.primary,
1109
+ color: themeColors.white
1110
+ },
1111
+ transition: "background-color 0.2s, color 0.2s",
1112
+ zIndex: 50
1113
+ }),
1114
+ singleValue: (provided) => ({
1115
+ ...provided,
1116
+ color: themeColors.textColor,
1117
+ zIndex: 50
1118
+ }),
1119
+ menu: (provided) => ({
1120
+ ...provided,
1121
+ borderRadius: "5px",
1122
+ boxShadow: "0 4px 6px rgba(0, 0, 0, 0.1)",
1123
+ marginTop: "4px",
1124
+ zIndex: 50
1125
+ }),
1126
+ dropdownIndicator: (provided) => ({
1127
+ ...provided,
1128
+ color: themeColors.primary,
1129
+ "&:hover": {
1130
+ color: themeColors.primaryHover
1131
+ },
1132
+ zIndex: 50
1133
+ }),
1134
+ indicatorSeparator: () => ({
1135
+ display: "none"
1136
+ })
1137
+ });
1138
+
1139
+ // src/components/search-filters/DropdownFilter.tsx
1067
1140
  var import_jsx_runtime3 = require("react/jsx-runtime");
1141
+ function DropdownFilter({
1142
+ name,
1143
+ valueKey = "id",
1144
+ options,
1145
+ placeholder,
1146
+ borderRadius = "20px",
1147
+ ...otherProps
1148
+ }) {
1149
+ const [searchParams, setSearchParams] = (0, import_react_router_dom2.useSearchParams)();
1150
+ const currentValue = searchParams.get(name);
1151
+ const selectedOption = currentValue ? options?.find(
1152
+ (option) => option[valueKey]?.toString() === currentValue
1153
+ ) ?? null : null;
1154
+ const handleChange = (selected) => {
1155
+ setSearchParams((prev) => {
1156
+ if (!selected || selected[valueKey] === "") {
1157
+ prev.delete(name);
1158
+ } else {
1159
+ prev.set(name, String(selected[valueKey]));
1160
+ }
1161
+ return prev;
1162
+ });
1163
+ };
1164
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1165
+ import_react_select.default,
1166
+ {
1167
+ placeholder: placeholder ?? `Select ${name}`,
1168
+ value: selectedOption,
1169
+ onChange: handleChange,
1170
+ options,
1171
+ styles: dropdownStyles(borderRadius),
1172
+ ...otherProps
1173
+ }
1174
+ );
1175
+ }
1176
+
1177
+ // src/components/search-filters/ResetFiltersButton.tsx
1178
+ var import_react_router_dom3 = require("react-router-dom");
1179
+ var import_jsx_runtime4 = require("react/jsx-runtime");
1068
1180
  var BASE_STYLES = "inline-flex items-center gap-1.5 px-5 py-3 rounded-md text-sm font-medium transition-colors duration-200 focus:outline-none disabled:cursor-not-allowed disabled:opacity-50";
1069
1181
  var VARIANTS = {
1070
1182
  primary: "bg-white text-secondary border border-secondary hover:bg-lightGray hover:text-black",
@@ -1079,7 +1191,7 @@ function ResetIcon({
1079
1191
  size = 16,
1080
1192
  className
1081
1193
  }) {
1082
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
1194
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
1083
1195
  "svg",
1084
1196
  {
1085
1197
  width: size,
@@ -1093,10 +1205,10 @@ function ResetIcon({
1093
1205
  "aria-hidden": "true",
1094
1206
  className,
1095
1207
  children: [
1096
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("path", { d: "M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8" }),
1097
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("path", { d: "M21 3v5h-5" }),
1098
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("path", { d: "M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16" }),
1099
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("path", { d: "M8 16H3v5" })
1208
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8" }),
1209
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M21 3v5h-5" }),
1210
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16" }),
1211
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M8 16H3v5" })
1100
1212
  ]
1101
1213
  }
1102
1214
  );
@@ -1110,13 +1222,13 @@ function ResetFiltersButton({
1110
1222
  onReset,
1111
1223
  disabled = false
1112
1224
  }) {
1113
- const [, setSearchParams] = (0, import_react_router_dom2.useSearchParams)();
1225
+ const [, setSearchParams] = (0, import_react_router_dom3.useSearchParams)();
1114
1226
  const handleReset = () => {
1115
1227
  setSearchParams({}, { replace: true });
1116
1228
  onReset?.();
1117
1229
  };
1118
- const resolvedIcon = icon === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ResetIcon, { size: 16 }) : icon;
1119
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
1230
+ const resolvedIcon = icon === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(ResetIcon, { size: 16 }) : icon;
1231
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
1120
1232
  "button",
1121
1233
  {
1122
1234
  type: "button",
@@ -1134,8 +1246,8 @@ function ResetFiltersButton({
1134
1246
  // src/components/search-filters/SearchInput.tsx
1135
1247
  var import_react4 = require("react");
1136
1248
  var import_fi = require("react-icons/fi");
1137
- var import_react_router_dom3 = require("react-router-dom");
1138
- var import_jsx_runtime4 = require("react/jsx-runtime");
1249
+ var import_react_router_dom4 = require("react-router-dom");
1250
+ var import_jsx_runtime5 = require("react/jsx-runtime");
1139
1251
  function SearchInput({
1140
1252
  placeholder = "Search...",
1141
1253
  searchBtn = "",
@@ -1152,7 +1264,7 @@ function SearchInput({
1152
1264
  defaultValue,
1153
1265
  ...props
1154
1266
  }) {
1155
- const [searchParams, setSearchParams] = (0, import_react_router_dom3.useSearchParams)();
1267
+ const [searchParams, setSearchParams] = (0, import_react_router_dom4.useSearchParams)();
1156
1268
  const queryParam = searchParams.get(defaultParam) || defaultValue || "";
1157
1269
  const [inputValue, setInputValue] = (0, import_react4.useState)(queryParam);
1158
1270
  const debounceTimerRef = (0, import_react4.useRef)(null);
@@ -1204,7 +1316,7 @@ function SearchInput({
1204
1316
  }
1205
1317
  };
1206
1318
  }, []);
1207
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
1319
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
1208
1320
  "form",
1209
1321
  {
1210
1322
  onSubmit: handleSearch,
@@ -1213,7 +1325,7 @@ function SearchInput({
1213
1325
  searchWrapperClass
1214
1326
  ),
1215
1327
  children: [
1216
- showIcon && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
1328
+ showIcon && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1217
1329
  "button",
1218
1330
  {
1219
1331
  type: "submit",
@@ -1221,7 +1333,7 @@ function SearchInput({
1221
1333
  "bg-white text-secondary rounded-full flex items-center justify-center w-10 h-10",
1222
1334
  searchBtn
1223
1335
  ),
1224
- children: customIcon ? customIcon : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
1336
+ children: customIcon ? customIcon : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1225
1337
  import_fi.FiSearch,
1226
1338
  {
1227
1339
  className: cn("h-5 w-5 text-gray-400", searchIconClassName)
@@ -1229,7 +1341,7 @@ function SearchInput({
1229
1341
  )
1230
1342
  }
1231
1343
  ),
1232
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
1344
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1233
1345
  "input",
1234
1346
  {
1235
1347
  value: inputValue,
@@ -1254,9 +1366,9 @@ var import_fa = require("react-icons/fa");
1254
1366
  var import_io5 = require("react-icons/io5");
1255
1367
 
1256
1368
  // src/components/Loader/Loader.tsx
1257
- var import_jsx_runtime5 = require("react/jsx-runtime");
1369
+ var import_jsx_runtime6 = require("react/jsx-runtime");
1258
1370
  var Loader = ({ className, color = "#F54C00", size = "50px", speed = "1s" }) => {
1259
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: `loader`, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1371
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: `loader`, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1260
1372
  "div",
1261
1373
  {
1262
1374
  className: `spinner ${className}`,
@@ -1273,7 +1385,7 @@ var Loader = ({ className, color = "#F54C00", size = "50px", speed = "1s" }) =>
1273
1385
  };
1274
1386
 
1275
1387
  // src/components/modal/Modal.tsx
1276
- var import_jsx_runtime6 = require("react/jsx-runtime");
1388
+ var import_jsx_runtime7 = require("react/jsx-runtime");
1277
1389
  function Modal({
1278
1390
  isOpen,
1279
1391
  onClose,
@@ -1314,7 +1426,7 @@ function Modal({
1314
1426
  document.body.style.overflow = "unset";
1315
1427
  };
1316
1428
  }, [isOpen, onClose, closeOnEscape]);
1317
- const modalContent = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_framer_motion.AnimatePresence, { children: isOpen && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
1429
+ const modalContent = /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_framer_motion.AnimatePresence, { children: isOpen && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
1318
1430
  "div",
1319
1431
  {
1320
1432
  className: "fixed inset-0 bg-gray-500 bg-opacity-50 flex justify-center items-center z-1000 p-4",
@@ -1333,7 +1445,7 @@ function Modal({
1333
1445
  zIndex
1334
1446
  },
1335
1447
  children: [
1336
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
1448
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
1337
1449
  import_framer_motion.motion.div,
1338
1450
  {
1339
1451
  ref: modalRef,
@@ -1354,7 +1466,7 @@ function Modal({
1354
1466
  // Ensure modal doesn't exceed viewport height
1355
1467
  },
1356
1468
  children: [
1357
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
1469
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
1358
1470
  "div",
1359
1471
  {
1360
1472
  style: {
@@ -1362,43 +1474,43 @@ function Modal({
1362
1474
  },
1363
1475
  className: "sticky top-0 z-10 flex justify-between items-center bg-white text-2xl p-8 pb-4 rounded-t-3xl",
1364
1476
  children: [
1365
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("h2", { className: "font-semibold", children: title }),
1366
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "flex items-center space-x-4", children: [
1367
- onPrint && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
1477
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("h2", { className: "font-semibold", children: title }),
1478
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex items-center space-x-4", children: [
1479
+ onPrint && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
1368
1480
  "button",
1369
1481
  {
1370
1482
  onClick: onPrint,
1371
1483
  className: "flex items-center gap-1 hover:text-gray-300 text-sm border p-1 rounded",
1372
1484
  children: [
1373
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_fa.FaPrint, { name: "FaPrint" }),
1374
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: "Print" })
1485
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_fa.FaPrint, { name: "FaPrint" }),
1486
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { children: "Print" })
1375
1487
  ]
1376
1488
  }
1377
1489
  ),
1378
- onExport && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
1490
+ onExport && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
1379
1491
  "button",
1380
1492
  {
1381
1493
  onClick: onExport,
1382
1494
  className: "flex items-center gap-1 hover:text-gray-300 text-sm border p-1 rounded",
1383
1495
  children: [
1384
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_fa.FaFileExport, {}),
1385
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: "Export" })
1496
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_fa.FaFileExport, {}),
1497
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { children: "Export" })
1386
1498
  ]
1387
1499
  }
1388
1500
  ),
1389
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1501
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1390
1502
  "button",
1391
1503
  {
1392
1504
  onClick: onClose,
1393
1505
  className: "px-2 hover:opacity-70 transition-opacity",
1394
- children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_io5.IoCloseCircleOutline, { color: "#8898AA", size: 25 })
1506
+ children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_io5.IoCloseCircleOutline, { color: "#8898AA", size: 25 })
1395
1507
  }
1396
1508
  )
1397
1509
  ] })
1398
1510
  ]
1399
1511
  }
1400
1512
  ),
1401
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1513
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1402
1514
  "div",
1403
1515
  {
1404
1516
  className: cn(
@@ -1408,7 +1520,7 @@ function Modal({
1408
1520
  children
1409
1521
  }
1410
1522
  ),
1411
- footer && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1523
+ footer && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1412
1524
  "div",
1413
1525
  {
1414
1526
  className: cn("sticky bottom-0 flex justify-end p-4 space-x-4 border-t bg-white ", footerClassName),
@@ -1422,7 +1534,7 @@ function Modal({
1422
1534
  ]
1423
1535
  }
1424
1536
  ),
1425
- isLoading && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1537
+ isLoading && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1426
1538
  "div",
1427
1539
  {
1428
1540
  className: "fixed inset-0 flex items-center justify-center bg-gray-200/60",
@@ -1431,7 +1543,7 @@ function Modal({
1431
1543
  "aria-live": "polite",
1432
1544
  role: "status",
1433
1545
  onClick: (e) => e.stopPropagation(),
1434
- children: customLoader ? customLoader : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Loader, { size: "48px" })
1546
+ children: customLoader ? customLoader : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Loader, { size: "48px" })
1435
1547
  }
1436
1548
  )
1437
1549
  ]
@@ -1447,7 +1559,7 @@ function Modal({
1447
1559
  }
1448
1560
 
1449
1561
  // src/components/skeleton/CardSkeleton.tsx
1450
- var import_jsx_runtime7 = require("react/jsx-runtime");
1562
+ var import_jsx_runtime8 = require("react/jsx-runtime");
1451
1563
  var DEFAULT_LINE_WIDTHS = ["w-32", "w-48"];
1452
1564
  function shouldShowAvatar(variant, showAvatar) {
1453
1565
  return showAvatar ?? variant === "profile";
@@ -1456,7 +1568,7 @@ function shouldShowImage(variant, showImage) {
1456
1568
  return showImage ?? variant === "image";
1457
1569
  }
1458
1570
  function AvatarSkeleton({ className }) {
1459
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1571
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1460
1572
  "svg",
1461
1573
  {
1462
1574
  className: cn("w-10 h-10 text-gray-200 dark:text-gray-700", className),
@@ -1464,7 +1576,7 @@ function AvatarSkeleton({ className }) {
1464
1576
  xmlns: "http://www.w3.org/2000/svg",
1465
1577
  fill: "currentColor",
1466
1578
  viewBox: "0 0 20 20",
1467
- children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("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" })
1579
+ children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("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" })
1468
1580
  }
1469
1581
  );
1470
1582
  }
@@ -1473,7 +1585,7 @@ function SkeletonBlock({
1473
1585
  className,
1474
1586
  isFirst
1475
1587
  }) {
1476
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1588
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1477
1589
  "div",
1478
1590
  {
1479
1591
  className: cn(
@@ -1505,14 +1617,14 @@ function CardSkeleton({
1505
1617
  const skeletons = Array.from({ length: Math.max(1, count) }, (_, index) => {
1506
1618
  const renderAvatar = shouldShowAvatar(variant, showAvatar);
1507
1619
  const renderImage = shouldShowImage(variant, showImage);
1508
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
1620
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
1509
1621
  "div",
1510
1622
  {
1511
1623
  className: cn("animate-pulse md:p-6 dark:border-gray-700", className),
1512
1624
  style: { animationDuration, ...style },
1513
1625
  ...props,
1514
1626
  children: [
1515
- renderImage ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1627
+ renderImage ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1516
1628
  "div",
1517
1629
  {
1518
1630
  className: cn(
@@ -1521,9 +1633,9 @@ function CardSkeleton({
1521
1633
  )
1522
1634
  }
1523
1635
  ) : null,
1524
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: cn("flex items-center mt-4 gap-4", contentClassName), children: [
1525
- renderAvatar ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(AvatarSkeleton, { className: avatarClassName }) : null,
1526
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { children: Array.from({ length: Math.max(1, lines) }, (_2, lineIndex) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1636
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: cn("flex items-center mt-4 gap-4", contentClassName), children: [
1637
+ renderAvatar ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(AvatarSkeleton, { className: avatarClassName }) : null,
1638
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { children: Array.from({ length: Math.max(1, lines) }, (_2, lineIndex) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1527
1639
  SkeletonBlock,
1528
1640
  {
1529
1641
  widthClass: lineWidths[lineIndex] ?? lineWidths[lineWidths.length - 1] ?? DEFAULT_LINE_WIDTHS[1],
@@ -1533,19 +1645,19 @@ function CardSkeleton({
1533
1645
  lineIndex
1534
1646
  )) })
1535
1647
  ] }),
1536
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "sr-only", children: srLabel })
1648
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "sr-only", children: srLabel })
1537
1649
  ]
1538
1650
  },
1539
1651
  index
1540
1652
  );
1541
1653
  });
1542
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_jsx_runtime7.Fragment, { children: skeletons });
1654
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_jsx_runtime8.Fragment, { children: skeletons });
1543
1655
  }
1544
1656
 
1545
1657
  // src/components/tooltip/ToolTip.tsx
1546
1658
  var import_react6 = require("react");
1547
1659
  var import_react_tooltip = require("react-tooltip");
1548
- var import_jsx_runtime8 = require("react/jsx-runtime");
1660
+ var import_jsx_runtime9 = require("react/jsx-runtime");
1549
1661
  var defaultTooltipStyle = {
1550
1662
  color: "#fff",
1551
1663
  borderRadius: "5px",
@@ -1572,10 +1684,10 @@ function ToolTip({
1572
1684
  const tooltipId = `eztrak-tooltip-${generatedId.replace(/:/g, "")}`;
1573
1685
  const tooltipText = String(text ?? "");
1574
1686
  if (disabled || !tooltipText) {
1575
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className, children });
1687
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className, children });
1576
1688
  }
1577
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
1578
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1689
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
1690
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1579
1691
  "span",
1580
1692
  {
1581
1693
  className,
@@ -1585,7 +1697,7 @@ function ToolTip({
1585
1697
  children
1586
1698
  }
1587
1699
  ),
1588
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1700
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1589
1701
  import_react_tooltip.Tooltip,
1590
1702
  {
1591
1703
  id: tooltipId,
@@ -1601,7 +1713,7 @@ function ToolTip({
1601
1713
  }
1602
1714
 
1603
1715
  // src/components/tooltip/TooltipText.tsx
1604
- var import_jsx_runtime9 = require("react/jsx-runtime");
1716
+ var import_jsx_runtime10 = require("react/jsx-runtime");
1605
1717
  function TooltipText({
1606
1718
  text = "",
1607
1719
  maxLength = 20,
@@ -1621,7 +1733,7 @@ function TooltipText({
1621
1733
  const displayText = truncateText(fullText, maxLength);
1622
1734
  const isTruncated = displayText !== fullText;
1623
1735
  const tooltipDisabled = !showTooltip || !hasValue || tooltipWhenTruncatedOnly && !isTruncated;
1624
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1736
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1625
1737
  ToolTip,
1626
1738
  {
1627
1739
  text: fullText,
@@ -1633,7 +1745,7 @@ function TooltipText({
1633
1745
  tooltipStyle,
1634
1746
  wrapperTabIndex: tooltipDisabled ? void 0 : 0,
1635
1747
  disabled: tooltipDisabled,
1636
- children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: cn("inline-block max-w-full align-bottom", textClassName), children: displayText })
1748
+ children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: cn("inline-block max-w-full align-bottom", textClassName), children: displayText })
1637
1749
  }
1638
1750
  );
1639
1751
  }
@@ -1641,9 +1753,9 @@ function TooltipText({
1641
1753
  // src/components/cell-editor/CustomCellEditor.tsx
1642
1754
  var import_react7 = require("react");
1643
1755
  var import_react_hot_toast2 = __toESM(require("react-hot-toast"));
1644
- var import_jsx_runtime10 = require("react/jsx-runtime");
1756
+ var import_jsx_runtime11 = require("react/jsx-runtime");
1645
1757
  function ButtonSpinner() {
1646
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
1758
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
1647
1759
  "svg",
1648
1760
  {
1649
1761
  className: "animate-spin",
@@ -1653,7 +1765,7 @@ function ButtonSpinner() {
1653
1765
  fill: "none",
1654
1766
  "aria-hidden": true,
1655
1767
  children: [
1656
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1768
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1657
1769
  "circle",
1658
1770
  {
1659
1771
  cx: "12",
@@ -1664,7 +1776,7 @@ function ButtonSpinner() {
1664
1776
  strokeOpacity: "0.25"
1665
1777
  }
1666
1778
  ),
1667
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1779
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1668
1780
  "path",
1669
1781
  {
1670
1782
  d: "M12 2a10 10 0 0 1 10 10",
@@ -1800,7 +1912,7 @@ var CustomCellEditor = (0, import_react7.forwardRef)(
1800
1912
  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";
1801
1913
  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";
1802
1914
  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";
1803
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
1915
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
1804
1916
  "div",
1805
1917
  {
1806
1918
  className: cn(
@@ -1809,7 +1921,7 @@ var CustomCellEditor = (0, import_react7.forwardRef)(
1809
1921
  ),
1810
1922
  style: containerStyle,
1811
1923
  children: [
1812
- isDropdown ? /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
1924
+ isDropdown ? /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
1813
1925
  "select",
1814
1926
  {
1815
1927
  ref: selectRef,
@@ -1819,11 +1931,11 @@ var CustomCellEditor = (0, import_react7.forwardRef)(
1819
1931
  className: inputClassName ?? defaultInputClass,
1820
1932
  disabled: isLoading,
1821
1933
  children: [
1822
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "", disabled: true, children: "Select option..." }),
1823
- normalizedOptions.map((opt) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: opt.value, children: opt.label }, opt.value))
1934
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("option", { value: "", disabled: true, children: "Select option..." }),
1935
+ normalizedOptions.map((opt) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("option", { value: opt.value, children: opt.label }, opt.value))
1824
1936
  ]
1825
1937
  }
1826
- ) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1938
+ ) : /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1827
1939
  "input",
1828
1940
  {
1829
1941
  ref: inputRef,
@@ -1836,7 +1948,7 @@ var CustomCellEditor = (0, import_react7.forwardRef)(
1836
1948
  disabled: isLoading
1837
1949
  }
1838
1950
  ),
1839
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1951
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1840
1952
  "button",
1841
1953
  {
1842
1954
  type: "button",
@@ -1845,10 +1957,10 @@ var CustomCellEditor = (0, import_react7.forwardRef)(
1845
1957
  className: saveButtonClassName ?? (saveButtonStyle ? void 0 : defaultSaveBtnClass),
1846
1958
  style: saveButtonStyle,
1847
1959
  title: "Save (Enter)",
1848
- children: isLoading ? loadingIndicator ?? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ButtonSpinner, {}) : saveButtonContent ?? "Save"
1960
+ children: isLoading ? loadingIndicator ?? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(ButtonSpinner, {}) : saveButtonContent ?? "Save"
1849
1961
  }
1850
1962
  ),
1851
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1963
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1852
1964
  "button",
1853
1965
  {
1854
1966
  type: "button",
@@ -1871,6 +1983,7 @@ CustomCellEditor.displayName = "CustomCellEditor";
1871
1983
  CardSkeleton,
1872
1984
  CustomCellEditor,
1873
1985
  CustomPagination,
1986
+ DropdownFilter,
1874
1987
  EztrakTabs,
1875
1988
  Loader,
1876
1989
  Modal,
@@ -1888,6 +2001,7 @@ CustomCellEditor.displayName = "CustomCellEditor";
1888
2001
  convertCommaDataToArray,
1889
2002
  currencyFormatter,
1890
2003
  deserializeJson,
2004
+ dropdownStyles,
1891
2005
  flattenTableData,
1892
2006
  formatDate,
1893
2007
  formatDateTime,