@axzydev/axzy_ui_system 1.0.160 → 1.0.161
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.cjs +4 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -2911,7 +2911,7 @@ var formatCurrencyMX = (value) => {
|
|
|
2911
2911
|
};
|
|
2912
2912
|
function ITTable({
|
|
2913
2913
|
columns,
|
|
2914
|
-
data,
|
|
2914
|
+
data = [],
|
|
2915
2915
|
containerClassName,
|
|
2916
2916
|
className,
|
|
2917
2917
|
variant = "default",
|
|
@@ -2925,8 +2925,9 @@ function ITTable({
|
|
|
2925
2925
|
const [filters, setFilters] = (0, import_react16.useState)({});
|
|
2926
2926
|
const [sortConfig, setSortConfig] = (0, import_react16.useState)(null);
|
|
2927
2927
|
const sortedData = import_react16.default.useMemo(() => {
|
|
2928
|
-
|
|
2929
|
-
|
|
2928
|
+
const safeData = Array.isArray(data) ? data : [];
|
|
2929
|
+
if (!sortConfig) return safeData;
|
|
2930
|
+
return [...safeData].sort((a, b) => {
|
|
2930
2931
|
const aValue = getNestedValue(a, sortConfig.key);
|
|
2931
2932
|
const bValue = getNestedValue(b, sortConfig.key);
|
|
2932
2933
|
if (aValue == null || bValue == null) return 0;
|