@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.js
CHANGED
|
@@ -2876,7 +2876,7 @@ var formatCurrencyMX = (value) => {
|
|
|
2876
2876
|
};
|
|
2877
2877
|
function ITTable({
|
|
2878
2878
|
columns,
|
|
2879
|
-
data,
|
|
2879
|
+
data = [],
|
|
2880
2880
|
containerClassName,
|
|
2881
2881
|
className,
|
|
2882
2882
|
variant = "default",
|
|
@@ -2890,8 +2890,9 @@ function ITTable({
|
|
|
2890
2890
|
const [filters, setFilters] = useState12({});
|
|
2891
2891
|
const [sortConfig, setSortConfig] = useState12(null);
|
|
2892
2892
|
const sortedData = React7.useMemo(() => {
|
|
2893
|
-
|
|
2894
|
-
|
|
2893
|
+
const safeData = Array.isArray(data) ? data : [];
|
|
2894
|
+
if (!sortConfig) return safeData;
|
|
2895
|
+
return [...safeData].sort((a, b) => {
|
|
2895
2896
|
const aValue = getNestedValue(a, sortConfig.key);
|
|
2896
2897
|
const bValue = getNestedValue(b, sortConfig.key);
|
|
2897
2898
|
if (aValue == null || bValue == null) return 0;
|