@apexcura/ui-components 0.0.11-Beta203 → 0.0.11-Beta204

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
@@ -630,15 +630,23 @@ var TableElement = (props) => {
630
630
  {
631
631
  title: "#",
632
632
  dataIndex: "#",
633
- key: "#"
633
+ key: "#",
634
+ sorter: {
635
+ compare: (a, b) => a["#"] - b["#"]
636
+ }
634
637
  },
635
638
  ...thead.map((col, ind) => ({
636
639
  title: col.label,
637
640
  dataIndex: col.name,
638
641
  key: col.key,
639
642
  sorter: {
640
- compare: (a, b) => a[col.key] - b[col.key]
641
- // multiple: thead.length - ind-1
643
+ compare: (a, b) => {
644
+ if (typeof a[col.key] === "number" && typeof a[col.key] === "number") {
645
+ return a[col.key] - b[col.key];
646
+ } else if (typeof a[col.key] === "string" && typeof a[col.key] === "string") {
647
+ return a[col.key].localCompare(b[col.key]);
648
+ }
649
+ }
642
650
  }
643
651
  }))
644
652
  ];
package/dist/index.mjs CHANGED
@@ -579,15 +579,23 @@ var TableElement = (props) => {
579
579
  {
580
580
  title: "#",
581
581
  dataIndex: "#",
582
- key: "#"
582
+ key: "#",
583
+ sorter: {
584
+ compare: (a, b) => a["#"] - b["#"]
585
+ }
583
586
  },
584
587
  ...thead.map((col, ind) => ({
585
588
  title: col.label,
586
589
  dataIndex: col.name,
587
590
  key: col.key,
588
591
  sorter: {
589
- compare: (a, b) => a[col.key] - b[col.key]
590
- // multiple: thead.length - ind-1
592
+ compare: (a, b) => {
593
+ if (typeof a[col.key] === "number" && typeof a[col.key] === "number") {
594
+ return a[col.key] - b[col.key];
595
+ } else if (typeof a[col.key] === "string" && typeof a[col.key] === "string") {
596
+ return a[col.key].localCompare(b[col.key]);
597
+ }
598
+ }
591
599
  }
592
600
  }))
593
601
  ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apexcura/ui-components",
3
- "version": "0.0.11-Beta203",
3
+ "version": "0.0.11-Beta204",
4
4
  "description": "Apex cura React components library",
5
5
  "keywords": [
6
6
  "apex cura",