next-helios-fe 1.10.9 → 1.10.11
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/package.json
CHANGED
|
@@ -49,8 +49,9 @@ export const Number: React.FC<NumberProps> = ({
|
|
|
49
49
|
<div className="flex-1 flex justify-end items-center gap-2">
|
|
50
50
|
{(rest.min || rest.max) && (
|
|
51
51
|
<span className="text-sm select-none">
|
|
52
|
-
{rest.min || rest.min === 0 ? rest.min : "∞"}
|
|
53
|
-
|
|
52
|
+
{`${rest.min || rest.min === 0 ? rest.min : "∞"}-${
|
|
53
|
+
rest.max || rest.max === 0 ? rest.max : "∞"
|
|
54
|
+
}`}
|
|
54
55
|
</span>
|
|
55
56
|
)}
|
|
56
57
|
{description && (
|
|
@@ -43,6 +43,16 @@ interface TableProps {
|
|
|
43
43
|
export?: {
|
|
44
44
|
tooltip?: string;
|
|
45
45
|
show: boolean;
|
|
46
|
+
onExport?: (value: {
|
|
47
|
+
search: string;
|
|
48
|
+
page: number;
|
|
49
|
+
dataOffset: number;
|
|
50
|
+
maxRow: number;
|
|
51
|
+
filter: any[];
|
|
52
|
+
categoryFilter: any[];
|
|
53
|
+
dateFilter: any[];
|
|
54
|
+
sortBy: any;
|
|
55
|
+
}) => void;
|
|
46
56
|
};
|
|
47
57
|
columnSearch?: {
|
|
48
58
|
show: boolean;
|
|
@@ -951,23 +961,36 @@ export const Table: TableComponentProps = ({
|
|
|
951
961
|
options={{ variant: "primary", width: "fit" }}
|
|
952
962
|
disabled={loading}
|
|
953
963
|
onClick={() => {
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
964
|
+
if (options?.toolbar?.export?.onExport) {
|
|
965
|
+
options?.toolbar?.export?.onExport({
|
|
966
|
+
search,
|
|
967
|
+
page,
|
|
968
|
+
dataOffset: (page - 1) * maxRow,
|
|
969
|
+
maxRow,
|
|
970
|
+
filter,
|
|
971
|
+
categoryFilter,
|
|
972
|
+
dateFilter,
|
|
973
|
+
sortBy,
|
|
974
|
+
});
|
|
975
|
+
} else {
|
|
976
|
+
const exportData = filteredData?.map((item, index) => {
|
|
977
|
+
return header
|
|
978
|
+
?.filter(
|
|
979
|
+
(headerItem) =>
|
|
980
|
+
!excludedColumn?.includes(headerItem.key)
|
|
981
|
+
)
|
|
982
|
+
?.reduce((acc, headerItem) => {
|
|
983
|
+
return {
|
|
984
|
+
...acc,
|
|
985
|
+
"No.": (index + 1)?.toString(),
|
|
986
|
+
[headerItem.title]:
|
|
987
|
+
item[headerItem.key as keyof typeof item],
|
|
988
|
+
};
|
|
989
|
+
}, {});
|
|
990
|
+
});
|
|
969
991
|
|
|
970
|
-
|
|
992
|
+
handleExportData(title || "Table Data", exportData);
|
|
993
|
+
}
|
|
971
994
|
}}
|
|
972
995
|
>
|
|
973
996
|
Export
|