@eztrak/shared 0.11.0 → 0.12.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-CIFNA6LN.mjs → chunk-3FD7O5VS.mjs} +178 -55
- package/dist/chunk-3FD7O5VS.mjs.map +1 -0
- package/dist/components/index.d.mts +17 -1
- package/dist/components/index.d.ts +17 -1
- package/dist/components/index.js +194 -69
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +7 -3
- package/dist/index.d.mts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +192 -67
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -2
- package/package.json +3 -1
- package/dist/chunk-CIFNA6LN.mjs.map +0 -1
package/dist/components/index.js
CHANGED
|
@@ -33,6 +33,7 @@ __export(components_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,
|
|
@@ -41,7 +42,8 @@ __export(components_exports, {
|
|
|
41
42
|
SearchInput: () => SearchInput,
|
|
42
43
|
TableLayoutToolbarControls: () => TableLayoutToolbarControls,
|
|
43
44
|
ToolTip: () => ToolTip,
|
|
44
|
-
TooltipText: () => TooltipText
|
|
45
|
+
TooltipText: () => TooltipText,
|
|
46
|
+
dropdownStyles: () => dropdownStyles
|
|
45
47
|
});
|
|
46
48
|
module.exports = __toCommonJS(components_exports);
|
|
47
49
|
|
|
@@ -671,9 +673,130 @@ function CustomPagination({
|
|
|
671
673
|
);
|
|
672
674
|
}
|
|
673
675
|
|
|
674
|
-
// src/components/search-filters/
|
|
676
|
+
// src/components/search-filters/DropdownFilter.tsx
|
|
677
|
+
var import_react_select = __toESM(require("react-select"));
|
|
675
678
|
var import_react_router_dom2 = require("react-router-dom");
|
|
679
|
+
|
|
680
|
+
// src/components/search-filters/dropdownStyles.ts
|
|
681
|
+
var themeColors = {
|
|
682
|
+
primary: "#FF7335",
|
|
683
|
+
primaryHover: "#E65C2E",
|
|
684
|
+
lightBackground: "#FFF3EB",
|
|
685
|
+
textColor: "black",
|
|
686
|
+
white: "white"
|
|
687
|
+
};
|
|
688
|
+
var dropdownStyles = (_borderRadius = "5px") => ({
|
|
689
|
+
control: (provided, state) => ({
|
|
690
|
+
...provided,
|
|
691
|
+
fontSize: "14px",
|
|
692
|
+
padding: "4px 8px",
|
|
693
|
+
minWidth: "180px",
|
|
694
|
+
borderRadius: "5px",
|
|
695
|
+
cursor: "pointer",
|
|
696
|
+
borderColor: state.isFocused ? themeColors.primary : "#e0e0e0",
|
|
697
|
+
boxShadow: state.isFocused ? "0 0 0 2px rgba(255, 115, 53, 0.3)" : "none",
|
|
698
|
+
"&:hover": {
|
|
699
|
+
borderColor: themeColors.primary
|
|
700
|
+
},
|
|
701
|
+
transition: "border-color 0.2s, box-shadow 0.2s",
|
|
702
|
+
zIndex: 50
|
|
703
|
+
}),
|
|
704
|
+
option: (provided, state) => ({
|
|
705
|
+
...provided,
|
|
706
|
+
fontSize: "14px",
|
|
707
|
+
backgroundColor: state.isSelected ? themeColors.primary : state.isFocused ? themeColors.lightBackground : themeColors.white,
|
|
708
|
+
borderRadius: "5px",
|
|
709
|
+
cursor: "pointer",
|
|
710
|
+
borderColor: state.isFocused ? themeColors.primary : "#e0e0e0",
|
|
711
|
+
color: state.isSelected ? themeColors.white : state.isFocused ? themeColors.primary : themeColors.textColor,
|
|
712
|
+
"&:hover": {
|
|
713
|
+
backgroundColor: themeColors.lightBackground,
|
|
714
|
+
color: themeColors.primary
|
|
715
|
+
},
|
|
716
|
+
"&:active": {
|
|
717
|
+
backgroundColor: themeColors.primary,
|
|
718
|
+
color: themeColors.white
|
|
719
|
+
},
|
|
720
|
+
transition: "background-color 0.2s, color 0.2s",
|
|
721
|
+
zIndex: 50
|
|
722
|
+
}),
|
|
723
|
+
singleValue: (provided) => ({
|
|
724
|
+
...provided,
|
|
725
|
+
color: themeColors.textColor,
|
|
726
|
+
zIndex: 50
|
|
727
|
+
}),
|
|
728
|
+
menu: (provided) => ({
|
|
729
|
+
...provided,
|
|
730
|
+
borderRadius: "5px",
|
|
731
|
+
boxShadow: "0 4px 6px rgba(0, 0, 0, 0.1)",
|
|
732
|
+
marginTop: "4px",
|
|
733
|
+
zIndex: 50
|
|
734
|
+
}),
|
|
735
|
+
dropdownIndicator: (provided) => ({
|
|
736
|
+
...provided,
|
|
737
|
+
color: themeColors.primary,
|
|
738
|
+
"&:hover": {
|
|
739
|
+
color: themeColors.primaryHover
|
|
740
|
+
},
|
|
741
|
+
zIndex: 50
|
|
742
|
+
}),
|
|
743
|
+
indicatorSeparator: () => ({
|
|
744
|
+
display: "none"
|
|
745
|
+
})
|
|
746
|
+
});
|
|
747
|
+
|
|
748
|
+
// src/components/search-filters/DropdownFilter.tsx
|
|
676
749
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
750
|
+
function DropdownFilter({
|
|
751
|
+
name,
|
|
752
|
+
valueKey = "id",
|
|
753
|
+
options,
|
|
754
|
+
placeholder,
|
|
755
|
+
borderRadius = "20px",
|
|
756
|
+
className,
|
|
757
|
+
isClearable = true,
|
|
758
|
+
isSearchable = true,
|
|
759
|
+
isDisabled = false,
|
|
760
|
+
isLoading = false,
|
|
761
|
+
...otherProps
|
|
762
|
+
}) {
|
|
763
|
+
const [searchParams, setSearchParams] = (0, import_react_router_dom2.useSearchParams)();
|
|
764
|
+
const currentValue = searchParams.get(name);
|
|
765
|
+
const selectedOption = currentValue ? options?.find(
|
|
766
|
+
(option) => option[valueKey]?.toString() === currentValue
|
|
767
|
+
) ?? null : null;
|
|
768
|
+
const handleChange = (selected) => {
|
|
769
|
+
setSearchParams((prev) => {
|
|
770
|
+
if (!selected || selected[valueKey] === "") {
|
|
771
|
+
prev.delete(name);
|
|
772
|
+
} else {
|
|
773
|
+
prev.set(name, String(selected[valueKey]));
|
|
774
|
+
}
|
|
775
|
+
return prev;
|
|
776
|
+
});
|
|
777
|
+
};
|
|
778
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: cn(className), children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
779
|
+
import_react_select.default,
|
|
780
|
+
{
|
|
781
|
+
placeholder: placeholder ?? `Select ${name}`,
|
|
782
|
+
value: selectedOption,
|
|
783
|
+
onChange: handleChange,
|
|
784
|
+
options,
|
|
785
|
+
isClearable,
|
|
786
|
+
isSearchable,
|
|
787
|
+
isDisabled,
|
|
788
|
+
isLoading,
|
|
789
|
+
getOptionValue: (option) => String(option[valueKey] ?? ""),
|
|
790
|
+
getOptionLabel: (option) => String(option.label ?? option.name ?? option[valueKey] ?? ""),
|
|
791
|
+
styles: dropdownStyles(borderRadius),
|
|
792
|
+
...otherProps
|
|
793
|
+
}
|
|
794
|
+
) });
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
// src/components/search-filters/ResetFiltersButton.tsx
|
|
798
|
+
var import_react_router_dom3 = require("react-router-dom");
|
|
799
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
677
800
|
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";
|
|
678
801
|
var VARIANTS = {
|
|
679
802
|
primary: "bg-white text-secondary border border-secondary hover:bg-lightGray hover:text-black",
|
|
@@ -688,7 +811,7 @@ function ResetIcon({
|
|
|
688
811
|
size = 16,
|
|
689
812
|
className
|
|
690
813
|
}) {
|
|
691
|
-
return /* @__PURE__ */ (0,
|
|
814
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
692
815
|
"svg",
|
|
693
816
|
{
|
|
694
817
|
width: size,
|
|
@@ -702,10 +825,10 @@ function ResetIcon({
|
|
|
702
825
|
"aria-hidden": "true",
|
|
703
826
|
className,
|
|
704
827
|
children: [
|
|
705
|
-
/* @__PURE__ */ (0,
|
|
706
|
-
/* @__PURE__ */ (0,
|
|
707
|
-
/* @__PURE__ */ (0,
|
|
708
|
-
/* @__PURE__ */ (0,
|
|
828
|
+
/* @__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" }),
|
|
829
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M21 3v5h-5" }),
|
|
830
|
+
/* @__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" }),
|
|
831
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M8 16H3v5" })
|
|
709
832
|
]
|
|
710
833
|
}
|
|
711
834
|
);
|
|
@@ -719,13 +842,13 @@ function ResetFiltersButton({
|
|
|
719
842
|
onReset,
|
|
720
843
|
disabled = false
|
|
721
844
|
}) {
|
|
722
|
-
const [, setSearchParams] = (0,
|
|
845
|
+
const [, setSearchParams] = (0, import_react_router_dom3.useSearchParams)();
|
|
723
846
|
const handleReset = () => {
|
|
724
847
|
setSearchParams({}, { replace: true });
|
|
725
848
|
onReset?.();
|
|
726
849
|
};
|
|
727
|
-
const resolvedIcon = icon === void 0 ? /* @__PURE__ */ (0,
|
|
728
|
-
return /* @__PURE__ */ (0,
|
|
850
|
+
const resolvedIcon = icon === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(ResetIcon, { size: 16 }) : icon;
|
|
851
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
729
852
|
"button",
|
|
730
853
|
{
|
|
731
854
|
type: "button",
|
|
@@ -743,8 +866,8 @@ function ResetFiltersButton({
|
|
|
743
866
|
// src/components/search-filters/SearchInput.tsx
|
|
744
867
|
var import_react2 = require("react");
|
|
745
868
|
var import_fi = require("react-icons/fi");
|
|
746
|
-
var
|
|
747
|
-
var
|
|
869
|
+
var import_react_router_dom4 = require("react-router-dom");
|
|
870
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
748
871
|
function SearchInput({
|
|
749
872
|
placeholder = "Search...",
|
|
750
873
|
searchBtn = "",
|
|
@@ -761,7 +884,7 @@ function SearchInput({
|
|
|
761
884
|
defaultValue,
|
|
762
885
|
...props
|
|
763
886
|
}) {
|
|
764
|
-
const [searchParams, setSearchParams] = (0,
|
|
887
|
+
const [searchParams, setSearchParams] = (0, import_react_router_dom4.useSearchParams)();
|
|
765
888
|
const queryParam = searchParams.get(defaultParam) || defaultValue || "";
|
|
766
889
|
const [inputValue, setInputValue] = (0, import_react2.useState)(queryParam);
|
|
767
890
|
const debounceTimerRef = (0, import_react2.useRef)(null);
|
|
@@ -813,7 +936,7 @@ function SearchInput({
|
|
|
813
936
|
}
|
|
814
937
|
};
|
|
815
938
|
}, []);
|
|
816
|
-
return /* @__PURE__ */ (0,
|
|
939
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
817
940
|
"form",
|
|
818
941
|
{
|
|
819
942
|
onSubmit: handleSearch,
|
|
@@ -822,7 +945,7 @@ function SearchInput({
|
|
|
822
945
|
searchWrapperClass
|
|
823
946
|
),
|
|
824
947
|
children: [
|
|
825
|
-
showIcon && /* @__PURE__ */ (0,
|
|
948
|
+
showIcon && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
826
949
|
"button",
|
|
827
950
|
{
|
|
828
951
|
type: "submit",
|
|
@@ -830,7 +953,7 @@ function SearchInput({
|
|
|
830
953
|
"bg-white text-secondary rounded-full flex items-center justify-center w-10 h-10",
|
|
831
954
|
searchBtn
|
|
832
955
|
),
|
|
833
|
-
children: customIcon ? customIcon : /* @__PURE__ */ (0,
|
|
956
|
+
children: customIcon ? customIcon : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
834
957
|
import_fi.FiSearch,
|
|
835
958
|
{
|
|
836
959
|
className: cn("h-5 w-5 text-gray-400", searchIconClassName)
|
|
@@ -838,7 +961,7 @@ function SearchInput({
|
|
|
838
961
|
)
|
|
839
962
|
}
|
|
840
963
|
),
|
|
841
|
-
/* @__PURE__ */ (0,
|
|
964
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
842
965
|
"input",
|
|
843
966
|
{
|
|
844
967
|
value: inputValue,
|
|
@@ -863,9 +986,9 @@ var import_fa = require("react-icons/fa");
|
|
|
863
986
|
var import_io5 = require("react-icons/io5");
|
|
864
987
|
|
|
865
988
|
// src/components/Loader/Loader.tsx
|
|
866
|
-
var
|
|
989
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
867
990
|
var Loader = ({ className, color = "#F54C00", size = "50px", speed = "1s" }) => {
|
|
868
|
-
return /* @__PURE__ */ (0,
|
|
991
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: `loader`, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
869
992
|
"div",
|
|
870
993
|
{
|
|
871
994
|
className: `spinner ${className}`,
|
|
@@ -882,7 +1005,7 @@ var Loader = ({ className, color = "#F54C00", size = "50px", speed = "1s" }) =>
|
|
|
882
1005
|
};
|
|
883
1006
|
|
|
884
1007
|
// src/components/modal/Modal.tsx
|
|
885
|
-
var
|
|
1008
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
886
1009
|
function Modal({
|
|
887
1010
|
isOpen,
|
|
888
1011
|
onClose,
|
|
@@ -923,7 +1046,7 @@ function Modal({
|
|
|
923
1046
|
document.body.style.overflow = "unset";
|
|
924
1047
|
};
|
|
925
1048
|
}, [isOpen, onClose, closeOnEscape]);
|
|
926
|
-
const modalContent = /* @__PURE__ */ (0,
|
|
1049
|
+
const modalContent = /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_framer_motion.AnimatePresence, { children: isOpen && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
927
1050
|
"div",
|
|
928
1051
|
{
|
|
929
1052
|
className: "fixed inset-0 bg-gray-500 bg-opacity-50 flex justify-center items-center z-1000 p-4",
|
|
@@ -942,7 +1065,7 @@ function Modal({
|
|
|
942
1065
|
zIndex
|
|
943
1066
|
},
|
|
944
1067
|
children: [
|
|
945
|
-
/* @__PURE__ */ (0,
|
|
1068
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
946
1069
|
import_framer_motion.motion.div,
|
|
947
1070
|
{
|
|
948
1071
|
ref: modalRef,
|
|
@@ -963,7 +1086,7 @@ function Modal({
|
|
|
963
1086
|
// Ensure modal doesn't exceed viewport height
|
|
964
1087
|
},
|
|
965
1088
|
children: [
|
|
966
|
-
/* @__PURE__ */ (0,
|
|
1089
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
967
1090
|
"div",
|
|
968
1091
|
{
|
|
969
1092
|
style: {
|
|
@@ -971,43 +1094,43 @@ function Modal({
|
|
|
971
1094
|
},
|
|
972
1095
|
className: "sticky top-0 z-10 flex justify-between items-center bg-white text-2xl p-8 pb-4 rounded-t-3xl",
|
|
973
1096
|
children: [
|
|
974
|
-
/* @__PURE__ */ (0,
|
|
975
|
-
/* @__PURE__ */ (0,
|
|
976
|
-
onPrint && /* @__PURE__ */ (0,
|
|
1097
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("h2", { className: "font-semibold", children: title }),
|
|
1098
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex items-center space-x-4", children: [
|
|
1099
|
+
onPrint && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
977
1100
|
"button",
|
|
978
1101
|
{
|
|
979
1102
|
onClick: onPrint,
|
|
980
1103
|
className: "flex items-center gap-1 hover:text-gray-300 text-sm border p-1 rounded",
|
|
981
1104
|
children: [
|
|
982
|
-
/* @__PURE__ */ (0,
|
|
983
|
-
/* @__PURE__ */ (0,
|
|
1105
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_fa.FaPrint, { name: "FaPrint" }),
|
|
1106
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { children: "Print" })
|
|
984
1107
|
]
|
|
985
1108
|
}
|
|
986
1109
|
),
|
|
987
|
-
onExport && /* @__PURE__ */ (0,
|
|
1110
|
+
onExport && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
988
1111
|
"button",
|
|
989
1112
|
{
|
|
990
1113
|
onClick: onExport,
|
|
991
1114
|
className: "flex items-center gap-1 hover:text-gray-300 text-sm border p-1 rounded",
|
|
992
1115
|
children: [
|
|
993
|
-
/* @__PURE__ */ (0,
|
|
994
|
-
/* @__PURE__ */ (0,
|
|
1116
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_fa.FaFileExport, {}),
|
|
1117
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { children: "Export" })
|
|
995
1118
|
]
|
|
996
1119
|
}
|
|
997
1120
|
),
|
|
998
|
-
/* @__PURE__ */ (0,
|
|
1121
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
999
1122
|
"button",
|
|
1000
1123
|
{
|
|
1001
1124
|
onClick: onClose,
|
|
1002
1125
|
className: "px-2 hover:opacity-70 transition-opacity",
|
|
1003
|
-
children: /* @__PURE__ */ (0,
|
|
1126
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_io5.IoCloseCircleOutline, { color: "#8898AA", size: 25 })
|
|
1004
1127
|
}
|
|
1005
1128
|
)
|
|
1006
1129
|
] })
|
|
1007
1130
|
]
|
|
1008
1131
|
}
|
|
1009
1132
|
),
|
|
1010
|
-
/* @__PURE__ */ (0,
|
|
1133
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1011
1134
|
"div",
|
|
1012
1135
|
{
|
|
1013
1136
|
className: cn(
|
|
@@ -1017,7 +1140,7 @@ function Modal({
|
|
|
1017
1140
|
children
|
|
1018
1141
|
}
|
|
1019
1142
|
),
|
|
1020
|
-
footer && /* @__PURE__ */ (0,
|
|
1143
|
+
footer && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1021
1144
|
"div",
|
|
1022
1145
|
{
|
|
1023
1146
|
className: cn("sticky bottom-0 flex justify-end p-4 space-x-4 border-t bg-white ", footerClassName),
|
|
@@ -1031,7 +1154,7 @@ function Modal({
|
|
|
1031
1154
|
]
|
|
1032
1155
|
}
|
|
1033
1156
|
),
|
|
1034
|
-
isLoading && /* @__PURE__ */ (0,
|
|
1157
|
+
isLoading && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1035
1158
|
"div",
|
|
1036
1159
|
{
|
|
1037
1160
|
className: "fixed inset-0 flex items-center justify-center bg-gray-200/60",
|
|
@@ -1040,7 +1163,7 @@ function Modal({
|
|
|
1040
1163
|
"aria-live": "polite",
|
|
1041
1164
|
role: "status",
|
|
1042
1165
|
onClick: (e) => e.stopPropagation(),
|
|
1043
|
-
children: customLoader ? customLoader : /* @__PURE__ */ (0,
|
|
1166
|
+
children: customLoader ? customLoader : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Loader, { size: "48px" })
|
|
1044
1167
|
}
|
|
1045
1168
|
)
|
|
1046
1169
|
]
|
|
@@ -1056,7 +1179,7 @@ function Modal({
|
|
|
1056
1179
|
}
|
|
1057
1180
|
|
|
1058
1181
|
// src/components/skeleton/CardSkeleton.tsx
|
|
1059
|
-
var
|
|
1182
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
1060
1183
|
var DEFAULT_LINE_WIDTHS = ["w-32", "w-48"];
|
|
1061
1184
|
function shouldShowAvatar(variant, showAvatar) {
|
|
1062
1185
|
return showAvatar ?? variant === "profile";
|
|
@@ -1065,7 +1188,7 @@ function shouldShowImage(variant, showImage) {
|
|
|
1065
1188
|
return showImage ?? variant === "image";
|
|
1066
1189
|
}
|
|
1067
1190
|
function AvatarSkeleton({ className }) {
|
|
1068
|
-
return /* @__PURE__ */ (0,
|
|
1191
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1069
1192
|
"svg",
|
|
1070
1193
|
{
|
|
1071
1194
|
className: cn("w-10 h-10 text-gray-200 dark:text-gray-700", className),
|
|
@@ -1073,7 +1196,7 @@ function AvatarSkeleton({ className }) {
|
|
|
1073
1196
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1074
1197
|
fill: "currentColor",
|
|
1075
1198
|
viewBox: "0 0 20 20",
|
|
1076
|
-
children: /* @__PURE__ */ (0,
|
|
1199
|
+
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" })
|
|
1077
1200
|
}
|
|
1078
1201
|
);
|
|
1079
1202
|
}
|
|
@@ -1082,7 +1205,7 @@ function SkeletonBlock({
|
|
|
1082
1205
|
className,
|
|
1083
1206
|
isFirst
|
|
1084
1207
|
}) {
|
|
1085
|
-
return /* @__PURE__ */ (0,
|
|
1208
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1086
1209
|
"div",
|
|
1087
1210
|
{
|
|
1088
1211
|
className: cn(
|
|
@@ -1114,14 +1237,14 @@ function CardSkeleton({
|
|
|
1114
1237
|
const skeletons = Array.from({ length: Math.max(1, count) }, (_, index) => {
|
|
1115
1238
|
const renderAvatar = shouldShowAvatar(variant, showAvatar);
|
|
1116
1239
|
const renderImage = shouldShowImage(variant, showImage);
|
|
1117
|
-
return /* @__PURE__ */ (0,
|
|
1240
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
1118
1241
|
"div",
|
|
1119
1242
|
{
|
|
1120
1243
|
className: cn("animate-pulse md:p-6 dark:border-gray-700", className),
|
|
1121
1244
|
style: { animationDuration, ...style },
|
|
1122
1245
|
...props,
|
|
1123
1246
|
children: [
|
|
1124
|
-
renderImage ? /* @__PURE__ */ (0,
|
|
1247
|
+
renderImage ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1125
1248
|
"div",
|
|
1126
1249
|
{
|
|
1127
1250
|
className: cn(
|
|
@@ -1130,9 +1253,9 @@ function CardSkeleton({
|
|
|
1130
1253
|
)
|
|
1131
1254
|
}
|
|
1132
1255
|
) : null,
|
|
1133
|
-
/* @__PURE__ */ (0,
|
|
1134
|
-
renderAvatar ? /* @__PURE__ */ (0,
|
|
1135
|
-
/* @__PURE__ */ (0,
|
|
1256
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: cn("flex items-center mt-4 gap-4", contentClassName), children: [
|
|
1257
|
+
renderAvatar ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(AvatarSkeleton, { className: avatarClassName }) : null,
|
|
1258
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { children: Array.from({ length: Math.max(1, lines) }, (_2, lineIndex) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1136
1259
|
SkeletonBlock,
|
|
1137
1260
|
{
|
|
1138
1261
|
widthClass: lineWidths[lineIndex] ?? lineWidths[lineWidths.length - 1] ?? DEFAULT_LINE_WIDTHS[1],
|
|
@@ -1142,19 +1265,19 @@ function CardSkeleton({
|
|
|
1142
1265
|
lineIndex
|
|
1143
1266
|
)) })
|
|
1144
1267
|
] }),
|
|
1145
|
-
/* @__PURE__ */ (0,
|
|
1268
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "sr-only", children: srLabel })
|
|
1146
1269
|
]
|
|
1147
1270
|
},
|
|
1148
1271
|
index
|
|
1149
1272
|
);
|
|
1150
1273
|
});
|
|
1151
|
-
return /* @__PURE__ */ (0,
|
|
1274
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_jsx_runtime8.Fragment, { children: skeletons });
|
|
1152
1275
|
}
|
|
1153
1276
|
|
|
1154
1277
|
// src/components/tooltip/ToolTip.tsx
|
|
1155
1278
|
var import_react4 = require("react");
|
|
1156
1279
|
var import_react_tooltip = require("react-tooltip");
|
|
1157
|
-
var
|
|
1280
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
1158
1281
|
var defaultTooltipStyle = {
|
|
1159
1282
|
color: "#fff",
|
|
1160
1283
|
borderRadius: "5px",
|
|
@@ -1181,10 +1304,10 @@ function ToolTip({
|
|
|
1181
1304
|
const tooltipId = `eztrak-tooltip-${generatedId.replace(/:/g, "")}`;
|
|
1182
1305
|
const tooltipText = String(text ?? "");
|
|
1183
1306
|
if (disabled || !tooltipText) {
|
|
1184
|
-
return /* @__PURE__ */ (0,
|
|
1307
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className, children });
|
|
1185
1308
|
}
|
|
1186
|
-
return /* @__PURE__ */ (0,
|
|
1187
|
-
/* @__PURE__ */ (0,
|
|
1309
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
|
|
1310
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1188
1311
|
"span",
|
|
1189
1312
|
{
|
|
1190
1313
|
className,
|
|
@@ -1194,7 +1317,7 @@ function ToolTip({
|
|
|
1194
1317
|
children
|
|
1195
1318
|
}
|
|
1196
1319
|
),
|
|
1197
|
-
/* @__PURE__ */ (0,
|
|
1320
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1198
1321
|
import_react_tooltip.Tooltip,
|
|
1199
1322
|
{
|
|
1200
1323
|
id: tooltipId,
|
|
@@ -1238,7 +1361,7 @@ var toDateInputValue = (date) => {
|
|
|
1238
1361
|
};
|
|
1239
1362
|
|
|
1240
1363
|
// src/components/tooltip/TooltipText.tsx
|
|
1241
|
-
var
|
|
1364
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
1242
1365
|
function TooltipText({
|
|
1243
1366
|
text = "",
|
|
1244
1367
|
maxLength = 20,
|
|
@@ -1258,7 +1381,7 @@ function TooltipText({
|
|
|
1258
1381
|
const displayText = truncateText(fullText, maxLength);
|
|
1259
1382
|
const isTruncated = displayText !== fullText;
|
|
1260
1383
|
const tooltipDisabled = !showTooltip || !hasValue || tooltipWhenTruncatedOnly && !isTruncated;
|
|
1261
|
-
return /* @__PURE__ */ (0,
|
|
1384
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1262
1385
|
ToolTip,
|
|
1263
1386
|
{
|
|
1264
1387
|
text: fullText,
|
|
@@ -1270,7 +1393,7 @@ function TooltipText({
|
|
|
1270
1393
|
tooltipStyle,
|
|
1271
1394
|
wrapperTabIndex: tooltipDisabled ? void 0 : 0,
|
|
1272
1395
|
disabled: tooltipDisabled,
|
|
1273
|
-
children: /* @__PURE__ */ (0,
|
|
1396
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: cn("inline-block max-w-full align-bottom", textClassName), children: displayText })
|
|
1274
1397
|
}
|
|
1275
1398
|
);
|
|
1276
1399
|
}
|
|
@@ -1278,9 +1401,9 @@ function TooltipText({
|
|
|
1278
1401
|
// src/components/cell-editor/CustomCellEditor.tsx
|
|
1279
1402
|
var import_react5 = require("react");
|
|
1280
1403
|
var import_react_hot_toast2 = __toESM(require("react-hot-toast"));
|
|
1281
|
-
var
|
|
1404
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
1282
1405
|
function ButtonSpinner() {
|
|
1283
|
-
return /* @__PURE__ */ (0,
|
|
1406
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
1284
1407
|
"svg",
|
|
1285
1408
|
{
|
|
1286
1409
|
className: "animate-spin",
|
|
@@ -1290,7 +1413,7 @@ function ButtonSpinner() {
|
|
|
1290
1413
|
fill: "none",
|
|
1291
1414
|
"aria-hidden": true,
|
|
1292
1415
|
children: [
|
|
1293
|
-
/* @__PURE__ */ (0,
|
|
1416
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1294
1417
|
"circle",
|
|
1295
1418
|
{
|
|
1296
1419
|
cx: "12",
|
|
@@ -1301,7 +1424,7 @@ function ButtonSpinner() {
|
|
|
1301
1424
|
strokeOpacity: "0.25"
|
|
1302
1425
|
}
|
|
1303
1426
|
),
|
|
1304
|
-
/* @__PURE__ */ (0,
|
|
1427
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1305
1428
|
"path",
|
|
1306
1429
|
{
|
|
1307
1430
|
d: "M12 2a10 10 0 0 1 10 10",
|
|
@@ -1437,7 +1560,7 @@ var CustomCellEditor = (0, import_react5.forwardRef)(
|
|
|
1437
1560
|
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";
|
|
1438
1561
|
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";
|
|
1439
1562
|
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";
|
|
1440
|
-
return /* @__PURE__ */ (0,
|
|
1563
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
1441
1564
|
"div",
|
|
1442
1565
|
{
|
|
1443
1566
|
className: cn(
|
|
@@ -1446,7 +1569,7 @@ var CustomCellEditor = (0, import_react5.forwardRef)(
|
|
|
1446
1569
|
),
|
|
1447
1570
|
style: containerStyle,
|
|
1448
1571
|
children: [
|
|
1449
|
-
isDropdown ? /* @__PURE__ */ (0,
|
|
1572
|
+
isDropdown ? /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
1450
1573
|
"select",
|
|
1451
1574
|
{
|
|
1452
1575
|
ref: selectRef,
|
|
@@ -1456,11 +1579,11 @@ var CustomCellEditor = (0, import_react5.forwardRef)(
|
|
|
1456
1579
|
className: inputClassName ?? defaultInputClass,
|
|
1457
1580
|
disabled: isLoading,
|
|
1458
1581
|
children: [
|
|
1459
|
-
/* @__PURE__ */ (0,
|
|
1460
|
-
normalizedOptions.map((opt) => /* @__PURE__ */ (0,
|
|
1582
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("option", { value: "", disabled: true, children: "Select option..." }),
|
|
1583
|
+
normalizedOptions.map((opt) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("option", { value: opt.value, children: opt.label }, opt.value))
|
|
1461
1584
|
]
|
|
1462
1585
|
}
|
|
1463
|
-
) : /* @__PURE__ */ (0,
|
|
1586
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1464
1587
|
"input",
|
|
1465
1588
|
{
|
|
1466
1589
|
ref: inputRef,
|
|
@@ -1473,7 +1596,7 @@ var CustomCellEditor = (0, import_react5.forwardRef)(
|
|
|
1473
1596
|
disabled: isLoading
|
|
1474
1597
|
}
|
|
1475
1598
|
),
|
|
1476
|
-
/* @__PURE__ */ (0,
|
|
1599
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1477
1600
|
"button",
|
|
1478
1601
|
{
|
|
1479
1602
|
type: "button",
|
|
@@ -1482,10 +1605,10 @@ var CustomCellEditor = (0, import_react5.forwardRef)(
|
|
|
1482
1605
|
className: saveButtonClassName ?? (saveButtonStyle ? void 0 : defaultSaveBtnClass),
|
|
1483
1606
|
style: saveButtonStyle,
|
|
1484
1607
|
title: "Save (Enter)",
|
|
1485
|
-
children: isLoading ? loadingIndicator ?? /* @__PURE__ */ (0,
|
|
1608
|
+
children: isLoading ? loadingIndicator ?? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(ButtonSpinner, {}) : saveButtonContent ?? "Save"
|
|
1486
1609
|
}
|
|
1487
1610
|
),
|
|
1488
|
-
/* @__PURE__ */ (0,
|
|
1611
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1489
1612
|
"button",
|
|
1490
1613
|
{
|
|
1491
1614
|
type: "button",
|
|
@@ -1508,6 +1631,7 @@ CustomCellEditor.displayName = "CustomCellEditor";
|
|
|
1508
1631
|
CardSkeleton,
|
|
1509
1632
|
CustomCellEditor,
|
|
1510
1633
|
CustomPagination,
|
|
1634
|
+
DropdownFilter,
|
|
1511
1635
|
EztrakTabs,
|
|
1512
1636
|
Loader,
|
|
1513
1637
|
Modal,
|
|
@@ -1516,6 +1640,7 @@ CustomCellEditor.displayName = "CustomCellEditor";
|
|
|
1516
1640
|
SearchInput,
|
|
1517
1641
|
TableLayoutToolbarControls,
|
|
1518
1642
|
ToolTip,
|
|
1519
|
-
TooltipText
|
|
1643
|
+
TooltipText,
|
|
1644
|
+
dropdownStyles
|
|
1520
1645
|
});
|
|
1521
1646
|
//# sourceMappingURL=index.js.map
|