@datawheel/data-explorer 1.0.7 → 1.0.8

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.
Files changed (2) hide show
  1. package/dist/main.mjs +27 -0
  2. package/package.json +1 -1
package/dist/main.mjs CHANGED
@@ -3069,6 +3069,7 @@ function useTable({
3069
3069
  header,
3070
3070
  enableHiding: true,
3071
3071
  accessorFn: (row) => row[columnKey],
3072
+ // This functions is not being used. Manual sorting is enabled.
3072
3073
  sortingFn: (rowA, rowB, columnId) => {
3073
3074
  if (rowA.original[columnId] < rowB.original[columnId]) {
3074
3075
  return -1;
@@ -3089,12 +3090,38 @@ function useTable({
3089
3090
  onClick: () => {
3090
3091
  if (!isSorted) {
3091
3092
  actions2.updateSorting({ key: entity.name, dir: "desc" });
3093
+ const newQuery = buildQuery(_.cloneDeep(queryItem));
3094
+ updateURL({
3095
+ ...newQuery,
3096
+ params: {
3097
+ ...newQuery.params,
3098
+ sortKey: `${entity.name}`,
3099
+ sortDir: "desc"
3100
+ }
3101
+ });
3092
3102
  }
3093
3103
  if (isSorted && sortDir === "desc") {
3094
3104
  actions2.updateSorting({ key: entity.name, dir: "asc" });
3105
+ const newQuery = buildQuery(_.cloneDeep(queryItem));
3106
+ updateURL({
3107
+ ...newQuery,
3108
+ params: {
3109
+ ...newQuery.params,
3110
+ sortKey: `${entity.name}`,
3111
+ sortDir: "asc"
3112
+ }
3113
+ });
3095
3114
  }
3096
3115
  if (isSorted && sortDir === "asc") {
3097
3116
  actions2.clearSorting();
3117
+ const newQuery = buildQuery(_.cloneDeep(queryItem));
3118
+ updateURL({
3119
+ ...newQuery,
3120
+ params: {
3121
+ ...newQuery.params,
3122
+ sortKey: void 0
3123
+ }
3124
+ });
3098
3125
  }
3099
3126
  }
3100
3127
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datawheel/data-explorer",
3
- "version": "1.0.7",
3
+ "version": "1.0.8",
4
4
  "main": "./dist/main.mjs",
5
5
  "types": "./dist/main.d.mts",
6
6
  "files": [